In particular, this commit adds sha256, sha384 and sha512.
Rough numbers from my system:
Algorithm mode Mbyte/s sha1 update 462.05 openssl sha1 update 804.90 sha256 update 222.32 openssl sha256 update 369.49 sha384 update 355.34 openssl sha384 update 536.05 sha512 update 355.90 openssl sha512 update 546.07
Signed-off-by: Emil Velikov emil.l.velikov@gmail.com --- examples/nettle-benchmark.c | 6 ++++-- examples/nettle-openssl.c | 3 +++ nettle-internal.h | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/examples/nettle-benchmark.c b/examples/nettle-benchmark.c index 5d0e649e..b6e550cf 100644 --- a/examples/nettle-benchmark.c +++ b/examples/nettle-benchmark.c @@ -912,8 +912,10 @@ main(int argc, char **argv) &nettle_md2, &nettle_md4, &nettle_md5, OPENSSL(&nettle_openssl_md5) &nettle_sha1, OPENSSL(&nettle_openssl_sha1) - &nettle_sha224, &nettle_sha256, - &nettle_sha384, &nettle_sha512, + &nettle_sha224, + &nettle_sha256, OPENSSL(&nettle_openssl_sha256) + &nettle_sha384, OPENSSL(&nettle_openssl_sha384) + &nettle_sha512, OPENSSL(&nettle_openssl_sha512) &nettle_sha512_224, &nettle_sha512_256, &nettle_sha3_224, &nettle_sha3_256, &nettle_sha3_384, &nettle_sha3_512, diff --git a/examples/nettle-openssl.c b/examples/nettle-openssl.c index 3c487013..517ed724 100644 --- a/examples/nettle-openssl.c +++ b/examples/nettle-openssl.c @@ -432,5 +432,8 @@ nettle_openssl_##name = { \
OPENSSL_HASH(MD5, md5) OPENSSL_HASH(SHA, sha1) +OPENSSL_HASH(SHA256, sha256) +OPENSSL_HASH(SHA512, sha384) // NOTE: SHA512 here is not a typo +OPENSSL_HASH(SHA512, sha512)
#endif /* WITH_OPENSSL */ diff --git a/nettle-internal.h b/nettle-internal.h index dc379f1f..f1a27f49 100644 --- a/nettle-internal.h +++ b/nettle-internal.h @@ -114,6 +114,9 @@ extern const struct nettle_aead nettle_openssl_arcfour128;
extern const struct nettle_hash nettle_openssl_md5; extern const struct nettle_hash nettle_openssl_sha1; +extern const struct nettle_hash nettle_openssl_sha256; +extern const struct nettle_hash nettle_openssl_sha384; +extern const struct nettle_hash nettle_openssl_sha512;
extern const struct nettle_hash * const _nettle_hashes[];