summaryrefslogtreecommitdiffstats
path: root/crypto/dh/dh_check.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-01-12 11:57:30 +0000
committerBodo Möller <bodo@openssl.org>2000-01-12 11:57:30 +0000
commit76aa0ddc86772080db4f61821b9ff357e330c843 (patch)
tree156e6551fb083163ca4717274f3970601bf7946e /crypto/dh/dh_check.c
parente4b76456310f6a337c471ec5c7525bc65e4e40d5 (diff)
Turn BN_prime_checks into a macro.
Primes p where (p-1)/2 is prime too are called "safe", not "strong".
Diffstat (limited to 'crypto/dh/dh_check.c')
-rw-r--r--crypto/dh/dh_check.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/dh/dh_check.c b/crypto/dh/dh_check.c
index 95ce9cfad0..a2e7433b9c 100644
--- a/crypto/dh/dh_check.c
+++ b/crypto/dh/dh_check.c
@@ -102,12 +102,12 @@ int DH_check(DH *dh, int *ret)
else
*ret|=DH_UNABLE_TO_CHECK_GENERATOR;
- if (!BN_is_prime(dh->p,BN_prime_checks,NULL,ctx,NULL))
+ if (!BN_is_prime(dh->p,BN_prime_checks(BN_num_bits(dh->p)),NULL,ctx,NULL))
*ret|=DH_CHECK_P_NOT_PRIME;
else
{
if (!BN_rshift1(q,dh->p)) goto err;
- if (!BN_is_prime(q,BN_prime_checks,NULL,ctx,NULL))
+ if (!BN_is_prime(q,BN_prime_checks(BN_num_bits(q)),NULL,ctx,NULL))
*ret|=DH_CHECK_P_NOT_STRONG_PRIME;
}
ok=1;