diff options
author | Yawning Angel <yawning@schwanenlied.me> | 2015-12-18 22:15:01 +0000 |
---|---|---|
committer | Yawning Angel <yawning@schwanenlied.me> | 2015-12-19 22:44:05 +0000 |
commit | 687f9b3bd7b55bcf4d984d745e978c2a03aeb4e1 (patch) | |
tree | 47ea7e28d46bb2faffddf0fd6911835ade87d425 /src/common/crypto.h | |
parent | 5356eba6ca31c881032c028f4797a0b1ede28bae (diff) | |
download | tor-687f9b3bd7b55bcf4d984d745e978c2a03aeb4e1.tar.gz tor-687f9b3bd7b55bcf4d984d745e978c2a03aeb4e1.zip |
Add the SHA-3 hash functions to common/crypto.h.
* DIGEST_SHA3_[256,512] added as supported algorithms, which do
exactly what is said on the tin.
* test/bench now benchmarks all of the supported digest algorithms,
so it's possible to see just how slow SHA-3 is, though the message
sizes could probably use tweaking since this is very dependent on
the message size vs the SHA-3 rate.
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r-- | src/common/crypto.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h index 0fba958f8d..ff640ced0e 100644 --- a/src/common/crypto.h +++ b/src/common/crypto.h @@ -96,8 +96,10 @@ typedef enum { DIGEST_SHA1 = 0, DIGEST_SHA256 = 1, DIGEST_SHA512 = 2, + DIGEST_SHA3_256 = 3, + DIGEST_SHA3_512 = 4, } digest_algorithm_t; -#define N_DIGEST_ALGORITHMS (DIGEST_SHA512+1) +#define N_DIGEST_ALGORITHMS (DIGEST_SHA3_512+1) #define digest_algorithm_bitfield_t ENUM_BF(digest_algorithm_t) /** A set of all the digests we know how to compute, taken on a single |