summaryrefslogtreecommitdiff
path: root/ecc-add-eh.c
diff options
context:
space:
mode:
Diffstat (limited to 'ecc-add-eh.c')
-rw-r--r--ecc-add-eh.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/ecc-add-eh.c b/ecc-add-eh.c
index 8e6b82ab..05faa752 100644
--- a/ecc-add-eh.c
+++ b/ecc-add-eh.c
@@ -78,30 +78,30 @@ ecc_add_eh (const struct ecc_curve *ecc,
#define F D
#define G E
- ecc_modp_mul (ecc, C, x1, x2);
- ecc_modp_mul (ecc, D, y1, y2);
- ecc_modp_add (ecc, x3, x1, y1);
- ecc_modp_add (ecc, y3, x2, y2);
- ecc_modp_mul (ecc, T, x3, y3);
- ecc_modp_sub (ecc, T, T, C);
- ecc_modp_sub (ecc, T, T, D);
- ecc_modp_mul (ecc, x3, C, D);
- ecc_modp_mul (ecc, E, x3, ecc->b);
-
- ecc_modp_sub (ecc, C, D, C);
- ecc_modp_sqr (ecc, B, z1);
- ecc_modp_sub (ecc, F, B, E);
- ecc_modp_add (ecc, G, B, E);
+ ecc_mod_mul (&ecc->p, C, x1, x2);
+ ecc_mod_mul (&ecc->p, D, y1, y2);
+ ecc_mod_add (&ecc->p, x3, x1, y1);
+ ecc_mod_add (&ecc->p, y3, x2, y2);
+ ecc_mod_mul (&ecc->p, T, x3, y3);
+ ecc_mod_sub (&ecc->p, T, T, C);
+ ecc_mod_sub (&ecc->p, T, T, D);
+ ecc_mod_mul (&ecc->p, x3, C, D);
+ ecc_mod_mul (&ecc->p, E, x3, ecc->b);
+
+ ecc_mod_sub (&ecc->p, C, D, C);
+ ecc_mod_sqr (&ecc->p, B, z1);
+ ecc_mod_sub (&ecc->p, F, B, E);
+ ecc_mod_add (&ecc->p, G, B, E);
/* x3 */
- ecc_modp_mul (ecc, B, F, T);
- ecc_modp_mul (ecc, x3, B, z1);
+ ecc_mod_mul (&ecc->p, B, F, T);
+ ecc_mod_mul (&ecc->p, x3, B, z1);
/* y3 */
- ecc_modp_mul (ecc, B, G, z1);
- ecc_modp_mul (ecc, y3, B, C); /* Clobbers z1 in case r == p. */
+ ecc_mod_mul (&ecc->p, B, G, z1);
+ ecc_mod_mul (&ecc->p, y3, B, C); /* Clobbers z1 in case r == p. */
/* z3 */
- ecc_modp_mul (ecc, B, F, G);
+ ecc_mod_mul (&ecc->p, B, F, G);
mpn_copyi (z3, B, ecc->p.size);
}