From 26dad0211d6478e972c1f12d0917677ada69fc07 Mon Sep 17 00:00:00 2001 From: Leon Date: Tue, 11 Jun 2019 16:39:41 +0200 Subject: [PATCH] remove unused functions --- crypto_kem/ledakemlt12/clean/gf2x_arith.c | 30 ----------------------- crypto_kem/ledakemlt32/clean/gf2x_arith.c | 30 ----------------------- crypto_kem/ledakemlt52/clean/gf2x_arith.c | 30 ----------------------- 3 files changed, 90 deletions(-) diff --git a/crypto_kem/ledakemlt12/clean/gf2x_arith.c b/crypto_kem/ledakemlt12/clean/gf2x_arith.c index ac1a1d04..a26aa99f 100644 --- a/crypto_kem/ledakemlt12/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt12/clean/gf2x_arith.c @@ -3,22 +3,6 @@ #include #include // memset(...) -/* allows the second operand to be shorter than the first */ -/* the result should be as large as the first operand*/ -static inline void gf2x_add_asymm(const size_t nr, DIGIT Res[], - const size_t na, const DIGIT A[], - const size_t nb, const DIGIT B[]) { - assert(nr >= na && na >= nb); - size_t i; - size_t delta = na - nb; - for (i = 0; i < delta; i++) { - Res[i] = A[i]; - } - for (i = 0; i < nb; i++) { - Res[i + delta] = A[i + delta] ^ B[i]; - } -} - /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); @@ -84,17 +68,3 @@ void PQCLEAN_LEDAKEMLT12_CLEAN_gf2x_mul_comb(int nr, DIGIT Res[], } } } - -static inline void gf2x_exact_div_x_plus_one(const int na, DIGIT A[]) { - DIGIT t = 0; - for (int i = na - 1; i >= 0; i--) { - - t ^= A[i]; - - for (int j = 1; j <= DIGIT_SIZE_b / 2; j = j * 2) { - t ^= t << (unsigned) j; - } - A[i] = t; - t >>= DIGIT_SIZE_b - 1; - } -} diff --git a/crypto_kem/ledakemlt32/clean/gf2x_arith.c b/crypto_kem/ledakemlt32/clean/gf2x_arith.c index cc5cf9c7..99caa7ec 100644 --- a/crypto_kem/ledakemlt32/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt32/clean/gf2x_arith.c @@ -3,22 +3,6 @@ #include #include // memset(...) -/* allows the second operand to be shorter than the first */ -/* the result should be as large as the first operand*/ -static inline void gf2x_add_asymm(const int nr, DIGIT Res[], - const int na, const DIGIT A[], - const int nb, const DIGIT B[]) { - assert(nr >= na && na >= nb); - int i; - int delta = na - nb; - for (i = 0; i < delta; i++) { - Res[i] = A[i]; - } - for (i = 0; i < nb; i++) { - Res[i + delta] = A[i + delta] ^ B[i]; - } -} - /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); @@ -84,17 +68,3 @@ void PQCLEAN_LEDAKEMLT32_CLEAN_gf2x_mul_comb(int nr, DIGIT Res[], } } } - -static inline void gf2x_exact_div_x_plus_one(const int na, DIGIT A[]) { - DIGIT t = 0; - for (int i = na - 1; i >= 0; i--) { - - t ^= A[i]; - - for (int j = 1; j <= DIGIT_SIZE_b / 2; j = j * 2) { - t ^= t << (unsigned) j; - } - A[i] = t; - t >>= DIGIT_SIZE_b - 1; - } -} diff --git a/crypto_kem/ledakemlt52/clean/gf2x_arith.c b/crypto_kem/ledakemlt52/clean/gf2x_arith.c index fbbd08e1..9e450a81 100644 --- a/crypto_kem/ledakemlt52/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt52/clean/gf2x_arith.c @@ -3,22 +3,6 @@ #include #include // memset(...) -/* allows the second operand to be shorter than the first */ -/* the result should be as large as the first operand*/ -static inline void gf2x_add_asymm(const size_t nr, DIGIT Res[], - const size_t na, const DIGIT A[], - const size_t nb, const DIGIT B[]) { - assert(nr >= na && na >= nb); - size_t i; - size_t delta = na - nb; - for (i = 0; i < delta; i++) { - Res[i] = A[i]; - } - for (i = 0; i < nb; i++) { - Res[i + delta] = A[i + delta] ^ B[i]; - } -} - /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); @@ -84,17 +68,3 @@ void PQCLEAN_LEDAKEMLT52_CLEAN_gf2x_mul_comb(int nr, DIGIT Res[], } } } - -static inline void gf2x_exact_div_x_plus_one(const int na, DIGIT A[]) { - DIGIT t = 0; - for (int i = na - 1; i >= 0; i--) { - - t ^= A[i]; - - for (int j = 1; j <= DIGIT_SIZE_b / 2; j = j * 2) { - t ^= t << (unsigned) j; - } - A[i] = t; - t >>= DIGIT_SIZE_b - 1; - } -}