]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fix for in-place ecc_add_eh.
authorNiels Möller <nisse@lysator.liu.se>
Tue, 18 Jul 2017 18:52:30 +0000 (20:52 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 18 Jul 2017 18:54:40 +0000 (20:54 +0200)
* ecc-add-eh.c (ecc_add_eh): Fix in-place operation by reordering
two multiplies. Previously, in-place operation resulted in an
invalid call to mpn_mul with overlapping operands. Reported by
Sergei Trofimovich.

ChangeLog
ecc-add-eh.c

index 6cdbe4518fc22f728b2c565bbfd1336d391541ad..de6fc6dcdf24c5131077b94594e0d3e1068c2c76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-07-18  Niels Möller  <nisse@lysator.liu.se>
+
+       * ecc-add-eh.c (ecc_add_eh): Fix in-place operation by reordering
+       two multiplies. Previously, in-place operation resulted in an
+       invalid call to mpn_mul with overlapping operands. Reported by
+       Sergei Trofimovich.
+
 2017-06-09  Niels Möller  <nisse@lysator.liu.se>
 
        * pss.c (pss_verify_mgf1): Check for m being too large, fixing an
index a16be4cb849973a3a50ddd39012647011b569ae6..c07ff49a8c2969e48acab70753c11235fd3233ca 100644 (file)
@@ -98,8 +98,8 @@ ecc_add_eh (const struct ecc_curve *ecc,
   ecc_modp_mul (ecc, x3, B, z1);
 
   /* y3 */
-  ecc_modp_mul (ecc, B, F, C); /* ! */
-  ecc_modp_mul (ecc, y3, B, z1);
+  ecc_modp_mul (ecc, B, F, z1); /* ! */
+  ecc_modp_mul (ecc, y3, B, C); /* Clobbers z1 in case r == p. */
 
   /* z3 */
   ecc_modp_mul (ecc, B, F, G);