summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_exp.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2015-12-03 17:22:58 +0000
committerjkim <jkim@FreeBSD.org>2015-12-03 17:22:58 +0000
commitafd52a5fc90e70242dbb0e7d29987c976eb993e0 (patch)
treeb0284af4e4144e27eb9f39e88c53868060774b16 /crypto/bn/bn_exp.c
parent64cb0c902e312216cdc4c826fc0be9ba9e1bf4da (diff)
downloadFreeBSD-src-afd52a5fc90e70242dbb0e7d29987c976eb993e0.zip
FreeBSD-src-afd52a5fc90e70242dbb0e7d29987c976eb993e0.tar.gz
Import OpenSSL 1.0.2e.
Diffstat (limited to 'crypto/bn/bn_exp.c')
-rw-r--r--crypto/bn/bn_exp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c
index 24afdd6..50cf323 100644
--- a/crypto/bn/bn_exp.c
+++ b/crypto/bn/bn_exp.c
@@ -662,12 +662,13 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p,
bn_check_top(p);
bn_check_top(m);
- top = m->top;
-
- if (!(m->d[0] & 1)) {
+ if (!BN_is_odd(m)) {
BNerr(BN_F_BN_MOD_EXP_MONT_CONSTTIME, BN_R_CALLED_WITH_EVEN_MODULUS);
return (0);
}
+
+ top = m->top;
+
bits = BN_num_bits(p);
if (bits == 0) {
ret = BN_one(rr);
OpenPOWER on IntegriCloud