summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2013-02-27 16:20:42 +0100
committerNiels Möller <nisse@lysator.liu.se>2013-02-27 16:20:42 +0100
commitc36a8dee0b8d37813377a9b35b800fe027c0287b (patch)
treeaddc17cdf3297aac70d89f174fa77b2ee8259ecb
parenta3888205d9b599cc030f9a4b929e5273b32b53dd (diff)
downloadnettle-c36a8dee0b8d37813377a9b35b800fe027c0287b.tar.gz
Fixed 32-bit ecc_192_modp.
-rw-r--r--ChangeLog1
-rw-r--r--ecc-192.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7f6d4f1e..f11ea02e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
* ecc-192.c: Check HAVE_NATIVE_ecc_192_modp, and use native
version if available.
+ (ecc_192_modp): Fixed carry handling bug in 32-bit version.
* x86_64/ecc-192-modp.asm: New file.
diff --git a/ecc-192.c b/ecc-192.c
index 9e785dc1..23015e4a 100644
--- a/ecc-192.c
+++ b/ecc-192.c
@@ -66,7 +66,7 @@ ecc_192_modp (const struct ecc_curve *ecc UNUSED, mp_limb_t *rp)
cy = sec_add_1 (rp + 5, rp + 5, 1, cy);
assert (cy <= 1);
- cy = cnd_add_n (cy, rp, ecc_Bmodp, 3);
+ cy = cnd_add_n (cy, rp, ecc_Bmodp, 6);
assert (cy == 0);
}
#elif GMP_NUMB_BITS == 64