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:43:21 +0000 (11:43 +0200)
commitd067ba3bcc4944140578bdbf857affa6faf9e8c1
treeacb94f48b5754be1d0c5d9e0e1abf43576a8b20f
parent2c2d9dcd25b6a9e9c6522bfd030d6be5d8e1c92a
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.
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