aboutsummaryrefslogtreecommitdiffstats
path: root/src/math/gfpmath/gfp_element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/gfpmath/gfp_element.cpp')
-rw-r--r--src/math/gfpmath/gfp_element.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/math/gfpmath/gfp_element.cpp b/src/math/gfpmath/gfp_element.cpp
index f9e0b09c9..8ae9b3c3a 100644
--- a/src/math/gfpmath/gfp_element.cpp
+++ b/src/math/gfpmath/gfp_element.cpp
@@ -68,7 +68,9 @@ void inner_montg_mult_sos(word result[], const word* a_bar, const word* b_bar, c
while (C > 0)
{
// we need not worry here about C > 1, because the other operand is zero
- word tmp = word_add(t[i+s+cnt], 0, &C);
+
+ word tmp = t[i+s+cnt] + C;
+ C = (tmp < t[i+s+cnt]);
t[i+s+cnt] = tmp;
cnt++;
}