diff options
author | Niels Möller <nisse@lysator.liu.se> | 2022-09-28 19:29:15 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2022-09-28 19:29:15 +0200 |
commit | 4420ea070cc94f7046b18f145c30fc86168f3dc8 (patch) | |
tree | b5443b90d3a4d198ab02f828bd43ea8603d06509 | |
parent | 798df2f41daf7ddbe83049af0eaa66adcf05ab14 (diff) | |
download | nettle-4420ea070cc94f7046b18f145c30fc86168f3dc8.tar.gz |
Delete ecc->mul_g and ecc->h_to_a indirection for ecdsa/gostdsa sign.ecdsa-weierstrass-only
-rw-r--r-- | ecc-ecdsa-sign.c | 10 | ||||
-rw-r--r-- | ecc-gostdsa-sign.c | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/ecc-ecdsa-sign.c b/ecc-ecdsa-sign.c index 4adee1d1..6a41c14c 100644 --- a/ecc-ecdsa-sign.c +++ b/ecc-ecdsa-sign.c @@ -46,9 +46,9 @@ mp_size_t ecc_ecdsa_sign_itch (const struct ecc_curve *ecc) { - /* Needs 3*ecc->p.size + scratch for ecc->mul_g. Currently same for - ecc_mul_g. */ - assert (ecc->p.size + ecc->p.invert_itch <= 3*ecc->p.size + ecc->mul_g_itch); + /* Needs 3*ecc->p.size + scratch for ecc_mul_g. */ + assert (ecc->p.size + ecc->p.invert_itch + <= 3*ecc->p.size + ECC_MUL_G_ITCH (ecc->p.size)); return ECC_ECDSA_SIGN_ITCH (ecc->p.size); } @@ -79,9 +79,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->p.size); + ecc_mul_g (ecc, P, kp, P + 3*ecc->p.size); /* x coordinate only, modulo q */ - ecc->h_to_a (ecc, 2, rp, P, P + 3*ecc->p.size); + ecc_j_to_a (ecc, 2, rp, P, P + 3*ecc->p.size); /* Invert k, uses up to 7 * ecc->p.size including scratch (for secp384). */ ecc->q.invert (&ecc->q, kinv, kp, tp); diff --git a/ecc-gostdsa-sign.c b/ecc-gostdsa-sign.c index c924122c..491a2281 100644 --- a/ecc-gostdsa-sign.c +++ b/ecc-gostdsa-sign.c @@ -45,8 +45,7 @@ mp_size_t ecc_gostdsa_sign_itch (const struct ecc_curve *ecc) { - /* Needs 3*ecc->p.size + scratch for ecc->mul_g. Currently same for - ecc_mul_g. */ + /* Needs 3*ecc->p.size + scratch for ecc_mul_g. */ return ECC_GOSTDSA_SIGN_ITCH (ecc->p.size); } @@ -75,9 +74,9 @@ ecc_gostdsa_sign (const struct ecc_curve *ecc, 4. s <-- (r*z + k*h) mod q. */ - ecc->mul_g (ecc, P, kp, P + 3*ecc->p.size); + ecc_mul_g (ecc, P, kp, P + 3*ecc->p.size); /* x coordinate only, modulo q */ - ecc->h_to_a (ecc, 2, rp, P, P + 3*ecc->p.size); + ecc_j_to_a (ecc, 2, rp, P, P + 3*ecc->p.size); /* Process hash digest */ gost_hash (&ecc->q, hp, length, digest); |