bn/bn_{mont|exp}.c: switch to zero-padded intermediate vectors.
authorAndy Polyakov <appro@openssl.org>
Fri, 6 Jul 2018 13:13:15 +0000 (15:13 +0200)
committerAndy Polyakov <appro@openssl.org>
Wed, 1 Aug 2018 14:15:01 +0000 (16:15 +0200)
commitc9046a05ec0fc3377e1077b401652d76ee5ce908
tree8060e02a8252a066a2012eb41db23ceb07757eb0
parent327b2c011342280c7fd5e312a4fff2a01083d2d6
bn/bn_{mont|exp}.c: switch to zero-padded intermediate vectors.

Note that exported functions maintain original behaviour, so that
external callers won't observe difference. While internally we can
now perform Montogomery multiplication on fixed-length vectors, fixed
at modulus size. The new functions, bn_to_mont_fixed_top and
bn_mul_mont_fixed_top, are declared in bn_int.h, because one can use
them even outside bn, e.g. in RSA, DSA, ECDSA...

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

(cherry picked from commit 71883868ea5b33416ae8283bcc38dd2d97e5006b)

Resolved conflicts:
crypto/bn/bn_exp.c
crypto/bn/bn_lcl.h
crypto/bn/bn_mont.c
crypto/include/internal/bn_int.h
crypto/Makefile
crypto/bn/bn_exp.c
crypto/bn/bn_lcl.h
crypto/bn/bn_mont.c
crypto/bn_int.h [new file with mode: 0644]