diff options
author | lloyd <[email protected]> | 2012-06-26 23:12:37 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-06-26 23:12:37 +0000 |
commit | 10036346020bcd89274a654ed602ec90bd1ffee2 (patch) | |
tree | 5e82f8198c2c2ce905b3c3fbe4d5a3263397ffc1 /src/math | |
parent | 22ec99701496fea97c8681409551bd44105acf79 (diff) |
Increase default Miller-Rabin nonce to 192 bits
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/numbertheory/numthry.cpp | 4 |
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); |