5833dd807e
Windows CryptoAPI and Go bound public exponents at 2^32-1, so don't generate keys which would violate that. https://github.com/golang/go/issues/3161 https://msdn.microsoft.com/en-us/library/aa387685(VS.85).aspx BoringSSL itself also enforces a 33-bit limit. I don't currently have plans to take much advantage of it, but the modular inverse step and one of the GCDs in RSA key generation are helped by small public exponents[0]. In case someone feels inspired later, get this limit enforced now. Use 32-bits as that's a more convenient limit, and there's no requirement to produce e=2^32+1 keys. (Is there still a requirement to accept them?) [0] This isn't too bad, but it's only worth it if it produces simpler or smaller code. RSA keygen is not performance-critical. 1. Make bn_mod_u16_consttime work for uint32_t. It only barely doesn't work. Maybe only accept 3 and 65537 and pre-compute, maybe call into bn_div_rem_words and friends, maybe just tighten the bound a hair longer. 2. Implement bn_div_u32_consttime by incorporating 32-bit chunks much like bn_mod_u32_consttime. 3. Perform one normal Euclidean algorithm iteration rather than using the binary version. u, v, B, and D are now single words, while A and C are full-width. 4. Continue with binary Euclidean algorithm (u and v are still secret), taking advantage of most values being small. Update-Note: RSA_generate_key_ex will no longer generate keys with public exponents larger than 2^32-1. Everyone uses 65537, save some folks who use 3, so this shouldn't matter. Change-Id: I0d28a29a30d9ff73bff282e34dd98e2b64c35c79 Reviewed-on: https://boringssl-review.googlesource.com/26365 Reviewed-by: Adam Langley <alangley@gmail.com> |
||
---|---|---|
.. | ||
aes | ||
bn | ||
cipher | ||
des | ||
digest | ||
ec | ||
ecdsa | ||
hmac | ||
md4 | ||
md5 | ||
modes | ||
policydocs | ||
rand | ||
rsa | ||
self_check | ||
sha | ||
tls | ||
bcm.c | ||
CMakeLists.txt | ||
delocate.h | ||
FIPS.md | ||
intcheck1.png | ||
intcheck2.png | ||
intcheck3.png | ||
is_fips.c |