2 is a prime

PR: 1266
This commit is contained in:
Nils Larsch 2006-01-13 23:27:59 +00:00
parent 58ece83395
commit 2c5fadbce3

View File

@ -258,7 +258,8 @@ int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx_passed,
/* first look for small factors */
if (!BN_is_odd(a))
return 0;
/* a is even => a is prime if and only if a == 2 */
return BN_is_word(a, 2);
if (do_trial_division)
{
for (i = 1; i < NUMPRIMES; i++)