summaryrefslogtreecommitdiff
path: root/mpn/generic
diff options
context:
space:
mode:
Diffstat (limited to 'mpn/generic')
-rw-r--r--mpn/generic/toom22_mul.c2
-rw-r--r--mpn/generic/toom2_sqr.c2
-rw-r--r--mpn/generic/toom32_mul.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/mpn/generic/toom22_mul.c b/mpn/generic/toom22_mul.c
index 216ce1820..64f024aac 100644
--- a/mpn/generic/toom22_mul.c
+++ b/mpn/generic/toom22_mul.c
@@ -202,7 +202,7 @@ mpn_toom22_mul (mp_ptr pp,
#if WANT_ASSERT
/* The borrow in cy stops the propagation of the carry cy2, */
ASSERT (cy2 == 1);
- cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, 1);
+ cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, cy2);
ASSERT (cy == 0);
#else
/* we simply fill the area with zeros. */
diff --git a/mpn/generic/toom2_sqr.c b/mpn/generic/toom2_sqr.c
index 7869f0fbd..4eaa1417a 100644
--- a/mpn/generic/toom2_sqr.c
+++ b/mpn/generic/toom2_sqr.c
@@ -145,7 +145,7 @@ mpn_toom2_sqr (mp_ptr pp,
#if WANT_ASSERT
/* The borrow in cy stops the propagation of the carry cy2, */
ASSERT (cy2 == 1);
- cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, 1);
+ cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, cy2);
ASSERT (cy == 0);
#else
/* we simply fill the area with zeros. */
diff --git a/mpn/generic/toom32_mul.c b/mpn/generic/toom32_mul.c
index 0c61abfb2..f03ba568f 100644
--- a/mpn/generic/toom32_mul.c
+++ b/mpn/generic/toom32_mul.c
@@ -104,7 +104,7 @@ mpn_toom32_mul (mp_ptr pp,
/* FIXME: Keep v1[2*n] and vm1[2*n] in scalar variables? */
- /* Compute ap1 = a0 + a1 + a3, am1 = a0 - a1 + a3 */
+ /* Compute ap1 = a0 + a1 + a2, am1 = a0 - a1 + a2 */
ap1_hi = mpn_add (ap1, a0, n, a2, s);
#if HAVE_NATIVE_mpn_add_n_sub_n
if (ap1_hi == 0 && mpn_cmp (ap1, a1, n) < 0)