Browse Source

narrowing warnings

kyber
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
eb120a6b24
28 changed files with 72 additions and 50 deletions
  1. +2
    -2
      crypto_kem/hqc-128/avx2/fft.c
  2. +2
    -2
      crypto_kem/hqc-128/clean/fft.c
  3. +4
    -3
      crypto_kem/hqc-128/clean/gf2x.c
  4. +1
    -1
      crypto_kem/hqc-128/clean/repetition.c
  5. +3
    -3
      crypto_kem/hqc-192/avx2/fft.c
  6. +4
    -3
      crypto_kem/hqc-192/clean/fft.c
  7. +4
    -3
      crypto_kem/hqc-192/clean/gf2x.c
  8. +1
    -1
      crypto_kem/hqc-192/clean/repetition.c
  9. +3
    -3
      crypto_kem/hqc-256/avx2/fft.c
  10. +4
    -3
      crypto_kem/hqc-256/clean/fft.c
  11. +4
    -3
      crypto_kem/hqc-256/clean/gf2x.c
  12. +2
    -2
      crypto_kem/hqc-rmrs-128/avx2/fft.c
  13. +2
    -2
      crypto_kem/hqc-rmrs-128/clean/fft.c
  14. +4
    -3
      crypto_kem/hqc-rmrs-128/clean/gf2x.c
  15. +2
    -2
      crypto_kem/hqc-rmrs-192/avx2/fft.c
  16. +3
    -3
      crypto_kem/hqc-rmrs-192/clean/fft.c
  17. +4
    -3
      crypto_kem/hqc-rmrs-192/clean/gf2x.c
  18. +2
    -2
      crypto_kem/hqc-rmrs-256/avx2/fft.c
  19. +3
    -3
      crypto_kem/hqc-rmrs-256/clean/fft.c
  20. +4
    -3
      crypto_kem/hqc-rmrs-256/clean/gf2x.c
  21. +2
    -0
      test/duplicate_consistency/hqc-128_avx2.yml
  22. +2
    -0
      test/duplicate_consistency/hqc-128_clean.yml
  23. +2
    -0
      test/duplicate_consistency/hqc-rmrs-128_avx2.yml
  24. +2
    -0
      test/duplicate_consistency/hqc-rmrs-128_clean.yml
  25. +2
    -0
      test/duplicate_consistency/hqc-rmrs-192_avx2.yml
  26. +2
    -0
      test/duplicate_consistency/hqc-rmrs-192_clean.yml
  27. +1
    -0
      test/duplicate_consistency/hqc-rmrs-256_avx2.yml
  28. +1
    -0
      test/duplicate_consistency/hqc-rmrs-256_clean.yml

