aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/src/crypto.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-02-06 11:38:05 +0100
committerGitHub <[email protected]>2019-02-06 11:38:05 +0100
commit3542afbdc4909455ad9e45e2b5328835a838a1bd (patch)
tree01b5bbd83c684737aaa3a46735f86a7a93b8e423 /lib/crypto/src/crypto.erl
parent152c7863a80c308075b6b67a704dd2234a4e28e2 (diff)
parent9aa84d39edef976250774811ac9a6e6895041c14 (diff)
downloadotp-3542afbdc4909455ad9e45e2b5328835a838a1bd.tar.gz
otp-3542afbdc4909455ad9e45e2b5328835a838a1bd.tar.bz2
otp-3542afbdc4909455ad9e45e2b5328835a838a1bd.zip
Merge pull request #2129 from hanssv/crypto/add_blake2_support
Add hash function BLAKE2 to crypto:hash/hmac OTP-15564
Diffstat (limited to 'lib/crypto/src/crypto.erl')
-rw-r--r--lib/crypto/src/crypto.erl7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 987bc3fe0f..de8cfac9a2 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -287,6 +287,7 @@
-type sha1() :: sha .
-type sha2() :: sha224 | sha256 | sha384 | sha512 .
-type sha3() :: sha3_224 | sha3_256 | sha3_384 | sha3_512 .
+-type blake2() :: blake2b | blake2s .
-type compatibility_only_hash() :: md5 | md4 .
@@ -329,11 +330,11 @@ stop() ->
| {macs, Macs}
| {curves, Curves}
| {rsa_opts, RSAopts},
- Hashs :: [sha1() | sha2() | sha3() | ripemd160 | compatibility_only_hash()],
+ Hashs :: [sha1() | sha2() | sha3() | blake2() | ripemd160 | compatibility_only_hash()],
Ciphers :: [stream_cipher()
| block_cipher_with_iv() | block_cipher_without_iv()
| aead_cipher()
- ],
+ ],
PKs :: [rsa | dss | ecdsa | dh | ecdh | ec_gf2m],
Macs :: [hmac | cmac | poly1305],
Curves :: [ec_named_curve() | edwards_curve_dh() | edwards_curve_ed()],
@@ -367,7 +368,7 @@ enable_fips_mode(_) -> ?nif_stub.
%%%
%%%================================================================
--define(HASH_HASH_ALGORITHM, sha1() | sha2() | sha3() | ripemd160 | compatibility_only_hash() ).
+-define(HASH_HASH_ALGORITHM, sha1() | sha2() | sha3() | blake2() | ripemd160 | compatibility_only_hash() ).
-spec hash(Type, Data) -> Digest when Type :: ?HASH_HASH_ALGORITHM,
Data :: iodata(),