8eadca50a2
(This is actually slightly silly as |a|'s probability distribution falls off exponentially, but it's easy enough to do right.) Instead, we run the loop to the end. This is still performant because we can, as before, return early on composite numbers. Only two calls actually run to the end. Moreover, running to the end has comparable cost to BN_mod_exp_mont_consttime. Median time goes from 0.140s to 0.231s. That cost some, but we're still faster than the original implementation. We're down to one more leak, which is that the BN_rand_range_ex call does not hide |w1|. That one may only be solved probabilistically... Median of 29 RSA keygens: 0m0.123s -> 0m0.145s (Accuracy beyond 0.1s is questionable.) Bug: 238 Change-Id: I4847cb0053118c572d2dd5f855388b5199fa6ce2 Reviewed-on: https://boringssl-review.googlesource.com/25888 Reviewed-by: Adam Langley <agl@google.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 |