aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/src/crypto.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2018-06-28 17:49:34 +0200
committerHans Nilsson <[email protected]>2018-08-23 12:45:25 +0200
commit91ae48fedc6986a19c6d79c4371b743e8b39ab31 (patch)
treebe38b6c0a286362428476c90504e3991f92b007b /lib/crypto/src/crypto.erl
parent4479223613dc6a0e82059c310b13fd072b9e31a3 (diff)
downloadotp-91ae48fedc6986a19c6d79c4371b743e8b39ab31.tar.gz
otp-91ae48fedc6986a19c6d79c4371b743e8b39ab31.tar.bz2
otp-91ae48fedc6986a19c6d79c4371b743e8b39ab31.zip
crypto: Mac POLY1305 if >=OpenSSL 1.1.1-pre8
Diffstat (limited to 'lib/crypto/src/crypto.erl')
-rw-r--r--lib/crypto/src/crypto.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 81ab4e5ea1..3774f936e7 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -29,6 +29,7 @@
-export([generate_key/2, generate_key/3, compute_key/4]).
-export([hmac/3, hmac/4, hmac_init/2, hmac_update/2, hmac_final/1, hmac_final_n/2]).
-export([cmac/3, cmac/4]).
+-export([poly1305/2]).
-export([exor/2, strong_rand_bytes/1, mod_pow/3]).
-export([rand_seed/0, rand_seed_alg/1]).
-export([rand_seed_s/0, rand_seed_alg_s/1]).
@@ -194,6 +195,9 @@ cmac(Type, Key, Data) ->
cmac(Type, Key, Data, MacSize) ->
erlang:binary_part(cmac(Type, Key, Data), 0, MacSize).
+poly1305(Key, Data) ->
+ poly1305_nif(Key, Data).
+
%% Ecrypt/decrypt %%%
-spec block_encrypt(des_cbc | des_cfb |
@@ -1060,9 +1064,12 @@ hmac_final_nif(_Context) -> ?nif_stub.
hmac_final_nif(_Context, _MacSize) -> ?nif_stub.
%% CMAC
-
cmac_nif(_Type, _Key, _Data) -> ?nif_stub.
+%% POLY1305
+poly1305_nif(_Key, _Data) -> ?nif_stub.
+
+
%% CIPHERS --------------------------------------------------------------------
block_crypt_nif(_Type, _Key, _Ivec, _Text, _IsEncrypt) -> ?nif_stub.