boringssl/tool
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
..
args.cc Revert "Move C++ helpers into |bssl| namespace." 2016-07-12 08:09:33 -07:00
ciphers.cc Add new cipherlist-setting APIs that reject nonsense. 2017-02-22 00:09:27 +00:00
client.cc Allow selecting ECDH curves in bssl tool. 2017-04-14 21:50:04 +00:00
CMakeLists.txt Add a basic signing tool. 2017-04-05 23:32:13 +00:00
const.cc Unwind multiprime RSA support. 2017-04-12 23:14:57 +00:00
digest.cc Correctness fixes for NaCl and other platforms. 2016-11-09 19:06:10 +00:00
file.cc Add a basic signing tool. 2017-04-05 23:32:13 +00:00
generate_ed25519.cc Replace Scoped* heap types with bssl::UniquePtr. 2016-09-01 22:22:54 +00:00
genrsa.cc Unwind RSA_generate_multi_prime_key. 2017-04-11 18:15:20 +00:00
internal.h Unwind multiprime RSA support. 2017-04-12 23:14:57 +00:00
pkcs12.cc Work around language and compiler bug in memcpy, etc. 2016-12-21 20:34:47 +00:00
rand.cc Correctness fixes for NaCl and other platforms. 2016-11-09 19:06:10 +00:00
server.cc tool: don't explicitly disable SSLv3 in the server 2017-05-17 15:18:38 +00:00
sign.cc Align EVP_PKEY Ed25519 API with upstream. 2017-06-12 12:04:11 +00:00
speed.cc Implement scrypt from RFC 7914. 2017-06-12 20:32:21 +00:00
tool.cc First part of the FIPS module. 2017-04-07 00:05:34 +00:00
transport_common.cc Support Ed25519 in TLS. 2017-04-06 15:30:17 +00:00
transport_common.h Teach bssl server about -max-version and -min-version. 2016-07-17 08:18:58 +00:00