aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlloyd <[email protected]>2012-06-26 23:12:37 +0000
committerlloyd <[email protected]>2012-06-26 23:12:37 +0000
commit10036346020bcd89274a654ed602ec90bd1ffee2 (patch)
tree5e82f8198c2c2ce905b3c3fbe4d5a3263397ffc1
parent22ec99701496fea97c8681409551bd44105acf79 (diff)
Increase default Miller-Rabin nonce to 192 bits
-rw-r--r--src/math/numbertheory/numthry.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/math/numbertheory/numthry.cpp b/src/math/numbertheory/numthry.cpp
index 58275fb4f..c431fb63f 100644
--- a/src/math/numbertheory/numthry.cpp
+++ b/src/math/numbertheory/numthry.cpp
@@ -322,8 +322,6 @@ bool primality_test(const BigInt& n,
RandomNumberGenerator& rng,
size_t level)
{
- const size_t PREF_NONCE_BITS = 64;
-
if(n == 2)
return true;
if(n <= 1 || n.is_even())
@@ -348,6 +346,8 @@ bool primality_test(const BigInt& n,
if(level > 2)
level = 2;
+ const size_t PREF_NONCE_BITS = 192;
+
const size_t NONCE_BITS = std::min(n.bits() - 2, PREF_NONCE_BITS);
MillerRabin_Test mr(n);