aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/test
diff options
context:
space:
mode:
authorAndreas Schultz <[email protected]>2014-06-16 18:46:09 +0200
committerAndreas Schultz <[email protected]>2014-09-03 15:26:00 +0200
commitfb9d36c2c7c1bd4760d0be2801b9c2852d3502bf (patch)
tree62326d163e0ecc152efe39f1ad1aaff15d592e71 /lib/crypto/test
parentd1dcc88aa5b1c749034570eb7c86db7c58d652f9 (diff)
downloadotp-fb9d36c2c7c1bd4760d0be2801b9c2852d3502bf.tar.gz
otp-fb9d36c2c7c1bd4760d0be2801b9c2852d3502bf.tar.bz2
otp-fb9d36c2c7c1bd4760d0be2801b9c2852d3502bf.zip
crypto: add support for ChaCha20/Policy1305 AEAD cipher
Diffstat (limited to 'lib/crypto/test')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index f3ec20b11e..1031e6403f 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -63,6 +63,7 @@ all() ->
{group, rc4},
{group, aes_ctr},
{group, aes_gcm},
+ {group, chacha20_poly1305},
mod_pow,
exor,
rand_uniform
@@ -102,7 +103,8 @@ groups() ->
{blowfish_ofb64,[], [block]},
{rc4, [], [stream]},
{aes_ctr, [], [stream]},
- {aes_gcm, [], [aead]}
+ {aes_gcm, [], [aead]},
+ {chacha20_poly1305, [], [aead]}
].
%%-------------------------------------------------------------------
@@ -777,6 +779,9 @@ group_config(aes_ctr, Config) ->
group_config(aes_gcm, Config) ->
AEAD = aes_gcm(),
[{aead, AEAD} | Config];
+group_config(chacha20_poly1305, Config) ->
+ AEAD = chacha20_poly1305(),
+ [{aead, AEAD} | Config];
group_config(_, Config) ->
Config.
@@ -1657,6 +1662,18 @@ aes_gcm() ->
hexstr2bin("a44a8266ee1c8eb0c8b5d4cf5ae9f19a")} %% CipherTag
].
+%% http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04
+chacha20_poly1305() ->
+ [
+ {chacha20_poly1305, hexstr2bin("4290bcb154173531f314af57f3be3b500" %% Key
+ "6da371ece272afa1b5dbdd1100a1007"),
+ hexstr2bin("86d09974840bded2a5ca"), %% PlainText
+ hexstr2bin("cd7cf67be39c794a"), %% Nonce
+ hexstr2bin("87e229d4500845a079c0"), %% AAD
+ hexstr2bin("e3e446f7ede9a19b62a4"), %% CipherText
+ hexstr2bin("677dabf4e3d24b876bb284753896e1d6")} %% CipherTag
+ ].
+
rsa_plain() ->
<<"7896345786348756234 Hejsan Svejsan, erlang crypto debugger"
"09812312908312378623487263487623412039812 huagasd">>.