boringssl/crypto/fipsmodule/bn
David Benjamin 226b4b51b5 Make the rest of BIGNUM accept non-minimal values.
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>
2018-02-05 23:05:34 +00:00
..
asm Silence ARMv8 deprecated IT instruction warnings. 2017-12-14 01:56:22 +00:00
add.c Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
bn_test_to_fuzzer.go Generate bn_div and bn_mod_exp corpus from bn_tests.txt. 2017-10-27 18:57:48 +00:00
bn_test.cc Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
bn_tests.txt bn/asm/rsaz-avx2.pl: fix digit correction bug in rsaz_1024_mul_avx2. 2017-12-07 16:54:32 +00:00
bn.c Fix up BN_MONT_CTX_set with non-minimal values. 2018-02-02 18:52:15 +00:00
bytes.c Make BN_bn2bin_padded work with non-minimal BIGNUMs. 2018-02-02 20:16:50 +00:00
check_bn_tests.go
cmp.c Do RSA sqrt(2) business in BIGNUM. 2018-02-02 18:32:32 +00:00
ctx.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
div.c Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
exponentiation.c Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
gcd.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
generic.c Enable __asm__ and uint128_t code in clang-cl. 2017-12-11 22:46:26 +00:00
internal.h Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
jacobi.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
montgomery_inv.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00
montgomery.c Add a function which folds BN_MONT_CTX_{new,set} together. 2018-02-02 20:23:25 +00:00
mul.c Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
prime.c Add a function which folds BN_MONT_CTX_{new,set} together. 2018-02-02 20:23:25 +00:00
random.c Make ECDSA signing 10% faster and plug some timing leaks. 2017-11-22 22:51:40 +00:00
rsaz_exp.c Fix alignment-violating cast. 2017-12-01 22:32:17 +00:00
rsaz_exp.h
shift.c Make the rest of BIGNUM accept non-minimal values. 2018-02-05 23:05:34 +00:00
sqrt.c Run the comment converter on libcrypto. 2017-08-18 21:49:04 +00:00