diff options
author | Niels Möller <nisse@lysator.liu.se> | 2014-08-25 21:22:40 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2014-08-25 21:23:20 +0200 |
commit | cc86df70d98be60a5a299d22a37623a61b5ed0b0 (patch) | |
tree | e49fb80c8b1ad74098fd909fbb9ddb0f9afd817c /ecc-point-mul-g.c | |
parent | a45118aa18568472d7fb7a614b8ea5721f89d1ef (diff) | |
download | nettle-cc86df70d98be60a5a299d22a37623a61b5ed0b0.tar.gz |
curve25519 support for ecc_point_mul, ecc_point_mul_g, and ecdh-test.
Diffstat (limited to 'ecc-point-mul-g.c')
-rw-r--r-- | ecc-point-mul-g.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ecc-point-mul-g.c b/ecc-point-mul-g.c index 8186bf2c..bb9a2d76 100644 --- a/ecc-point-mul-g.c +++ b/ecc-point-mul-g.c @@ -45,13 +45,14 @@ void ecc_point_mul_g (struct ecc_point *r, const struct ecc_scalar *n) { TMP_DECL(scratch, mp_limb_t, 3*ECC_MAX_SIZE + ECC_MUL_G_ITCH (ECC_MAX_SIZE)); - mp_limb_t size = r->ecc->size; - mp_size_t itch = 3*size + ECC_MUL_G_ITCH (size); + const struct ecc_curve *ecc = r->ecc; + mp_limb_t size = ecc->size; + mp_size_t itch = 3*size + ecc->mul_g_itch; - assert (r->ecc == n->ecc); + assert (n->ecc == ecc); TMP_ALLOC (scratch, itch); - ecc_mul_g (r->ecc, scratch, n->p, scratch + 3*size); - ecc_j_to_a (r->ecc, 1, r->p, scratch, scratch + 3*size); + ecc->mul_g (ecc, scratch, n->p, scratch + 3*size); + ecc->h_to_a (ecc, 1, r->p, scratch, scratch + 3*size); } |