Commit f8f240a7ba0f9b7093d4cab59e80811cd59f0999

Steffen Jaeckel 2019-10-15T20:47:33

Merge pull request #375 from libtom/fix-62 fix s_mp_montgomery_reduce_fast

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/bn_s_mp_montgomery_reduce_fast.c b/bn_s_mp_montgomery_reduce_fast.c
index 843ad12..3f0c672 100644
--- a/bn_s_mp_montgomery_reduce_fast.c
+++ b/bn_s_mp_montgomery_reduce_fast.c
@@ -119,7 +119,7 @@ mp_err s_mp_montgomery_reduce_fast(mp_int *x, const mp_int *n, mp_digit rho)
       /* alias for next word, where the carry goes */
       _W = W + ++ix;
 
-      for (; ix <= ((n->used * 2) + 1); ix++) {
+      for (; ix < ((n->used * 2) + 1); ix++) {
          *_W++ += *_W1++ >> (mp_word)MP_DIGIT_BIT;
       }