diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index a61fb265ce72..cccbe308e083 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -1117,7 +1117,7 @@ Key derivation functions * X9.63 KDF from `NIST CAVP`_. * SP 800-108 Counter Mode KDF (HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, HMAC-SHA512) from `NIST CAVP`_. -* argon2id from :rfc:`9106`, OpenSSL's `evpkdf_argon2.txt`_, and the +* argon2 variants (argon2d, argon2i, and argon2id) from :rfc:`9106`, OpenSSL's `evpkdf_argon2.txt`_, and the argon2 command line application. Key wrapping diff --git a/vectors/cryptography_vectors/KDF/argon2d.txt b/vectors/cryptography_vectors/KDF/argon2d.txt new file mode 100644 index 000000000000..20decde83e5a --- /dev/null +++ b/vectors/cryptography_vectors/KDF/argon2d.txt @@ -0,0 +1,44 @@ +# Test vectors from RFC 9106, +# https://github.com/openssl/openssl/blob/01f4b44e075a796d62d3b007a80c5c04d0e77bfb/test/recipes/30-test_evp_data/evpkdf_argon2.txt +# Adapted for the pyca/cryptography NIST loaders + +COUNT = 0 +length = 32 +lanes = 4 +iter = 3 +memcost = 32 +secret = 0303030303030303 +pass = 0101010101010101010101010101010101010101010101010101010101010101 +salt = 02020202020202020202020202020202 +ad = 040404040404040404040404 +output = 512B391B6F1162975371D30919734294F868E3BE3984F3C1A13A4DB9FABE4ACB + +# echo -n "password" | argon2 pycasalt -d -t 1 -k 131072 -p 2 -l 64 +COUNT = 1 +length = 64 +lanes = 2 +iter = 1 +memcost = 131072 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = 8868f5fe0f9c138ef691cd74243cbc7eec42ad4e5a69416cbb744c0d6b751971e22107143986dbb747899451a5f99d4a8eeb102d5852847f473c22e55a040fe7 + +# echo -n "password" | argon2 pycasalt -d -t 4 -k 50 -p 4 -l 8 +COUNT = 2 +length = 8 +lanes = 4 +iter = 4 +memcost = 50 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = 29fec2f9cecd8716 + +# echo -n "password" | argon2 pycasalt -d -t 1 -k 8 -p 1 -l 4 +COUNT = 3 +length = 4 +lanes = 1 +iter = 1 +memcost = 8 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = a60137a5 \ No newline at end of file diff --git a/vectors/cryptography_vectors/KDF/argon2i.txt b/vectors/cryptography_vectors/KDF/argon2i.txt new file mode 100644 index 000000000000..186b2bf3241a --- /dev/null +++ b/vectors/cryptography_vectors/KDF/argon2i.txt @@ -0,0 +1,53 @@ +# Test vectors from RFC 9106, +# https://github.com/openssl/openssl/blob/01f4b44e075a796d62d3b007a80c5c04d0e77bfb/test/recipes/30-test_evp_data/evpkdf_argon2.txt +# and the argon2 CLI tool. Adapted for the pyca/cryptography NIST loaders + +COUNT = 0 +length = 32 +lanes = 4 +iter = 3 +memcost = 32 +secret = 0303030303030303 +pass = 0101010101010101010101010101010101010101010101010101010101010101 +salt = 02020202020202020202020202020202 +ad = 040404040404040404040404 +output = C814D9D1DC7F37AA13F0D77F2494BDA1C8DE6B016DD388D29952A4C4672B6CE8 + +COUNT = 1 +length = 32 +lanes = 4 +iter = 3 +memcost = 32 +pass = 0101010101010101010101010101010101010101010101010101010101010101 +salt = 02020202020202020202020202020202 +output = A9A7510E6DB4D588BA3414CD0E094D480D683F97B9CCB612A544FE8EF65BA8E0 + +# echo -n "password" | argon2 pycasalt -i -t 1 -k 131072 -p 2 -l 64 +COUNT = 2 +length = 64 +lanes = 2 +iter = 1 +memcost = 131072 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = 677c326cbd6d3697a1a1433750418795c20414048ff473fa53c0f594b8998f8b58fe36f0eb7b88ee8d9ff5246b9457f02d96dd38c8e062063faf795f877977c5 + +# echo -n "password" | argon2 pycasalt -i -t 4 -k 50 -p 4 -l 8 +COUNT = 3 +length = 8 +lanes = 4 +iter = 4 +memcost = 50 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = 87a30dd30bb00555 + +# echo -n "password" | argon2 pycasalt -i -t 1 -k 8 -p 1 -l 4 +COUNT = 4 +length = 4 +lanes = 1 +iter = 1 +memcost = 8 +salt = 7079636173616c74 +pass = 70617373776f7264 +output = 040180d6 \ No newline at end of file