diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-02-23 07:25:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-02-23 07:25:12 -0500 |
commit | 882e0fbd76b9b56b943680a310d16fc94ab07438 (patch) | |
tree | d738366734ac1ae1f523fd1343064c4b93af36d6 /src/common/crypto.h | |
parent | b3534dfc5e85c82e915c1576a8a58500fdd7c878 (diff) | |
parent | e202f3a1ca2d2ef87820d0ff618a37d76b4e702a (diff) | |
download | tor-882e0fbd76b9b56b943680a310d16fc94ab07438.tar.gz tor-882e0fbd76b9b56b943680a310d16fc94ab07438.zip |
Merge branch 'bug17795'
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r-- | src/common/crypto.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h index 74b88bcd4a..2da7f9e2a1 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -100,8 +100,9 @@ typedef enum { DIGEST_SHA3_512 = 4, } digest_algorithm_t; #define N_DIGEST_ALGORITHMS (DIGEST_SHA3_512+1) +#define N_COMMON_DIGEST_ALGORITHMS (DIGEST_SHA256+1) -/** A set of all the digests we know how to compute, taken on a single +/** A set of all the digests we commonly compute, taken on a single * string. Any digests that are shorter than 512 bits are right-padded * with 0 bits. * @@ -110,8 +111,8 @@ typedef enum { * once. **/ typedef struct { - char d[N_DIGEST_ALGORITHMS][DIGEST512_LEN]; -} digests_t; + char d[N_COMMON_DIGEST_ALGORITHMS][DIGEST256_LEN]; +} common_digests_t; typedef struct crypto_pk_t crypto_pk_t; typedef struct crypto_cipher_t crypto_cipher_t; @@ -191,7 +192,8 @@ int crypto_pk_private_hybrid_decrypt(crypto_pk_t *env, char *to, int crypto_pk_asn1_encode(crypto_pk_t *pk, char *dest, size_t dest_len); crypto_pk_t *crypto_pk_asn1_decode(const char *str, size_t len); int crypto_pk_get_digest(const crypto_pk_t *pk, char *digest_out); -int crypto_pk_get_all_digests(crypto_pk_t *pk, digests_t *digests_out); +int crypto_pk_get_common_digests(crypto_pk_t *pk, + common_digests_t *digests_out); int crypto_pk_get_fingerprint(crypto_pk_t *pk, char *fp_out,int add_space); int crypto_pk_get_hashed_fingerprint(crypto_pk_t *pk, char *fp_out); @@ -220,7 +222,7 @@ int crypto_digest256(char *digest, const char *m, size_t len, digest_algorithm_t algorithm); int crypto_digest512(char *digest, const char *m, size_t len, digest_algorithm_t algorithm); -int crypto_digest_all(digests_t *ds_out, const char *m, size_t len); +int crypto_common_digests(common_digests_t *ds_out, const char *m, size_t len); struct smartlist_t; void crypto_digest_smartlist_prefix(char *digest_out, size_t len_out, const char *prepend, |