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:
0bde108
)
Bug fix: BN_is_prime() would fail with a high probability for small
author
Ulf Möller
<ulf@openssl.org>
Tue, 1 Feb 2000 23:48:55 +0000
(23:48 +0000)
committer
Ulf Möller
<ulf@openssl.org>
Tue, 1 Feb 2000 23:48:55 +0000
(23:48 +0000)
primes (negligible for larger ones).
crypto/bn/bn_prime.c
patch
|
blob
|
history
diff --git
a/crypto/bn/bn_prime.c
b/crypto/bn/bn_prime.c
index e2cfef37259eaad2612b0b874ca56367d19f0bcd..f6de801263cc410974cffcc7ba313945aaef6a5c 100644
(file)
--- a/
crypto/bn/bn_prime.c
+++ b/
crypto/bn/bn_prime.c
@@
-204,6
+204,7
@@
int BN_is_prime_fasttest(BIGNUM *a, int checks,
if (!BN_pseudo_rand(check,BN_num_bits(a),0,0)) goto err;
if (BN_cmp(check, a) >= 0)
BN_sub(check, check, a);
+ if (BN_is_zero(check)) BN_one(check);
j=witness(check,a,ctx,ctx2,mont);
if (j == -1) goto err;
if (j)