svn commit: r331418 - head/tools/tools/crypto
Conrad Meyer
cem at FreeBSD.org
Fri Mar 23 05:37:19 UTC 2018
Author: cem
Date: Fri Mar 23 05:37:18 2018
New Revision: 331418
URL: https://svnweb.freebsd.org/changeset/base/331418
Log:
cryptocheck: Add support for Blake2{B,S} hashes
Since they are not yet present in the version of openssl in base, this will
require installing the ports openssl.
Sponsored by: Dell EMC Isilon
Modified:
head/tools/tools/crypto/Makefile
head/tools/tools/crypto/cryptocheck.c
Modified: head/tools/tools/crypto/Makefile
==============================================================================
--- head/tools/tools/crypto/Makefile Fri Mar 23 04:31:19 2018 (r331417)
+++ head/tools/tools/crypto/Makefile Fri Mar 23 05:37:18 2018 (r331418)
@@ -32,7 +32,10 @@ MAN=
BINDIR?= /usr/local/bin
# cryptocheck: test symmetric crypto functions
-LIBADD.cryptocheck+= crypto ssl util
+# Use openssl from ports for Blake2 algorithms
+CFLAGS.cryptocheck.c+= $$(pkg-config --cflags openssl)
+LDFLAGS.cryptocheck+= $$(pkg-config --libs openssl)
+LIBADD.cryptocheck+= util
# cryptokeytest: test asymmetric crypto functions
LIBADD.cryptokeytest+= crypto
Modified: head/tools/tools/crypto/cryptocheck.c
==============================================================================
--- head/tools/tools/crypto/cryptocheck.c Fri Mar 23 04:31:19 2018 (r331417)
+++ head/tools/tools/crypto/cryptocheck.c Fri Mar 23 05:37:18 2018 (r331418)
@@ -59,6 +59,8 @@
* sha256 256-bit sha2 hmac
* sha384 384-bit sha2 hmac
* sha512 512-bit sha2 hmac
+ * blake2b Blake2-B
+ * blake2s Blake2-S
*
* Block Ciphers:
* aes-cbc 128-bit aes cbc
@@ -115,6 +117,10 @@ struct alg {
.evp_md = EVP_sha384 },
{ .name = "sha512", .mac = CRYPTO_SHA2_512_HMAC, .type = T_HMAC,
.evp_md = EVP_sha512 },
+ { .name = "blake2b", .mac = CRYPTO_BLAKE2B, .type = T_HMAC,
+ .evp_md = EVP_blake2b512 },
+ { .name = "blake2s", .mac = CRYPTO_BLAKE2S, .type = T_HMAC,
+ .evp_md = EVP_blake2s256 },
{ .name = "aes-cbc", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER,
.evp_cipher = EVP_aes_128_cbc },
{ .name = "aes-cbc192", .cipher = CRYPTO_AES_CBC, .type = T_BLKCIPHER,
More information about the svn-src-all
mailing list