diff options
author | Jack Lloyd <[email protected]> | 2018-02-19 11:43:09 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-02-19 11:48:03 -0500 |
commit | 0c730407a73d26eb5a5c9cb2a5fdb6b6042081ed (patch) | |
tree | bdd89ebd633522df89e8743458d11fdc915364bc | |
parent | 5a13fe1059233eedba27b387b9dfffc7031b15fe (diff) |
Add consts
-rw-r--r-- | src/lib/math/numbertheory/numthry.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |