From ebee076da656da62d9f28847dc2b18cdf594542d Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Sun, 16 Sep 2012 21:34:26 +0000
Subject: [PATCH] Fixed bug in mpi_add_abs with adding a small number to a
large mpi with carry rollover. (cherry picked from commit
2d319fdfcb36d53a733293904a5bf42775332fed)
---
library/bignum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/bignum.c b/library/bignum.c
index 0cb95055df..508730882a 100644
--- a/library/bignum.c
+++ b/library/bignum.c
@@ -761,7 +761,7 @@ int mpi_add_abs( mpi *X, const mpi *A, const mpi *B )
p = X->p + i;
}
- *p += c; c = ( *p < c ); i++;
+ *p += c; c = ( *p < c ); i++; p++;
}
cleanup: