diff --git a/crypto_kem/ledakemlt12/clean/gf2x_arith.c b/crypto_kem/ledakemlt12/clean/gf2x_arith.c index c2d76059..ac1a1d04 100644 --- a/crypto_kem/ledakemlt12/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt12/clean/gf2x_arith.c @@ -20,7 +20,7 @@ static inline void gf2x_add_asymm(const size_t nr, DIGIT Res[], } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; @@ -36,12 +36,12 @@ void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsi } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT12_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT12_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; } - size_t j; + int j; DIGIT mask; mask = ~(((DIGIT)0x01 << (DIGIT_SIZE_b - amount)) - 1); for (j = 0 ; j < length - 1 ; j++) { diff --git a/crypto_kem/ledakemlt12/clean/gf2x_arith.h b/crypto_kem/ledakemlt12/clean/gf2x_arith.h index 032dfd57..9cb10569 100644 --- a/crypto_kem/ledakemlt12/clean/gf2x_arith.h +++ b/crypto_kem/ledakemlt12/clean/gf2x_arith.h @@ -50,14 +50,14 @@ typedef uint64_t DIGIT; #define GF2X_MUL PQCLEAN_LEDAKEMLT12_CLEAN_gf2x_mul_comb -static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], size_t nr) { - for (size_t i = 0; i < nr; i++) { +static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], int nr) { + for (int i = 0; i < nr; i++) { Res[i] = A[i] ^ B[i]; } } -void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); -void PQCLEAN_LEDAKEMLT12_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT12_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT12_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount); void GF2X_MUL(int nr, DIGIT Res[], int na, const DIGIT A[], int nb, const DIGIT B[]); #endif diff --git a/crypto_kem/ledakemlt12/clean/rng.c b/crypto_kem/ledakemlt12/clean/rng.c index d9e9bc66..c79b3195 100644 --- a/crypto_kem/ledakemlt12/clean/rng.c +++ b/crypto_kem/ledakemlt12/clean/rng.c @@ -15,7 +15,7 @@ static int seedexpander_init(AES_XOF_struct *ctx, unsigned char *seed, unsigned char *diversifier, - uint64_t maxlen) { + size_t maxlen) { if ( maxlen >= 0x100000000 ) { return RNG_BAD_MAXLEN; } diff --git a/crypto_kem/ledakemlt12/clean/rng.h b/crypto_kem/ledakemlt12/clean/rng.h index b34dbbc6..7638f216 100644 --- a/crypto_kem/ledakemlt12/clean/rng.h +++ b/crypto_kem/ledakemlt12/clean/rng.h @@ -11,8 +11,8 @@ typedef struct { unsigned char buffer[16]; - unsigned int buffer_pos; - uint64_t length_remaining; + size_t buffer_pos; + size_t length_remaining; unsigned char key[32]; unsigned char ctr[16]; } AES_XOF_struct; diff --git a/crypto_kem/ledakemlt32/clean/gf2x_arith.c b/crypto_kem/ledakemlt32/clean/gf2x_arith.c index 3ef670d2..cc5cf9c7 100644 --- a/crypto_kem/ledakemlt32/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt32/clean/gf2x_arith.c @@ -5,12 +5,12 @@ /* 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[]) { +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); - size_t i; - size_t delta = na - nb; + int i; + int delta = na - nb; for (i = 0; i < delta; i++) { Res[i] = A[i]; } @@ -20,7 +20,7 @@ static inline void gf2x_add_asymm(const size_t nr, DIGIT Res[], } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; @@ -36,12 +36,12 @@ void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsi } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT32_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT32_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; } - size_t j; + int j; DIGIT mask; mask = ~(((DIGIT)0x01 << (DIGIT_SIZE_b - amount)) - 1); for (j = 0 ; j < length - 1 ; j++) { diff --git a/crypto_kem/ledakemlt32/clean/gf2x_arith.h b/crypto_kem/ledakemlt32/clean/gf2x_arith.h index 051e3b52..d55b4eb3 100644 --- a/crypto_kem/ledakemlt32/clean/gf2x_arith.h +++ b/crypto_kem/ledakemlt32/clean/gf2x_arith.h @@ -50,14 +50,14 @@ typedef uint64_t DIGIT; #define GF2X_MUL PQCLEAN_LEDAKEMLT32_CLEAN_gf2x_mul_comb -static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], size_t nr) { - for (size_t i = 0; i < nr; i++) { +static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], int nr) { + for (int i = 0; i < nr; i++) { Res[i] = A[i] ^ B[i]; } } -void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); -void PQCLEAN_LEDAKEMLT32_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT32_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT32_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount); void GF2X_MUL(int nr, DIGIT Res[], int na, const DIGIT A[], int nb, const DIGIT B[]); #endif diff --git a/crypto_kem/ledakemlt32/clean/rng.c b/crypto_kem/ledakemlt32/clean/rng.c index 2b300538..d62569a8 100644 --- a/crypto_kem/ledakemlt32/clean/rng.c +++ b/crypto_kem/ledakemlt32/clean/rng.c @@ -15,7 +15,7 @@ static int seedexpander_init(AES_XOF_struct *ctx, unsigned char *seed, unsigned char *diversifier, - uint64_t maxlen) { + size_t maxlen) { if ( maxlen >= 0x100000000 ) { return RNG_BAD_MAXLEN; } diff --git a/crypto_kem/ledakemlt32/clean/rng.h b/crypto_kem/ledakemlt32/clean/rng.h index 0fe312a6..c50b6daf 100644 --- a/crypto_kem/ledakemlt32/clean/rng.h +++ b/crypto_kem/ledakemlt32/clean/rng.h @@ -11,8 +11,8 @@ typedef struct { unsigned char buffer[16]; - unsigned int buffer_pos; - uint64_t length_remaining; + size_t buffer_pos; + size_t length_remaining; unsigned char key[32]; unsigned char ctr[16]; } AES_XOF_struct; diff --git a/crypto_kem/ledakemlt52/clean/gf2x_arith.c b/crypto_kem/ledakemlt52/clean/gf2x_arith.c index cd0cddda..fbbd08e1 100644 --- a/crypto_kem/ledakemlt52/clean/gf2x_arith.c +++ b/crypto_kem/ledakemlt52/clean/gf2x_arith.c @@ -20,7 +20,7 @@ static inline void gf2x_add_asymm(const size_t nr, DIGIT Res[], } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; @@ -36,12 +36,12 @@ void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsi } /* PRE: MAX ALLOWED ROTATION AMOUNT : DIGIT_SIZE_b */ -void PQCLEAN_LEDAKEMLT52_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount) { +void PQCLEAN_LEDAKEMLT52_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount) { assert(amount < DIGIT_SIZE_b); if ( amount == 0 ) { return; } - size_t j; + int j; DIGIT mask; mask = ~(((DIGIT)0x01 << (DIGIT_SIZE_b - amount)) - 1); for (j = 0 ; j < length - 1 ; j++) { diff --git a/crypto_kem/ledakemlt52/clean/gf2x_arith.h b/crypto_kem/ledakemlt52/clean/gf2x_arith.h index 86303150..c3b6cb4a 100644 --- a/crypto_kem/ledakemlt52/clean/gf2x_arith.h +++ b/crypto_kem/ledakemlt52/clean/gf2x_arith.h @@ -50,14 +50,14 @@ typedef uint64_t DIGIT; #define GF2X_MUL PQCLEAN_LEDAKEMLT52_CLEAN_gf2x_mul_comb -static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], size_t nr) { - for (size_t i = 0; i < nr; i++) { +static inline void gf2x_add(DIGIT Res[], const DIGIT A[], const DIGIT B[], int nr) { + for (int i = 0; i < nr; i++) { Res[i] = A[i] ^ B[i]; } } -void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); -void PQCLEAN_LEDAKEMLT52_CLEAN_left_bit_shift_n(size_t length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT52_CLEAN_right_bit_shift_n(int length, DIGIT in[], unsigned int amount); +void PQCLEAN_LEDAKEMLT52_CLEAN_left_bit_shift_n(int length, DIGIT in[], unsigned int amount); void GF2X_MUL(int nr, DIGIT Res[], int na, const DIGIT A[], int nb, const DIGIT B[]); #endif diff --git a/crypto_kem/ledakemlt52/clean/rng.c b/crypto_kem/ledakemlt52/clean/rng.c index 28346f3d..3b4af455 100644 --- a/crypto_kem/ledakemlt52/clean/rng.c +++ b/crypto_kem/ledakemlt52/clean/rng.c @@ -15,7 +15,7 @@ static int seedexpander_init(AES_XOF_struct *ctx, unsigned char *seed, unsigned char *diversifier, - uint64_t maxlen) { + size_t maxlen) { if ( maxlen >= 0x100000000 ) { return RNG_BAD_MAXLEN; } diff --git a/crypto_kem/ledakemlt52/clean/rng.h b/crypto_kem/ledakemlt52/clean/rng.h index fea4032d..d6d5b302 100644 --- a/crypto_kem/ledakemlt52/clean/rng.h +++ b/crypto_kem/ledakemlt52/clean/rng.h @@ -11,8 +11,8 @@ typedef struct { unsigned char buffer[16]; - unsigned int buffer_pos; - uint64_t length_remaining; + size_t buffer_pos; + size_t length_remaining; unsigned char key[32]; unsigned char ctr[16]; } AES_XOF_struct;