aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory/make_prm.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2014-04-25 00:37:28 +0000
committerlloyd <[email protected]>2014-04-25 00:37:28 +0000
commitb9bee0898aed28bfaf560f85cd63d1534813c257 (patch)
tree888350b90fffaf2a1cf9e42441b9dfda3df5cabc /src/lib/math/numbertheory/make_prm.cpp
parent6c0912310f611286cd28b06a45e5dca8899ac04d (diff)
Any fixed MR iterations is probably wrong for somebody. Allow the user
to specify a probability as well as if n was randomly chosen or not. If the input is random use a better bounds to reduce the number of needed tests.
Diffstat (limited to 'src/lib/math/numbertheory/make_prm.cpp')
-rw-r--r--src/lib/math/numbertheory/make_prm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/math/numbertheory/make_prm.cpp b/src/lib/math/numbertheory/make_prm.cpp
index dc94420ab..2c8cd086d 100644
--- a/src/lib/math/numbertheory/make_prm.cpp
+++ b/src/lib/math/numbertheory/make_prm.cpp
@@ -75,7 +75,7 @@ BigInt random_prime(RandomNumberGenerator& rng,
if(!passes_sieve || gcd(p - 1, coprime) != 1)
continue;
- if(check_prime(p, rng))
+ if(is_prime(p, rng, 64, true))
return p;
}
}
@@ -93,7 +93,7 @@ BigInt random_safe_prime(RandomNumberGenerator& rng, size_t bits)
BigInt p;
do
p = (random_prime(rng, bits - 1) << 1) + 1;
- while(!check_prime(p, rng));
+ while(!is_prime(p, rng, 64, true));
return p;
}