]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix bug in Karatsuba multiplication, which affected propagation of a
authorSimon Tatham <anakin@pobox.com>
Sun, 20 Feb 2011 15:06:39 +0000 (15:06 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 20 Feb 2011 15:06:39 +0000 (15:06 +0000)
carry by more than one word. Now the current set of test cases all
pass again.

[originally from svn r9098]

sshbn.c

diff --git a/sshbn.c b/sshbn.c
index 20244e8636ec93e8a09eb5b23a16a92fac24304e..cae1bd9e9a187446b0d53cdde4e3e21da70bc21e 100644 (file)
--- a/sshbn.c
+++ b/sshbn.c
@@ -386,6 +386,7 @@ static void internal_mul(const BignumInt *a, const BignumInt *b,
             carry += c[j];
             c[j] = (BignumInt)carry;
             carry >>= BIGNUM_INT_BITS;
+            j--;
         }
 #ifdef KARA_DEBUG
         printf("ab = 0x");