Browse Source

remove unused functions

master
Leon 5 years ago
parent
commit
26dad0211d
3 changed files with 0 additions and 90 deletions
  1. +0
    -30
      crypto_kem/ledakemlt12/clean/gf2x_arith.c
  2. +0
    -30
      crypto_kem/ledakemlt32/clean/gf2x_arith.c
  3. +0
    -30
      crypto_kem/ledakemlt52/clean/gf2x_arith.c

+ 0
- 30
crypto_kem/ledakemlt12/clean/gf2x_arith.c View File

@@ -3,22 +3,6 @@
#include <assert.h>
#include <string.h> // 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;
}
}

+ 0
- 30
crypto_kem/ledakemlt32/clean/gf2x_arith.c View File

@@ -3,22 +3,6 @@
#include <assert.h>
#include <string.h> // 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;
}
}

+ 0
- 30
crypto_kem/ledakemlt52/clean/gf2x_arith.c View File

@@ -3,22 +3,6 @@
#include <assert.h>
#include <string.h> // 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;
}
}

Loading…
Cancel
Save