boringssl/crypto/bn/asm
Adam Langley 75b833cc81 OpenSSL: make final reduction in Montgomery multiplication constant-time.
(The issue was reported by Shay Gueron.)

The final reduction in Montgomery multiplication computes if (X >= m) then X =
X - m else X = X

In OpenSSL, this was done by computing T = X - m,  doing a constant-time
selection of the *addresses* of X and T, and loading from the resulting
address. But this is not cache-neutral.

This patch changes the behaviour by loading both X and T into registers, and
doing a constant-time selection of the *values*.

TODO(fork): only some of the fixes from the original patch still apply to
the 1.0.2 code.
2014-06-20 13:17:33 -07:00
..
x86 Inital import. 2014-06-20 13:17:32 -07:00
armv4-mont.pl Inital import. 2014-06-20 13:17:32 -07:00
bn-586.pl Inital import. 2014-06-20 13:17:32 -07:00
co-586.pl Inital import. 2014-06-20 13:17:32 -07:00
modexp512-x86_64.pl Inital import. 2014-06-20 13:17:32 -07:00
rsaz-avx2.pl Inital import. 2014-06-20 13:17:32 -07:00
rsaz-x86_64.pl Inital import. 2014-06-20 13:17:32 -07:00
x86_64-gcc.c Inital import. 2014-06-20 13:17:32 -07:00
x86_64-mont5.pl OpenSSL: make final reduction in Montgomery multiplication constant-time. 2014-06-20 13:17:33 -07:00
x86_64-mont.pl OpenSSL: make final reduction in Montgomery multiplication constant-time. 2014-06-20 13:17:33 -07:00
x86-mont.pl OpenSSL: make final reduction in Montgomery multiplication constant-time. 2014-06-20 13:17:33 -07:00
x86.pl Inital import. 2014-06-20 13:17:32 -07:00