16bfff7169
Get one step closer to removing the dependency on |BN_div| from most programs. Also get one step closer to a constant-time implementation of |BN_MONT_CTX_set|; we now "just" need to create a constant-time variant of |BN_mod_lshift1_quick|. Note that this version might actually increase the side channel signal, since the variance in timing in |BN_div| is probably less than the variance from the many conditional reductions in the new method. On one Windows x64 machine, the speed of RSA verification using the new version is not too different from the speed of the old code. However, |BN_div| is generally slow on Windows x64 so I expect this isn't faster on all platforms. Regardless, we generally consider ECDSA/EdDSA signature verification performance to be adaquate and RSA signature verification is much, much faster even with this change. For RSA signing the performance is not a significant factor since performance-sensitive applications will cache the |RSA| structure and the |RSA| structure will cache the Montgomery contexts. Change-Id: Ib14f1a35c99b8da435e190342657f6a839381a1a Reviewed-on: https://boringssl-review.googlesource.com/10520 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> |
||
---|---|---|
.. | ||
asm | ||
add.c | ||
bn_asn1.c | ||
bn_test.cc | ||
bn_tests.txt | ||
bn.c | ||
check_bn_tests.go | ||
CMakeLists.txt | ||
cmp.c | ||
convert.c | ||
ctx.c | ||
div.c | ||
exponentiation.c | ||
gcd.c | ||
generic.c | ||
internal.h | ||
kronecker.c | ||
montgomery_inv.c | ||
montgomery.c | ||
mul.c | ||
prime.c | ||
random.c | ||
rsaz_exp.c | ||
rsaz_exp.h | ||
shift.c | ||
sqrt.c |