From 75e72ea9772dd3ae54bc1386f074370d43e356b8 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 1 Mar 2014 12:18:27 -0800 Subject: Added vectors for scrypt from the draft RFC --- docs/development/test-vectors.rst | 11 ++++++-- tests/hazmat/primitives/vectors/KDF/scrypt.txt | 38 ++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 tests/hazmat/primitives/vectors/KDF/scrypt.txt diff --git a/docs/development/test-vectors.rst b/docs/development/test-vectors.rst index c96b6d89..8b27e9d9 100644 --- a/docs/development/test-vectors.rst +++ b/docs/development/test-vectors.rst @@ -15,10 +15,12 @@ Asymmetric Ciphers * RSA PKCS #1 from the RSA FTP site (ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/ and ftp://ftp.rsa.com/pub/rsalabs/tmp/). -* OpenSSL PEM serialization vectors from the `OpenSSL test suite`_ and `GnuTLS test suite`_. +* OpenSSL PEM serialization vectors from the `OpenSSL test suite`_ and `GnuTLS + test suite`_. * PKCS #8 PEM serialization vectors from - * GnuTLS: `encpkcs8.pem`_, `enc2pkcs8.pem`_, `unencpkcs8.pem`_, `pkcs12_s2k_pem.c`_. + * GnuTLS: `encpkcs8.pem`_, `enc2pkcs8.pem`_, `unencpkcs8.pem`_, + `pkcs12_s2k_pem.c`_. * `Botan's ECC private keys`_. Hashes @@ -43,6 +45,7 @@ Key Derivation Functions * HKDF (SHA1, SHA256) from :rfc:`5869`. * PBKDF2 (HMAC-SHA1) from :rfc:`6070`. +* scrypt from the `draft RFC`_. Recipes ~~~~~~~ @@ -67,7 +70,8 @@ Two Factor Authentication ~~~~~~~~~~~~~~~~~~~~~~~~~ * HOTP from :rfc:`4226` -* TOTP from :rfc:`6238` (Note that an `errata`_ for the test vectors in RFC 6238 exists) +* TOTP from :rfc:`6238` (Note that an `errata`_ for the test vectors in RFC + 6238 exists) Creating Test Vectors @@ -103,6 +107,7 @@ header format (substituting the correct information): .. _`OpenSSL's test vectors`: https://github.com/openssl/openssl/blob/97cf1f6c2854a3a955fd7dd3a1f113deba00c9ef/crypto/evp/evptests.txt#L232 .. _`RIPEMD website`: http://homes.esat.kuleuven.be/~bosselae/ripemd160.html .. _`Whirlpool website`: http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html +.. _`draft RFC`: https://tools.ietf.org/html/draft-josefsson-scrypt-kdf-01 .. _`Specification repository`: https://github.com/fernet/spec .. _`errata`: http://www.rfc-editor.org/errata_search.php?rfc=6238 .. _`OpenSSL test suite`: http://git.openssl.org/gitweb/?p=openssl.git;a=blob;f=test/testrsa.pem;h=aad21067a8f7cb93a52a511eb9162fd83be39135;hb=66e8211c0b1347970096e04b18aa52567c325200 diff --git a/tests/hazmat/primitives/vectors/KDF/scrypt.txt b/tests/hazmat/primitives/vectors/KDF/scrypt.txt new file mode 100644 index 00000000..ad0dfc83 --- /dev/null +++ b/tests/hazmat/primitives/vectors/KDF/scrypt.txt @@ -0,0 +1,38 @@ +COUNT = 0 +PASSWORD = +SALT = +N = 16 +r = 1 +p = 1 +LENGTH = 64 +DERIVED_KEY = 77d6576238657b203b19ca42c18a0497f16b4844e3074ae8dfdffa3fede21442fcd0069ded0948f8326a753a0fc81f17e8d3e0fb2e0d3628cf35e20c38d18906 + + +COUNT = 1 +PASSWORD = password +SALT = NaCl +N = 1024 +r = 8 +p = 16 +LENGTH = 64 +DERIVED_KEY = fdbabe1c9d3472007856e7190d01e9fe7c6ad7cbc8237830e77376634b3731622eaf30d92e22a3886ff109279d9830dac727afb94a83ee6d8360cbdfa2cc0640 + + +COUNT = 2 +PASSWORD = pleaseletmein +SALT = SodiumChloride +N = 16384 +r = 8 +p = 1 +LENGTH = 64 +DERIVED_KEY = 7023bdcb3afd7348461c06cd81fd38ebfda8fbba904f8e3ea9b543f6545da1f2d5432955613f0fcf62d49705242a9af9e61e85dc0d651e40dfcf017b45575887 + + +COUNT = 3 +PASSWORD = pleaseletmein +SALT = SodiumChloride +N = 1048576 +r = 8 +p = 1 +LENGTH = 64 +DERIVED_KEY = 2101cb9b6a511aaeaddbbe09cf70f881ec568d574a2ffd4dabe5ee9820adaa478e56fd8f4ba5d09ffa1c6d927c40f4c337304049e8a952fbcbf45c6fa77a41a4 -- cgit v1.2.3