summaryrefslogtreecommitdiffstats
path: root/lib/libcrypt
diff options
context:
space:
mode:
authorallanjude <allanjude@FreeBSD.org>2016-05-28 16:06:07 +0000
committerallanjude <allanjude@FreeBSD.org>2016-05-28 16:06:07 +0000
commit4581e38971cdd62b178bbed2066ac8c3b0ec5499 (patch)
treefb7b8495c2429cb7c5e5287882efd1fd12bb6120 /lib/libcrypt
parent15f895037c82da771c558cbbda75c3ae7f309e15 (diff)
downloadFreeBSD-src-4581e38971cdd62b178bbed2066ac8c3b0ec5499.zip
FreeBSD-src-4581e38971cdd62b178bbed2066ac8c3b0ec5499.tar.gz
Implement SHA-512 truncated (224 and 256 bits)
This implements SHA-512/256, which generates a 256 bit hash by calculating the SHA-512 then truncating the result. A different initial value is used, making the result different from the first 256 bits of the SHA-512 of the same input. SHA-512 is ~50% faster than SHA-256 on 64bit platforms, so the result is a faster 256 bit hash. The main goal of this implementation is to enable support for this faster hashing algorithm in ZFS. The feature was introduced into ZFS in r289422, but is disconnected because SHA-512/256 support was missing. A further commit will enable it in ZFS. This is the follow on to r292782 Reviewed by: cem Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D6061
Diffstat (limited to 'lib/libcrypt')
-rw-r--r--lib/libcrypt/Makefile2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index c1f8542..3b982a3 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -31,6 +31,8 @@ CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH
.for sym in MD4Init MD4Final MD4Update MD4Pad \
MD5Init MD5Final MD5Update MD5Pad \
SHA256_Init SHA256_Final SHA256_Update \
+ SHA512_224_Init SHA512_224_Final SHA512_224_Update \
+ SHA512_256_Init SHA512_256_Final SHA512_256_Update \
SHA384_Init SHA384_Final SHA384_Update \
SHA512_Init SHA512_Final SHA512_Update
CFLAGS+= -D${sym}=__${sym}
OpenPOWER on IntegriCloud