aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/math/numbertheory
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-12-06 20:26:38 -0500
committerJack Lloyd <[email protected]>2018-12-06 20:38:32 -0500
commite7038bf0c5a8e083555c2ce4e00a11a74e55cf0a (patch)
tree90ce04da759a5d9d60c177a419219ec7a53d9f63 /src/lib/math/numbertheory
parent68c12b19077205c9c4ff2069072fcd986e0e4c30 (diff)
Add BigInt::ct_reduce_below
Diffstat (limited to 'src/lib/math/numbertheory')
-rw-r--r--src/lib/math/numbertheory/reducer.cpp3
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())
{