diff options
author | Niels Möller <nisse@lysator.liu.se> | 2019-12-07 08:14:21 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2019-12-07 08:14:21 +0100 |
commit | bfe24f5880b4637c24e4219024114cdd5a2d4c72 (patch) | |
tree | eac948b68ef4e01233e3f86384fb13fe944c3be4 /ecc-eh-to-a.c | |
parent | 9f4180d6f41889c8b42a70fc5b6a73c6055006fb (diff) | |
download | nettle-bfe24f5880b4637c24e4219024114cdd5a2d4c72.tar.gz |
Delete tests and code for ecdsa over curve25519.
* ecc-eh-to-a.c (ecc_eh_to_a): Require op == 0, delete code only
used for non-standard ecdsa over curve25519.
* testsuite/ecdsa-sign-test.c (test_main): Delete test of ecdsa
over curve25519.
* testsuite/ecdsa-verify-test.c (test_main): Likewise.
* testsuite/ecdsa-keygen-test.c (test_main): Exclude curve25519
from test.
Diffstat (limited to 'ecc-eh-to-a.c')
-rw-r--r-- | ecc-eh-to-a.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/ecc-eh-to-a.c b/ecc-eh-to-a.c index 8173b887..89d2b6e3 100644 --- a/ecc-eh-to-a.c +++ b/ecc-eh-to-a.c @@ -56,6 +56,8 @@ ecc_eh_to_a (const struct ecc_curve *ecc, mp_limb_t cy; + assert(op == 0); + /* Needs 2*size + scratch for the invert call. */ ecc->p.invert (&ecc->p, izp, zp, tp + ecc->p.size); @@ -63,25 +65,6 @@ ecc_eh_to_a (const struct ecc_curve *ecc, cy = mpn_sub_n (r, tp, ecc->p.m, ecc->p.size); cnd_copy (cy, r, tp, ecc->p.size); - if (op) - { - /* Skip y coordinate */ - if (op > 1) - { - /* Reduce modulo q. Hardcoded for curve25519, duplicates end - of ecc_25519_modq. FIXME: Is this needed at all? op > 0 - is only used by ecdsa code, and ecdsa on Edwards curves - makes little sense and is is only used by tests. */ - unsigned shift; - assert (ecc->p.bit_size == 255); - shift = ecc->q.bit_size - 1 - GMP_NUMB_BITS * (ecc->p.size - 1); - cy = mpn_submul_1 (r, ecc->q.m, ecc->p.size, - r[ecc->p.size-1] >> shift); - assert (cy < 2); - cnd_add_n (cy, r, ecc->q.m, ecc->p.size); - } - return; - } ecc_modp_mul (ecc, tp, yp, izp); cy = mpn_sub_n (r + ecc->p.size, tp, ecc->p.m, ecc->p.size); cnd_copy (cy, r + ecc->p.size, tp, ecc->p.size); |