Commit 9f306c0c authored by Niels Möller's avatar Niels Möller

Deleted ecc_a_to_eh.

parent e75c7c45
2014-09-17 Niels Möller <nisse@lysator.liu.se>
* 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.
......
......@@ -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 \
......
/* 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);
}
......@@ -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))
......
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment