From 2b9388b647a68654186ff821c17426355850f39f Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Fri, 5 Dec 2014 18:13:51 +0100 Subject: [PATCH] Remove unused secp256k1_fe_inv_all --- src/field.h | 3 --- src/field_impl.h | 24 ------------------------ src/tests.c | 18 ------------------ 3 files changed, 45 deletions(-) diff --git a/src/field.h b/src/field.h index 0cdf0fb479..9ff1b11aca 100644 --- a/src/field.h +++ b/src/field.h @@ -105,9 +105,6 @@ static void secp256k1_fe_inv_var(secp256k1_fe_t *r, const secp256k1_fe_t *a); /** Calculate the (modular) inverses of a batch of field elements. Requires the inputs' magnitudes to be * at most 8. The output magnitudes are 1 (but not guaranteed to be normalized). The inputs and * outputs must not overlap in memory. */ -static void secp256k1_fe_inv_all(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]); - -/** Potentially faster version of secp256k1_fe_inv_all, without constant-time guarantee. */ static void secp256k1_fe_inv_all_var(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]); /** Convert a field element to a hexadecimal string. */ diff --git a/src/field_impl.h b/src/field_impl.h index 4d25e53715..9ef8fb30c3 100644 --- a/src/field_impl.h +++ b/src/field_impl.h @@ -218,30 +218,6 @@ static void secp256k1_fe_inv_var(secp256k1_fe_t *r, const secp256k1_fe_t *a) { #endif } -static void secp256k1_fe_inv_all(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]) { - if (len < 1) - return; - - VERIFY_CHECK((r + len <= a) || (a + len <= r)); - - r[0] = a[0]; - - size_t i = 0; - while (++i < len) { - secp256k1_fe_mul(&r[i], &r[i - 1], &a[i]); - } - - secp256k1_fe_t u; secp256k1_fe_inv(&u, &r[--i]); - - while (i > 0) { - int j = i--; - secp256k1_fe_mul(&r[j], &r[i], &u); - secp256k1_fe_mul(&u, &u, &a[j]); - } - - r[0] = u; -} - static void secp256k1_fe_inv_all_var(size_t len, secp256k1_fe_t r[len], const secp256k1_fe_t a[len]) { if (len < 1) return; diff --git a/src/tests.c b/src/tests.c index 78cdd67f27..0e16ec4074 100644 --- a/src/tests.c +++ b/src/tests.c @@ -498,23 +498,6 @@ void run_field_inv_var(void) { } } -void run_field_inv_all(void) { - secp256k1_fe_t x[16], xi[16], xii[16]; - /* Check it's safe to call for 0 elements */ - secp256k1_fe_inv_all(0, xi, x); - for (int i=0; i