+ 2
- 2
crypto_kem/hqc-128/avx2/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -47,7 +47,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 2
- 2
crypto_kem/hqc-128/clean/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix_t(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void radix_t_big(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void fft_t_rec(uint16_t *f, const uint16_t *w, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -50,7 +50,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 4
- 3
crypto_kem/hqc-128/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 1
- 1
crypto_kem/hqc-128/clean/repetition.c View File

@@ -24,7 +24,7 @@ void PQCLEAN_HQC128_CLEAN_repetition_code_encode(uint64_t *em, const uint64_t *m
uint32_t pos_r;
uint64_t *p64 = em;
const uint64_t mask[2][2] = {{0x0UL, 0x0UL}, {0x7FFFFFFFUL, 0x3FFFFFFFUL}};
for (i = 0; i < VEC_N1_SIZE_64 - 1; i++) {
for (i = 0; i < (uint16_t) (VEC_N1_SIZE_64 - 1); i++) {
for (j = 0; j < 64; j++) {
bit = (m[i] >> j) & 0x1;
pos_r = PARAM_N2 * ((i << 6) + j);


+ 3
- 3
crypto_kem/hqc-192/avx2/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -47,8 +47,8 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
size_t i, j;
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

for (i = 0; i < set_size; ++i) {


+ 4
- 3
crypto_kem/hqc-192/clean/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix_t(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void radix_t_big(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void fft_t_rec(uint16_t *f, const uint16_t *w, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -50,7 +50,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

@@ -628,7 +628,8 @@ void PQCLEAN_HQC192_CLEAN_fft_retrieve_bch_error_poly(uint64_t *error, const uin
uint16_t gammas[PARAM_M - 1] = {0};
uint16_t gammas_sums[1 << (PARAM_M - 1)] = {0};
uint64_t bit;
size_t i, k, index;
uint16_t k;
size_t i, index;

compute_fft_betas(gammas);
compute_subset_sums(gammas_sums, gammas, PARAM_M - 1);


+ 4
- 3
crypto_kem/hqc-192/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 1
- 1
crypto_kem/hqc-192/clean/repetition.c View File

@@ -24,7 +24,7 @@ void PQCLEAN_HQC192_CLEAN_repetition_code_encode(uint64_t *em, const uint64_t *m
uint32_t pos_r;
uint64_t *p64 = em;
const uint64_t mask[2][2] = {{0x0UL, 0x0UL}, {0x7FFFFFFFFFFFFFFUL, 0x3FFFFFFFFFFFFFFUL}};
for (i = 0; i < VEC_N1_SIZE_64 - 1; i++) {
for (i = 0; i < (uint16_t) (VEC_N1_SIZE_64 - 1); i++) {
for (j = 0; j < 64; j++) {
bit = (m[i] >> j) & 0x1;
pos_r = PARAM_N2 * ((i << 6) + j);


+ 3
- 3
crypto_kem/hqc-256/avx2/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -47,8 +47,8 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
size_t i, j;
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

for (i = 0; i < set_size; ++i) {


+ 4
- 3
crypto_kem/hqc-256/clean/fft.c View File

@@ -17,7 +17,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix_t(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void radix_t_big(uint16_t *f, const uint16_t *f0, const uint16_t *f1, uint32_t m_f);
static void fft_t_rec(uint16_t *f, const uint16_t *w, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -50,7 +50,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

@@ -628,7 +628,8 @@ void PQCLEAN_HQC256_CLEAN_fft_retrieve_bch_error_poly(uint64_t *error, const uin
uint16_t gammas[PARAM_M - 1] = {0};
uint16_t gammas_sums[1 << (PARAM_M - 1)] = {0};
uint64_t bit;
size_t i, k, index;
uint16_t k;
size_t i, index;

compute_fft_betas(gammas);
compute_subset_sums(gammas_sums, gammas, PARAM_M - 1);


+ 4
- 3
crypto_kem/hqc-256/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 2
- 2
crypto_kem/hqc-rmrs-128/avx2/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,7 +46,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 2
- 2
crypto_kem/hqc-rmrs-128/clean/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,7 +46,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 4
- 3
crypto_kem/hqc-rmrs-128/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 2
- 2
crypto_kem/hqc-rmrs-192/avx2/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,7 +46,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 3
- 3
crypto_kem/hqc-rmrs-192/clean/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,8 +46,8 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
size_t i, j;
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

for (i = 0; i < set_size; ++i) {


+ 4
- 3
crypto_kem/hqc-rmrs-192/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 2
- 2
crypto_kem/hqc-rmrs-256/avx2/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,7 +46,7 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;



+ 3
- 3
crypto_kem/hqc-rmrs-256/clean/fft.c View File

@@ -16,7 +16,7 @@


static void compute_fft_betas(uint16_t *betas);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size);
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size);
static void radix(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void radix_big(uint16_t *f0, uint16_t *f1, const uint16_t *f, uint32_t m_f);
static void fft_rec(uint16_t *w, uint16_t *f, size_t f_coeffs, uint8_t m, uint32_t m_f, const uint16_t *betas);
@@ -46,8 +46,8 @@ static void compute_fft_betas(uint16_t *betas) {
* @param[in] set Array of set_size elements
* @param[in] set_size Size of the array set
*/
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, size_t set_size) {
size_t i, j;
static void compute_subset_sums(uint16_t *subset_sums, const uint16_t *set, uint16_t set_size) {
uint16_t i, j;
subset_sums[0] = 0;

for (i = 0; i < set_size; ++i) {


+ 4
- 3
crypto_kem/hqc-rmrs-256/clean/gf2x.c View File

@@ -42,10 +42,11 @@ static inline void swap(uint16_t *tab, uint16_t elt1, uint16_t elt2) {
* @param[out] o Pointer to the result
*/
static void reduce(uint64_t *o, const uint64_t *a) {
size_t i;
uint64_t r;
uint64_t carry;

for (uint32_t i = 0; i < VEC_N_SIZE_64; i++) {
for (i = 0; i < VEC_N_SIZE_64; i++) {
r = a[i + VEC_N_SIZE_64 - 1] >> (PARAM_N & 63);
carry = (uint64_t) (a[i + VEC_N_SIZE_64] << (64 - (PARAM_N & 63)));
o[i] = a[i] ^ r ^ carry;
@@ -78,7 +79,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
uint16_t permutation_sparse_vect[PARAM_OMEGA_E];
uint64_t *pt;
uint16_t *res_16;
uint16_t i, j;
size_t i, j;

for (i = 0; i < 16; i++) {
permuted_table[i] = i;
@@ -113,7 +114,7 @@ static void fast_convolution_mult(uint64_t *o, const uint32_t *a1, const uint64_
seedexpander(ctx, (uint8_t *) permutation_sparse_vect, weight * sizeof(uint16_t));

for (i = 0; i + 1 < weight; i++) {
swap(permuted_sparse_vect + i, 0, permutation_sparse_vect[i] % (weight - i));
swap(permuted_sparse_vect + i, 0, (uint16_t) (permutation_sparse_vect[i] % (weight - i)));
}

for (i = 0; i < weight; i++) {


+ 2
- 0
test/duplicate_consistency/hqc-128_avx2.yml View File

@@ -28,6 +28,7 @@ consistency_checks:
- repetition.h
- vector.h
- bch.c
- fft.c
- gf.c
- hqc.c
- kem.c
@@ -53,6 +54,7 @@ consistency_checks:
- repetition.h
- vector.h
- bch.c
- fft.c
- gf.c
- hqc.c
- kem.c


+ 2
- 0
test/duplicate_consistency/hqc-128_clean.yml View File

@@ -21,6 +21,7 @@ consistency_checks:
- vector.h
- bch.c
- code.c
- fft.c
- gf2x.c
- gf.c
- hqc.c
@@ -47,6 +48,7 @@ consistency_checks:
- vector.h
- bch.c
- code.c
- fft.c
- gf2x.c
- gf.c
- hqc.c


+ 2
- 0
test/duplicate_consistency/hqc-rmrs-128_avx2.yml View File

@@ -23,6 +23,7 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c
- source:
scheme: hqc-rmrs-192
implementation: avx2
@@ -55,6 +56,7 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c
- source:
scheme: hqc-rmrs-256
implementation: avx2


+ 2
- 0
test/duplicate_consistency/hqc-rmrs-128_clean.yml View File

@@ -26,6 +26,7 @@ consistency_checks:
- reed_solomon.h
- vector.h
- code.c
- fft.c
- gf2x.c
- gf.c
- hqc.c
@@ -59,6 +60,7 @@ consistency_checks:
- reed_solomon.h
- vector.h
- code.c
- fft.c
- gf2x.c
- gf.c
- hqc.c


+ 2
- 0
test/duplicate_consistency/hqc-rmrs-192_avx2.yml View File

@@ -11,6 +11,7 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c
- source:
scheme: hqc-rmrs-256
implementation: clean
@@ -22,6 +23,7 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c
- source:
scheme: hqc-rmrs-256
implementation: avx2


+ 2
- 0
test/duplicate_consistency/hqc-rmrs-192_clean.yml View File

@@ -11,6 +11,7 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c
- source:
scheme: hqc-rmrs-256
implementation: clean
@@ -44,3 +45,4 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c

+ 1
- 0
test/duplicate_consistency/hqc-rmrs-256_avx2.yml View File

@@ -11,3 +11,4 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c

+ 1
- 0
test/duplicate_consistency/hqc-rmrs-256_clean.yml View File

@@ -11,3 +11,4 @@ consistency_checks:
- reed_muller.h
- reed_solomon.h
- code.c
- fft.c

Loading…
Cancel
Save