diff options
author | Niels Möller <nisse@lysator.liu.se> | 2020-10-14 20:17:08 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2020-10-14 20:17:08 +0200 |
commit | 1cbc9e094eae458ff83b0a59c33a929520c51a63 (patch) | |
tree | f36f1075a0baec46379a6aa31bc99b0d31e1a1f2 /ecc-curve25519.c | |
parent | 04b25045c8aeed37b875861378302aa086f287a8 (diff) | |
download | nettle-1cbc9e094eae458ff83b0a59c33a929520c51a63.tar.gz |
Shared implementation of ecc_mod_pow_2k and related functions
Diffstat (limited to 'ecc-curve25519.c')
-rw-r--r-- | ecc-curve25519.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/ecc-curve25519.c b/ecc-curve25519.c index f8f2c64a..60ef0540 100644 --- a/ecc-curve25519.c +++ b/ecc-curve25519.c @@ -100,33 +100,6 @@ ecc_curve25519_modq (const struct ecc_modulo *q, mp_limb_t *rp) cnd_add_n (cy, rp, q->m, ECC_LIMB_SIZE); } -/* Needs 2*ecc->size limbs at rp, and 2*ecc->size additional limbs of - scratch space. No overlap allowed. */ -static void -ecc_mod_pow_2kp1 (const struct ecc_modulo *m, - mp_limb_t *rp, const mp_limb_t *xp, - unsigned k, mp_limb_t *tp) -{ - if (k & 1) - { - ecc_mod_sqr (m, tp, xp); - k--; - } - else - { - ecc_mod_sqr (m, rp, xp); - ecc_mod_sqr (m, tp, rp); - k -= 2; - } - while (k > 0) - { - ecc_mod_sqr (m, rp, tp); - ecc_mod_sqr (m, tp, rp); - k -= 2; - } - ecc_mod_mul (m, rp, tp, xp); -} - /* Computes a^{(p-5)/8} = a^{2^{252}-3} mod m. Needs 5 * n scratch space. */ static void |