boringssl/crypto/evp
David Benjamin b529253bea Implement scrypt from RFC 7914.
This imports upstream's scrypt implementation, though it's been heavily
revised. I lost track of words vs. blocks vs. bigger blocks too many
times in the original code and introduced a typedef for the fixed-width
Salsa20 blocks. The downside is going from bytes to blocks is a bit
trickier, so I took advantage of our little-endian assumption.

This also adds an missing check for N < 2^32. Upstream's code is making
this assumption in Integerify. I'll send that change back upstream. I've
also removed the weird edge case where a NULL out_key parameter means to
validate N/r/p against max_mem and nothing else. That's just in there to
get a different error code out of their PKCS#12 code.

Performance-wise, the cleanup appears to be the same (up to what little
precision I was able to get here), but an optimization to use bitwise
AND rather than modulus makes us measurably faster. Though scrypt isn't
a fast operation to begin with, so hopefully it isn't anyone's
bottleneck.

This CL does not route scrypt up to the PKCS#12 code, though we could
write our own version of that if we need to later.

BUG=chromium:731993

Change-Id: Ib2f43344017ed37b6bafd85a2c2b103d695020b8
Reviewed-on: https://boringssl-review.googlesource.com/17084
Reviewed-by: Adam Langley <agl@google.com>
2017-06-12 20:32:21 +00:00
..
CMakeLists.txt Implement scrypt from RFC 7914. 2017-06-12 20:32:21 +00:00
digestsign.c Align EVP_PKEY Ed25519 API with upstream. 2017-06-12 12:04:11 +00:00
evp_asn1.c Implement draft-ietf-curdle-pkix-04's serialization. 2017-04-05 23:02:22 +00:00
evp_ctx.c Align EVP_PKEY Ed25519 API with upstream. 2017-06-12 12:04:11 +00:00
evp_extra_test.cc Align EVP_PKEY Ed25519 API with upstream. 2017-06-12 12:04:11 +00:00
evp_test.cc Align EVP_PKEY Ed25519 API with upstream. 2017-06-12 12:04:11 +00:00
evp_tests.txt Import Ed25519 tests from upstream to evp_tests.txt. 2017-06-08 23:53:06 +00:00
evp.c Implement draft-ietf-curdle-pkix-04's serialization. 2017-04-05 23:02:22 +00:00
internal.h Support EVP_PKEY_{sign,verify}_message with Ed25519. 2017-04-05 23:05:14 +00:00
p_dsa_asn1.c
p_ec_asn1.c
p_ec.c Move ec/ and ecdsa/ into fipsmodule/ 2017-05-04 20:27:23 +00:00
p_ed25519_asn1.c Support EVP_PKEY_{sign,verify}_message with Ed25519. 2017-04-05 23:05:14 +00:00
p_ed25519.c Support EVP_PKEY_{sign,verify}_message with Ed25519. 2017-04-05 23:05:14 +00:00
p_rsa_asn1.c Add a flag to toggle the buggy RSA parser. 2017-05-10 15:49:33 +00:00
p_rsa.c Move rsa/ to fipsmodule/rsa/ 2017-05-04 21:22:39 +00:00
pbkdf_test.cc Convert various tests to GTest. 2017-05-23 22:34:09 +00:00
pbkdf.c Clean up PKCS5_PBKDF2_HMAC. 2017-04-04 18:13:53 +00:00
print.c Move rsa/ to fipsmodule/rsa/ 2017-05-04 21:22:39 +00:00
scrypt_test.cc Implement scrypt from RFC 7914. 2017-06-12 20:32:21 +00:00
scrypt_tests.txt Implement scrypt from RFC 7914. 2017-06-12 20:32:21 +00:00
scrypt.c Implement scrypt from RFC 7914. 2017-06-12 20:32:21 +00:00
sign.c