b529253bea
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>
35 lines
958 B
Plaintext
35 lines
958 B
Plaintext
EVP,100,BUFFER_TOO_SMALL
|
|
EVP,101,COMMAND_NOT_SUPPORTED
|
|
EVP,102,DECODE_ERROR
|
|
EVP,103,DIFFERENT_KEY_TYPES
|
|
EVP,104,DIFFERENT_PARAMETERS
|
|
EVP,105,ENCODE_ERROR
|
|
EVP,106,EXPECTING_AN_EC_KEY_KEY
|
|
EVP,107,EXPECTING_AN_RSA_KEY
|
|
EVP,108,EXPECTING_A_DSA_KEY
|
|
EVP,109,ILLEGAL_OR_UNSUPPORTED_PADDING_MODE
|
|
EVP,110,INVALID_DIGEST_LENGTH
|
|
EVP,111,INVALID_DIGEST_TYPE
|
|
EVP,112,INVALID_KEYBITS
|
|
EVP,113,INVALID_MGF1_MD
|
|
EVP,114,INVALID_OPERATION
|
|
EVP,115,INVALID_PADDING_MODE
|
|
EVP,133,INVALID_PARAMETERS
|
|
EVP,116,INVALID_PSS_SALTLEN
|
|
EVP,131,INVALID_SIGNATURE
|
|
EVP,117,KEYS_NOT_SET
|
|
EVP,132,MEMORY_LIMIT_EXCEEDED
|
|
EVP,118,MISSING_PARAMETERS
|
|
EVP,130,NOT_A_PRIVATE_KEY
|
|
EVP,119,NO_DEFAULT_DIGEST
|
|
EVP,120,NO_KEY_SET
|
|
EVP,121,NO_MDC2_SUPPORT
|
|
EVP,122,NO_NID_FOR_CURVE
|
|
EVP,123,NO_OPERATION_SET
|
|
EVP,124,NO_PARAMETERS_SET
|
|
EVP,125,OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE
|
|
EVP,126,OPERATON_NOT_INITIALIZED
|
|
EVP,127,UNKNOWN_PUBLIC_KEY_TYPE
|
|
EVP,128,UNSUPPORTED_ALGORITHM
|
|
EVP,129,UNSUPPORTED_PUBLIC_KEY_TYPE
|