summaryrefslogtreecommitdiff
path: root/curve448-eh-to-x.c
diff options
context:
space:
mode:
Diffstat (limited to 'curve448-eh-to-x.c')
-rw-r--r--curve448-eh-to-x.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/curve448-eh-to-x.c b/curve448-eh-to-x.c
index 8f3f8c45..3b9bf3ec 100644
--- a/curve448-eh-to-x.c
+++ b/curve448-eh-to-x.c
@@ -52,7 +52,6 @@ curve448_eh_to_x (mp_limb_t *xp, const mp_limb_t *p, mp_limb_t *scratch)
#define tp (scratch + ecc->p.size)
const struct ecc_curve *ecc = &_nettle_curve448;
- mp_limb_t cy;
/* If u = U/W and v = V/W are the coordinates of the point on
edwards448 we get the curve448 x coordinate as
@@ -62,10 +61,8 @@ curve448_eh_to_x (mp_limb_t *xp, const mp_limb_t *p, mp_limb_t *scratch)
/* Needs a total of 5*size storage. */
ecc->p.invert (&ecc->p, t0, up, tp);
ecc_mod_mul (&ecc->p, t0, t0, vp, tp);
- ecc_mod_sqr (&ecc->p, t0, t0, tp);
+ ecc_mod_sqr_canonical (&ecc->p, xp, t0, tp);
- cy = mpn_sub_n (xp, t0, ecc->p.m, ecc->p.size);
- cnd_copy (cy, xp, t0, ecc->p.size);
#undef up
#undef vp
#undef t0