From 0c730407a73d26eb5a5c9cb2a5fdb6b6042081ed Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Mon, 19 Feb 2018 11:43:09 -0500 Subject: Add consts --- src/lib/math/numbertheory/numthry.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/math/numbertheory') diff --git a/src/lib/math/numbertheory/numthry.cpp b/src/lib/math/numbertheory/numthry.cpp index 12ac51953..e80ae43ab 100644 --- a/src/lib/math/numbertheory/numthry.cpp +++ b/src/lib/math/numbertheory/numthry.cpp @@ -473,15 +473,15 @@ bool is_prime(const BigInt& n, RandomNumberGenerator& rng, const BigInt n_minus_1 = n - 1; const size_t s = low_zero_bits(n_minus_1); - Fixed_Exponent_Power_Mod pow_mod(n_minus_1 >> s, n); - Modular_Reducer reducer(n); + const Modular_Reducer mod_n(n); + const Fixed_Exponent_Power_Mod pow_mod(n_minus_1 >> s, n); for(size_t i = 0; i != test_iterations; ++i) { const BigInt a = BigInt::random_integer(rng, 2, n_minus_1); BigInt y = pow_mod(a); - if(mr_witness(std::move(y), reducer, n_minus_1, s)) + if(mr_witness(std::move(y), mod_n, n_minus_1, s)) return false; } -- cgit v1.2.3