+2013-05-17 Niels Möller <nisse@lysator.liu.se>
+
+ * ecc-j-to-a.c (ecc_j_to_a): Fixed ecc_modp_mul call, to avoid
+ invalid overlap of arguments to mpn_mul_n. Problem tracked down by
+ Magnus Holmgren.
+
2013-05-16 Niels Möller <nisse@lysator.liu.se>
* arm/aes-encrypt-internal.asm: New file, for pre-v6 processors.
#define up (scratch + ecc->size)
#define iz2p (scratch + ecc->size)
#define iz3p (scratch + 2*ecc->size)
+#define izBp (scratch + 3*ecc->size)
#define tp scratch
mp_limb_t cy;
if (flags & 1)
{
/* Divide this common factor by B */
- mpn_copyi (iz3p, izp, ecc->size);
- mpn_zero (iz3p + ecc->size, ecc->size);
- ecc->redc (ecc, iz3p);
-
- ecc_modp_mul (ecc, iz2p, izp, iz3p);
+ mpn_copyi (izBp, izp, ecc->size);
+ mpn_zero (izBp + ecc->size, ecc->size);
+ ecc->redc (ecc, izBp);
+
+ ecc_modp_mul (ecc, iz2p, izp, izBp);
}
else
ecc_modp_sqr (ecc, iz2p, izp);