diff options
author | Andy Polyakov <appro@openssl.org> | 2013-10-09 11:08:52 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2013-10-09 11:08:52 +0200 |
commit | 37de2b5c1e370b493932552556940eb89922b027 (patch) | |
tree | 180b9384cdf6c70b106db49a6e77e8f472a87979 | |
parent | 2d752737c53d0cf4953c11551d6d2a9df3655329 (diff) |
bn/bn_exp.c: prefer MULX/AD*X over AVX2.
-rw-r--r-- | crypto/bn/bn_exp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/bn/bn_exp.c b/crypto/bn/bn_exp.c index cfbaf2b66f..6e3a7264d5 100644 --- a/crypto/bn/bn_exp.c +++ b/crypto/bn/bn_exp.c @@ -691,7 +691,8 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, * RSAZ exponentiation. For further information see * crypto/bn/rsaz_exp.c and accompanying assembly modules. */ - if ((16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024) + if (((OPENSSL_ia32cap_P[2]&0x80100) != 0x80100) /* check for MULX/AD*X */ + && (16 == a->top) && (16 == p->top) && (BN_num_bits(m) == 1024) && rsaz_avx2_eligible()) { if (NULL == bn_wexpand(rr, 16)) goto err; |