Skip to content

Commit 408b9f8

Browse files
authored
argon2id test vectors (pyca#11523)
1 parent ba8d51f commit 408b9f8

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

docs/development/test-vectors.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,8 @@ Key derivation functions
963963
* X9.63 KDF from `NIST CAVP`_.
964964
* SP 800-108 Counter Mode KDF (HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
965965
HMAC-SHA384, HMAC-SHA512) from `NIST CAVP`_.
966+
* argon2id from :rfc:`9106`, OpenSSL's `evpkdf_argon2.txt`_, and the
967+
argon2 command line application.
966968

967969
Key wrapping
968970
~~~~~~~~~~~~
@@ -1108,4 +1110,5 @@ header format (substituting the correct information):
11081110
.. _`dkg's additional OCB3 vectors`: https://gitlab.com/dkg/ocb-test-vectors
11091111
.. _`OpenSSL's OCB vectors`: https://github.com/openssl/openssl/commit/2f19ab18a29cf9c82cdd68bc8c7e5be5061b19be
11101112
.. _`badkeys`: https://github.com/vcsjones/badkeys/tree/50f1cc5f8d13bf3a2046d689f6452decb15d9c3c
1113+
.. _`evpkdf_argon2.txt`: https://github.com/openssl/openssl/blob/01f4b44e075a796d62d3b007a80c5c04d0e77bfb/test/recipes/30-test_evp_data/evpkdf_argon2.txt
11111114
.. _`OpenSSL's RFC 6979 test vectors`: https://github.com/openssl/openssl/blob/01690a7ff36c4d18c48b301cdf375c954105a1d9/test/recipes/30-test_evp_data/evppkey_ecdsa_rfc6979.txt

docs/spelling_wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
AArch
22
accessor
33
affine
4+
argon2
5+
argon2id
46
Authenticator
57
authenticator
68
backend
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Test vectors from RFC 9106,
2+
# https://github.com/openssl/openssl/blob/01f4b44e075a796d62d3b007a80c5c04d0e77bfb/test/recipes/30-test_evp_data/evpkdf_argon2.txt
3+
# and the argon2 CLI tool. Adapted for the pyca/cryptography NIST loaders
4+
5+
COUNT = 0
6+
length = 32
7+
lanes = 4
8+
iter = 3
9+
memcost = 32
10+
secret = 0303030303030303
11+
pass = 0101010101010101010101010101010101010101010101010101010101010101
12+
salt = 02020202020202020202020202020202
13+
ad = 040404040404040404040404
14+
output = 0d640df58d78766c08c037a34a8b53c9d01ef0452d75b65eb52520e96b01e659
15+
16+
COUNT = 1
17+
length = 32
18+
lanes = 4
19+
iter = 3
20+
memcost = 32
21+
pass =
22+
salt = 02020202020202020202020202020202
23+
output = 0a34f1abde67086c82e785eaf17c68382259a264f4e61b91cd2763cb75ac189a
24+
25+
COUNT = 2
26+
length = 32
27+
lanes = 4
28+
iter = 3
29+
memcost = 32
30+
pass = 0101010101010101010101010101010101010101010101010101010101010101
31+
salt = 02020202020202020202020202020202
32+
output = 03aab965c12001c9d7d0d2de33192c0494b684bb148196d73c1df1acaf6d0c2e
33+
34+
# echo -n "password" | argon2 pycasalt -id -t 1 -k 131072 -p 2 -l 64
35+
COUNT = 3
36+
length = 64
37+
lanes = 2
38+
iter = 1
39+
memcost = 131072
40+
salt = 7079636173616c74
41+
pass = 70617373776f7264
42+
output = e9e42714a15947f6ce1fdabbb667dfc9fd1af7c473f021cc3402506bfa7750533f33aa44e3aebcf336680f4a2bdc371758574ad48470f05a9ee2ffd70c150b4c
43+
44+
# echo -n "password" | argon2 pycasalt -id -t 4 -k 50 -p 4 -l 8
45+
COUNT = 4
46+
length = 8
47+
lanes = 4
48+
iter = 4
49+
memcost = 50
50+
salt = 7079636173616c74
51+
pass = 70617373776f7264
52+
output = e469b777841e543f
53+
54+
# echo -n "password" | argon2 pycasalt -id -t 1 -k 8 -p 1 -l 4
55+
COUNT = 5
56+
length = 4
57+
lanes = 1
58+
iter = 1
59+
memcost = 8
60+
salt = 7079636173616c74
61+
pass = 70617373776f7264
62+
output = 009c7809

0 commit comments

Comments
 (0)