diff options
author | Jack Lloyd <[email protected]> | 2018-12-06 20:26:38 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-12-06 20:38:32 -0500 |
commit | e7038bf0c5a8e083555c2ce4e00a11a74e55cf0a (patch) | |
tree | 90ce04da759a5d9d60c177a419219ec7a53d9f63 /src/lib/math/numbertheory | |
parent | 68c12b19077205c9c4ff2069072fcd986e0e4c30 (diff) |
Add BigInt::ct_reduce_below
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r-- | src/lib/math/numbertheory/reducer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/math/numbertheory/reducer.cpp b/src/lib/math/numbertheory/reducer.cpp index 0468d004b..ec0071eac 100644 --- a/src/lib/math/numbertheory/reducer.cpp +++ b/src/lib/math/numbertheory/reducer.cpp @@ -84,7 +84,8 @@ void Modular_Reducer::reduce(BigInt& t1, const BigInt& x, secure_vector<word>& w t1.add(ws.data(), m_mod_words + 2, BigInt::Positive); - t1.reduce_below(m_modulus, ws); + // Per HAC this step requires at most 2 subtractions + t1.ct_reduce_below(m_modulus, ws, 2); if(x.is_negative() && t1.is_nonzero()) { |