projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
BN_copy now propagates BN_FLG_CONSTTIME
[openssl.git]
/
crypto
/
bn
/
bn_mont.c
diff --git
a/crypto/bn/bn_mont.c
b/crypto/bn/bn_mont.c
index 9dad113d0270903e69768f5020ed63e9f21d63a7..975689432a0b8e7af338ccbb1ed85d3861f4ff88 100644
(file)
--- a/
crypto/bn/bn_mont.c
+++ b/
crypto/bn/bn_mont.c
@@
-270,6
+270,9
@@
int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx)
tmod.dmax = 2;
tmod.neg = 0;
+ if (BN_get_flags(mod, BN_FLG_CONSTTIME) != 0)
+ BN_set_flags(&tmod, BN_FLG_CONSTTIME);
+
mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2;
# if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32)