From: Niels Möller Date: Wed, 17 Sep 2014 19:12:36 +0000 (+0200) Subject: Deleted ecc_a_to_eh. X-Git-Tag: nettle_3.1rc1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f306c0c0f5eb397a6f1eabd16d5834af707d3b1;p=thirdparty%2Fnettle.git Deleted ecc_a_to_eh. --- diff --git a/ChangeLog b/ChangeLog index 5e59a87a..7b1e2a3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2014-09-17 Niels Möller + * ecc-a-to-eh.c (ecc_a_to_eh_itch, ecc_a_to_eh): Deleted file and + functions. + * ecc.h: Deleted corresponding declarations. + * ecc-internal.h (ECC_A_TO_EH_ITCH): Deleted macro. + * Makefile.in (hogweed_SOURCES): Removed ecc-a-to-eh.c. + * testsuite/ecdh-test.c (test_main): Update curve25519 test to use Edwards coordinates. * testsuite/ecdsa-sign-test.c (test_main): Likewise. diff --git a/Makefile.in b/Makefile.in index a35f8ad1..770d55f7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -168,7 +168,7 @@ hogweed_SOURCES = sexp.c sexp-format.c \ ecc-25519.c \ ecc-size.c ecc-j-to-a.c ecc-a-to-j.c \ ecc-dup-jj.c ecc-add-jja.c ecc-add-jjj.c \ - ecc-a-to-eh.c ecc-eh-to-a.c \ + ecc-eh-to-a.c \ ecc-dup-eh.c ecc-add-eh.c ecc-add-ehh.c \ ecc-mul-g-eh.c ecc-mul-a-eh.c \ ecc-mul-g.c ecc-mul-a.c ecc-hash.c ecc-random.c \ diff --git a/ecc-a-to-eh.c b/ecc-a-to-eh.c deleted file mode 100644 index 7f77394e..00000000 --- a/ecc-a-to-eh.c +++ /dev/null @@ -1,77 +0,0 @@ -/* ecc-a-to-eh.c - - Copyright (C) 2014 Niels Möller - - This file is part of GNU Nettle. - - GNU Nettle is free software: you can redistribute it and/or - modify it under the terms of either: - - * the GNU Lesser General Public License as published by the Free - Software Foundation; either version 3 of the License, or (at your - option) any later version. - - or - - * the GNU General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your - option) any later version. - - or both in parallel, as here. - - GNU Nettle is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received copies of the GNU General Public License and - the GNU Lesser General Public License along with this program. If - not, see http://www.gnu.org/licenses/. -*/ - -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include "ecc.h" -#include "ecc-internal.h" - -mp_size_t -ecc_a_to_eh_itch (const struct ecc_curve *ecc) -{ - return ECC_A_TO_EH_ITCH (ecc->size); -} - -/* Convert from affine coordinates to homogeneous coordinates on the - corresponding Edwards curve. */ -void -ecc_a_to_eh (const struct ecc_curve *ecc, - mp_limb_t *r, const mp_limb_t *p, - mp_limb_t *scratch) -{ -#define xp p -#define yp (p + ecc->size) - -#define up r -#define vp (r + ecc->size) -#define wp (r + 2*ecc->size) - - /* u = t x / y - v = (x-1) / (x+1) - - or in homogeneous coordinates - - U = t x (x+1) - V = (x-1) y - W = (x+1) y - */ - - ecc_modp_mul (ecc, scratch, xp, yp); - ecc_modp_add (ecc, wp, scratch, yp); - ecc_modp_sub (ecc, vp, scratch, yp); - - ecc_modp_sqr (ecc, scratch, xp); - ecc_modp_add (ecc, up, scratch, xp); - ecc_modp_mul (ecc, scratch, up, ecc->edwards_root); - mpn_copyi (up, scratch, ecc->size); -} diff --git a/ecc-internal.h b/ecc-internal.h index ffa6fe26..777ab77e 100644 --- a/ecc-internal.h +++ b/ecc-internal.h @@ -275,7 +275,6 @@ curve25519_eh_to_x (mp_limb_t *xp, const mp_limb_t *p, #define ECC_MODINV_ITCH(size) (3*(size)) #define ECC_J_TO_A_ITCH(size) (5*(size)) #define ECC_EH_TO_A_ITCH(size) (4*(size)) -#define ECC_A_TO_EH_ITCH(size) (2*(size)) #define ECC_DUP_JJ_ITCH(size) (5*(size)) #define ECC_DUP_EH_ITCH(size) (5*(size)) #define ECC_ADD_JJA_ITCH(size) (6*(size)) diff --git a/ecc.h b/ecc.h index 0d07ee5d..a003a1ed 100644 --- a/ecc.h +++ b/ecc.h @@ -63,8 +63,6 @@ extern "C" { #define ecc_j_to_a nettle_ecc_j_to_a #define ecc_eh_to_a_itch nettle_ecc_eh_to_a_itch #define ecc_eh_to_a nettle_ecc_eh_to_a -#define ecc_a_to_eh_itch nettle_ecc_a_to_eh_itch -#define ecc_a_to_eh nettle_ecc_a_to_eh #define ecc_dup_jj_itch nettle_ecc_dup_jj_itch #define ecc_dup_jj nettle_ecc_dup_jj #define ecc_add_jja_itch nettle_ecc_add_jja_itch @@ -210,13 +208,6 @@ ecc_eh_to_a (const struct ecc_curve *ecc, mp_limb_t *r, const mp_limb_t *p, mp_limb_t *scratch); -mp_size_t -ecc_a_to_eh_itch (const struct ecc_curve *ecc); -void -ecc_a_to_eh (const struct ecc_curve *ecc, - mp_limb_t *r, const mp_limb_t *p, - mp_limb_t *scratch); - /* Group operations */ /* Point doubling, with jacobian input and output. Corner cases: