226b4b51b5
Test this by re-running bn_tests.txt tests a lot. For the most part, this was done by scattering bn_minimal_width or bn_correct_top calls as needed. We'll incrementally tease apart the functions that need to act on non-minimal BIGNUMs in constant-time. BN_sqr was switched to call bn_correct_top at the end, rather than sample bn_minimal_width, in anticipation of later splitting it into BN_sqr (for calculators) and BN_sqr_fixed (for BN_mod_mul_montgomery). BN_div_word also uses bn_correct_top because it calls BN_lshift so officially shouldn't rely on BN_lshift returning something minimal-width, though I expect we'd want to split off a BN_lshift_fixed than change that anyway? The shifts sample bn_minimal_width rather than bn_correct_top because they all seem to try to be very clever around the bit width. If we need constant-time versions of them, we can adjust them later. Bug: 232 Change-Id: Ie17b39034a713542dbe906cf8954c0c5483c7db7 Reviewed-on: https://boringssl-review.googlesource.com/25255 Commit-Queue: David Benjamin <davidben@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> Reviewed-by: Adam Langley <agl@google.com> |
||
---|---|---|
.. | ||
asm | ||
add.c | ||
bn_test_to_fuzzer.go | ||
bn_test.cc | ||
bn_tests.txt | ||
bn.c | ||
bytes.c | ||
check_bn_tests.go | ||
cmp.c | ||
ctx.c | ||
div.c | ||
exponentiation.c | ||
gcd.c | ||
generic.c | ||
internal.h | ||
jacobi.c | ||
montgomery_inv.c | ||
montgomery.c | ||
mul.c | ||
prime.c | ||
random.c | ||
rsaz_exp.c | ||
rsaz_exp.h | ||
shift.c | ||
sqrt.c |