1044553d6d
RSA key generation requires computing a GCD (p-1 and q-1 are relatively prime with e) and an LCM (the Carmichael totient). I haven't made BN_gcd itself constant-time here to save having to implement bn_lshift_secret_shift, since the two necessary operations can be served by bn_rshift_secret_shift, already added for Rabin-Miller. However, the guts of BN_gcd are replaced. Otherwise, the new functions are only connected to tests for now, they'll be used in subsequent CLs. To support LCM, there is also now a constant-time division function. This does not replace BN_div because bn_div_consttime is some 40x slower than BN_div. That penalty is fine for RSA keygen because that operation is not bottlenecked on division, so we prefer simplicity over performance. Median of 29 RSA keygens: 0m0.212s -> 0m0.225s (Accuracy beyond 0.1s is questionable.) Bug: 238 Change-Id: Idbfbfa6e7f5a3b8782ce227fa130417b3702cf97 Reviewed-on: https://boringssl-review.googlesource.com/26369 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 |