bn/asm/*-mont.pl: harmonize with BN_from_montgomery_word.
authorAndy Polyakov <appro@openssl.org>
Mon, 30 Apr 2018 20:59:51 +0000 (22:59 +0200)
committerAndy Polyakov <appro@openssl.org>
Fri, 4 May 2018 09:45:23 +0000 (11:45 +0200)
commitaed0ecb97c2d5329b5b5728c1e74fa63ce58ca8f
treee9646886a4dcade8b22986fa665cd2bbc534aa79
parentc14a3be5adf88edc002199835d8fa40f1296e381
bn/asm/*-mont.pl: harmonize with BN_from_montgomery_word.

Montgomery multiplication post-conditions in some of code paths were
formally non-constant time. Cache access pattern was result-neutral,
but a little bit asymmetric, which might have produced a signal [if
processor reordered load and stores at run-time].

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6163)

(cherry picked from commit 774ff8fed67e19d4f5f0df2f59050f2737abab2a)

Resolved conflicts in ppc-mont.pl and x86_64-mont.pl.

(cherry picked from commit d067ba3bcc4944140578bdbf857affa6faf9e8c1)
15 files changed:
crypto/bn/asm/alpha-mont.pl
crypto/bn/asm/armv4-mont.pl
crypto/bn/asm/ia64-mont.pl
crypto/bn/asm/mips-mont.pl
crypto/bn/asm/parisc-mont.pl
crypto/bn/asm/ppc-mont.pl
crypto/bn/asm/ppc64-mont.pl
crypto/bn/asm/s390x-mont.pl
crypto/bn/asm/sparct4-mont.pl
crypto/bn/asm/sparcv9-mont.pl
crypto/bn/asm/via-mont.pl
crypto/bn/asm/vis3-mont.pl
crypto/bn/asm/x86-mont.pl
crypto/bn/asm/x86_64-mont.pl
crypto/bn/asm/x86_64-mont5.pl