From 19ef5194fd2d2f1ef98d7b5aac93dde2c8144bde Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niels=20M=C3=B6ller?= Date: Sat, 23 Aug 2014 22:00:45 +0200 Subject: [PATCH] Deleted unused function ecc_modp_sub_1. --- ChangeLog | 3 +++ ecc-internal.h | 5 ----- ecc-modp.c | 16 ---------------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index ccbae50f..aab10bb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-08-23 Niels Möller + * ecc-modp.c (ecc_modp_sub_1): Deleted unused function. + * ecc-internal.h: Deleted corresponding declaration. + * examples/nettle-benchmark.c (time_cipher): Fixed memset calls, amending the totally broken change from 2014-02-06. diff --git a/ecc-internal.h b/ecc-internal.h index 3d284bd6..aae2fba4 100644 --- a/ecc-internal.h +++ b/ecc-internal.h @@ -45,7 +45,6 @@ #define ecc_generic_modq _nettle_ecc_generic_modq #define ecc_modp_add _nettle_ecc_modp_add #define ecc_modp_sub _nettle_ecc_modp_sub -#define ecc_modp_sub_1 _nettle_ecc_modp_sub_1 #define ecc_modp_mul_1 _nettle_ecc_modp_mul_1 #define ecc_modp_addmul_1 _nettle_ecc_modp_addmul_1 #define ecc_modp_submul_1 _nettle_ecc_modp_submul_1 @@ -158,10 +157,6 @@ void ecc_modp_sub (const struct ecc_curve *ecc, mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *bp); -void -ecc_modp_sub_1 (const struct ecc_curve *ecc, mp_limb_t *rp, - const mp_limb_t *ap, mp_limb_t b); - void ecc_modp_mul_1 (const struct ecc_curve *ecc, mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t b); diff --git a/ecc-modp.c b/ecc-modp.c index b74fdb87..2d50cd0d 100644 --- a/ecc-modp.c +++ b/ecc-modp.c @@ -64,22 +64,6 @@ ecc_modp_sub (const struct ecc_curve *ecc, mp_limb_t *rp, assert (cy == 0); } -void -ecc_modp_sub_1 (const struct ecc_curve *ecc, mp_limb_t *rp, - const mp_limb_t *ap, mp_limb_t b) -{ - mp_size_t i; - - for (i = 0; i < ecc->size; i++) - { - mp_limb_t cy = ap[i] < b; - rp[i] = ap[i] - b; - b = cy; - } - b = cnd_sub_n (b, rp, ecc->Bmodp, ecc->size); - assert (b == 0); -} - void ecc_modp_mul_1 (const struct ecc_curve *ecc, mp_limb_t *rp, const mp_limb_t *ap, mp_limb_t b) -- 2.34.1