+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
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);