From 10036346020bcd89274a654ed602ec90bd1ffee2 Mon Sep 17 00:00:00 2001 From: lloyd Date: Tue, 26 Jun 2012 23:12:37 +0000 Subject: Increase default Miller-Rabin nonce to 192 bits --- src/math/numbertheory/numthry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/math') 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); -- cgit v1.2.3