2 is a prime number ...

PR: 1266
This commit is contained in:
Nils Larsch 2006-01-13 23:29:31 +00:00
parent db8d9b7cf1
commit 27fbb5dbf4

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++)