summaryrefslogtreecommitdiff
path: root/ecc-ecdsa-sign.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2014-08-28 12:52:30 +0200
committerNiels Möller <nisse@lysator.liu.se>2014-08-28 12:56:34 +0200
commit24c9769b0c26ca432cf9c2ef5ef545872b5e3857 (patch)
treec0fb632af378adde35ea200dd5f138053fc65d8e /ecc-ecdsa-sign.c
parent0276b45a2e6079bb2e7bbd2912af48a5cdd9e658 (diff)
downloadnettle-24c9769b0c26ca432cf9c2ef5ef545872b5e3857.tar.gz
ecc_ecdsa_sign: Use mul_g and h_to_a function pointers.
Implies (obscure) support for curve25519. Also added a testcase for this.
Diffstat (limited to 'ecc-ecdsa-sign.c')
-rw-r--r--ecc-ecdsa-sign.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ecc-ecdsa-sign.c b/ecc-ecdsa-sign.c
index 8c97e7c9..7fe8373b 100644
--- a/ecc-ecdsa-sign.c
+++ b/ecc-ecdsa-sign.c
@@ -1,6 +1,6 @@
/* ecc-ecdsa-sign.c
- Copyright (C) 2013 Niels Möller
+ Copyright (C) 2013, 2014 Niels Möller
This file is part of GNU Nettle.
@@ -46,7 +46,8 @@
mp_size_t
ecc_ecdsa_sign_itch (const struct ecc_curve *ecc)
{
- /* Needs 3*ecc->size + scratch for ecc_mul_g. */
+ /* Needs 3*ecc->size + scratch for ecc->mul_g. Currently same for
+ ecc_mul_g and ecc_mul_g_eh. */
return ECC_ECDSA_SIGN_ITCH (ecc->size);
}
@@ -77,9 +78,9 @@ ecc_ecdsa_sign (const struct ecc_curve *ecc,
4. s2 <-- (h + z*s1)/k mod q.
*/
- ecc_mul_g (ecc, P, kp, P + 3*ecc->size);
+ ecc->mul_g (ecc, P, kp, P + 3*ecc->size);
/* x coordinate only, modulo q */
- ecc_j_to_a (ecc, 2, rp, P, P + 3*ecc->size);
+ ecc->h_to_a (ecc, 2, rp, P, P + 3*ecc->size);
/* Invert k, uses 5 * ecc->size including scratch */
mpn_copyi (hp, kp, ecc->size);