Turn BN_prime_checks into a macro.

Primes p where (p-1)/2 is prime too are called "safe", not "strong".
This commit is contained in:
Bodo Möller
2000-01-12 11:57:30 +00:00
parent e4b7645631
commit 76aa0ddc86
6 changed files with 42 additions and 16 deletions

View File

@@ -75,7 +75,7 @@ int RSA_check_key(RSA *key)
}
/* p prime? */
r = BN_is_prime(key->p, BN_prime_checks, NULL, NULL, NULL);
r = BN_is_prime(key->p, BN_prime_checks(BN_num_bits(key->p)), NULL, NULL, NULL);
if (r != 1)
{
ret = r;
@@ -85,7 +85,7 @@ int RSA_check_key(RSA *key)
}
/* q prime? */
r = BN_is_prime(key->q, BN_prime_checks, NULL, NULL, NULL);
r = BN_is_prime(key->q, BN_prime_checks(BN_num_bits(key->q)), NULL, NULL, NULL);
if (r != 1)
{
ret = r;