projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58ece83
)
2 is a prime
author
Nils Larsch
<nils@openssl.org>
Fri, 13 Jan 2006 23:27:59 +0000
(23:27 +0000)
committer
Nils Larsch
<nils@openssl.org>
Fri, 13 Jan 2006 23:27:59 +0000
(23:27 +0000)
PR: 1266
crypto/bn/bn_prime.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_prime.c
b/crypto/bn/bn_prime.c
index d03403a600d8ca7a2cd7c7ef3d06dde708a78f52..d57f6582110f6c74bec114939fa51ca4cf42a25a 100644
(file)
--- a/
crypto/bn/bn_prime.c
+++ b/
crypto/bn/bn_prime.c
@@
-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++)