]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fixed bug in 64-bit ecc_384_modp.
authorNiels Möller <nisse@lysator.liu.se>
Wed, 27 Feb 2013 14:15:53 +0000 (15:15 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Wed, 27 Feb 2013 14:15:53 +0000 (15:15 +0100)
ChangeLog
ecc-384.c

index 6171c7a1c8acf250002abc67f4e4f82520bc9957..7829ae3cfc93e5933e8c54592829c8c56a12ae6e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-02-27  Niels Möller  <nisse@lysator.liu.se>
 
+       * ecc-384.c (ecc_384_modp): Fixed typo which broke carry handling
+       in the 64-bit version.
+
        * examples/ecc-benchmark.c (bench_add_jjj): Typo fix, benchmark
        the right function.
 
index dc91f320fee82092568d4e2e25e0f73b4f0e9243..6595b1524d114b5b0c4f41f5873dc865cf526c30 100644 (file)
--- a/ecc-384.c
+++ b/ecc-384.c
@@ -114,7 +114,7 @@ ecc_384_modp (const struct ecc_curve *ecc, mp_limb_t *rp)
   /* Reduce from 9 to 6 limbs */
   tp[0] = 0;
   mpn_copyi (tp + 1, rp + 6, 2);
-  tp[3] = rp[8] -= mpn_sub_n (tp, tp, rp + 6, 3);
+  tp[3] = rp[8] - mpn_sub_n (tp, tp, rp + 6, 3);
   tp[4] = mpn_lshift (tp, tp, 4, 32);
 
   cy = mpn_add_n (rp, rp, rp + 6, 3);