Skip to content

Commit 239771e

Browse files
Argon2 Variant Test Vectors (#13720)
* Adding test vectors for argon2d and argon2i variants * Updating argon2 test vector docs
1 parent 9218a21 commit 239771e

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed

docs/development/test-vectors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ Key derivation functions
11171117
* X9.63 KDF from `NIST CAVP`_.
11181118
* SP 800-108 Counter Mode KDF (HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
11191119
HMAC-SHA384, HMAC-SHA512) from `NIST CAVP`_.
1120-
* argon2id from :rfc:`9106`, OpenSSL's `evpkdf_argon2.txt`_, and the
1120+
* argon2 variants (argon2d, argon2i, and argon2id) from :rfc:`9106`, OpenSSL's `evpkdf_argon2.txt`_, and the
11211121
argon2 command line application.
11221122

11231123
Key wrapping
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Test vectors from RFC 9106,
2+
# https://github.com/openssl/openssl/blob/01f4b44e075a796d62d3b007a80c5c04d0e77bfb/test/recipes/30-test_evp_data/evpkdf_argon2.txt
3+
# 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 = 512B391B6F1162975371D30919734294F868E3BE3984F3C1A13A4DB9FABE4ACB
15+
16+
# echo -n "password" | argon2 pycasalt -d -t 1 -k 131072 -p 2 -l 64
17+
COUNT = 1
18+
length = 64
19+
lanes = 2
20+
iter = 1
21+
memcost = 131072
22+
salt = 7079636173616c74
23+
pass = 70617373776f7264
24+
output = 8868f5fe0f9c138ef691cd74243cbc7eec42ad4e5a69416cbb744c0d6b751971e22107143986dbb747899451a5f99d4a8eeb102d5852847f473c22e55a040fe7
25+
26+
# echo -n "password" | argon2 pycasalt -d -t 4 -k 50 -p 4 -l 8
27+
COUNT = 2
28+
length = 8
29+
lanes = 4
30+
iter = 4
31+
memcost = 50
32+
salt = 7079636173616c74
33+
pass = 70617373776f7264
34+
output = 29fec2f9cecd8716
35+
36+
# echo -n "password" | argon2 pycasalt -d -t 1 -k 8 -p 1 -l 4
37+
COUNT = 3
38+
length = 4
39+
lanes = 1
40+
iter = 1
41+
memcost = 8
42+
salt = 7079636173616c74
43+
pass = 70617373776f7264
44+
output = a60137a5
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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 = C814D9D1DC7F37AA13F0D77F2494BDA1C8DE6B016DD388D29952A4C4672B6CE8
15+
16+
COUNT = 1
17+
length = 32
18+
lanes = 4
19+
iter = 3
20+
memcost = 32
21+
pass = 0101010101010101010101010101010101010101010101010101010101010101
22+
salt = 02020202020202020202020202020202
23+
output = A9A7510E6DB4D588BA3414CD0E094D480D683F97B9CCB612A544FE8EF65BA8E0
24+
25+
# echo -n "password" | argon2 pycasalt -i -t 1 -k 131072 -p 2 -l 64
26+
COUNT = 2
27+
length = 64
28+
lanes = 2
29+
iter = 1
30+
memcost = 131072
31+
salt = 7079636173616c74
32+
pass = 70617373776f7264
33+
output = 677c326cbd6d3697a1a1433750418795c20414048ff473fa53c0f594b8998f8b58fe36f0eb7b88ee8d9ff5246b9457f02d96dd38c8e062063faf795f877977c5
34+
35+
# echo -n "password" | argon2 pycasalt -i -t 4 -k 50 -p 4 -l 8
36+
COUNT = 3
37+
length = 8
38+
lanes = 4
39+
iter = 4
40+
memcost = 50
41+
salt = 7079636173616c74
42+
pass = 70617373776f7264
43+
output = 87a30dd30bb00555
44+
45+
# echo -n "password" | argon2 pycasalt -i -t 1 -k 8 -p 1 -l 4
46+
COUNT = 4
47+
length = 4
48+
lanes = 1
49+
iter = 1
50+
memcost = 8
51+
salt = 7079636173616c74
52+
pass = 70617373776f7264
53+
output = 040180d6

0 commit comments

Comments
 (0)