summaryrefslogtreecommitdiff
path: root/mpi/ec.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpi/ec.c')
-rw-r--r--mpi/ec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mpi/ec.c b/mpi/ec.c
index 7a56112e..eb71a639 100644
--- a/mpi/ec.c
+++ b/mpi/ec.c
@@ -455,13 +455,10 @@ ec_mulm_25519 (gcry_mpi_t w, gcry_mpi_t u, gcry_mpi_t v, mpi_ec_t ctx)
m[LIMB_SIZE_25519] += cy;
memset (m, 0, wsize * BYTES_PER_MPI_LIMB);
- m[0] = m[LIMB_SIZE_25519] * 2 * 19;
- cy = _gcry_mpih_add_n (wp, wp, m, wsize);
-
msb = (wp[LIMB_SIZE_25519-1] >> (255 % BITS_PER_MPI_LIMB));
- m[0] = (cy * 2 + msb) * 19;
- _gcry_mpih_add_n (wp, wp, m, wsize);
+ m[0] = (m[LIMB_SIZE_25519] * 2 + msb) * 19;
wp[LIMB_SIZE_25519-1] &= ~(1UL << (255 % BITS_PER_MPI_LIMB));
+ _gcry_mpih_add_n (wp, wp, m, wsize);
m[0] = 0;
cy = _gcry_mpih_sub_n (wp, wp, ctx->p->d, wsize);