More tests

This commit is contained in:
Hans Svensson
2018-03-02 14:25:18 +01:00
parent 4d2af24250
commit 4414c0d7a2
3 changed files with 27 additions and 6 deletions
+9 -2
View File
@@ -7,6 +7,14 @@
-compile([export_all, nowarn_export_all]).
%% -- Test data --------------------------------------------------------------
curve25519_data() ->
#{ a_priv => hex_str_to_bin("0x77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a"),
a_pub => hex_str_to_bin("0x8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98eaa9b4e6a"),
b_priv => hex_str_to_bin("0x5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb"),
b_pub => hex_str_to_bin("0xde9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f"),
shared => hex_str_to_bin("0x4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742")
}.
chacha_data() ->
#{ key => hex_str_to_bin("0x1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c0")
, nonce => 16#0807060504030201
@@ -94,5 +102,4 @@ blake2b_hkdf_data() ->
}].
hex_str_to_bin("0x" ++ Rest) ->
<< <<(list_to_integer([C], 16)):4>> || C <- Rest >>.
hex_str_to_bin("0x" ++ Rest) -> << <<(list_to_integer([C], 16)):4>> || C <- Rest >>.