summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-11-14 04:09:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-14 07:54:53 (GMT)
commit4b4e2918099600c1eefe7b5a71bf647803905b7e (patch)
tree448d0112cefe9a72b54508660de6facd31db90aa /hash.h
parent27dc04c54506967fcaa87b2d560547ee5633040c (diff)
downloadgit-4b4e2918099600c1eefe7b5a71bf647803905b7e.zip
git-4b4e2918099600c1eefe7b5a71bf647803905b7e.tar.gz
git-4b4e2918099600c1eefe7b5a71bf647803905b7e.tar.bz2
hash: add an SHA-256 implementation using OpenSSL
We already have OpenSSL routines available for SHA-1, so add routines for SHA-256 as well. On a Core i7-6600U, this SHA-256 implementation compares favorably to the SHA1DC SHA-1 implementation: SHA-1: 157 MiB/s (64 byte chunks); 337 MiB/s (16 KiB chunks) SHA-256: 165 MiB/s (64 byte chunks); 408 MiB/s (16 KiB chunks) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hash.h b/hash.h
index 2ef0980..adde708 100644
--- a/hash.h
+++ b/hash.h
@@ -17,6 +17,8 @@
#if defined(SHA256_GCRYPT)
#include "sha256/gcrypt.h"
+#elif defined(SHA256_OPENSSL)
+#include <openssl/sha.h>
#else
#include "sha256/block/sha256.h"
#endif