Browse Source

mceliece, ntru, ntruprime: satisfy test_boolean (in int32_sort)"

kyber
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
798a7ba86b
22 changed files with 72 additions and 50 deletions
  1. +3
    -2
      crypto_kem/mceliece348864/avx/int32_sort.c
  2. +3
    -2
      crypto_kem/mceliece348864f/avx/int32_sort.c
  3. +3
    -2
      crypto_kem/mceliece460896/avx/int32_sort.c
  4. +3
    -2
      crypto_kem/mceliece460896f/avx/int32_sort.c
  5. +3
    -2
      crypto_kem/mceliece6688128/avx/int32_sort.c
  6. +3
    -2
      crypto_kem/mceliece6688128f/avx/int32_sort.c
  7. +3
    -2
      crypto_kem/mceliece6960119/avx/int32_sort.c
  8. +3
    -2
      crypto_kem/mceliece6960119f/avx/int32_sort.c
  9. +3
    -2
      crypto_kem/mceliece8192128/avx/int32_sort.c
  10. +3
    -2
      crypto_kem/mceliece8192128f/avx/int32_sort.c
  11. +7
    -4
      crypto_kem/ntruhps2048509/avx2/crypto_sort_int32.c
  12. +1
    -2
      crypto_kem/ntruhps2048509/avx2/crypto_sort_int32.h
  13. +7
    -4
      crypto_kem/ntruhps2048677/avx2/crypto_sort_int32.c
  14. +1
    -2
      crypto_kem/ntruhps2048677/avx2/crypto_sort_int32.h
  15. +7
    -4
      crypto_kem/ntruhps4096821/avx2/crypto_sort_int32.c
  16. +1
    -2
      crypto_kem/ntruhps4096821/avx2/crypto_sort_int32.h
  17. +3
    -2
      crypto_kem/ntrulpr653/avx2/crypto_sort_int32.c
  18. +3
    -2
      crypto_kem/ntrulpr761/avx2/crypto_sort_int32.c
  19. +3
    -2
      crypto_kem/ntrulpr857/avx2/crypto_sort_int32.c
  20. +3
    -2
      crypto_kem/sntrup653/avx2/crypto_sort_int32.c
  21. +3
    -2
      crypto_kem/sntrup761/avx2/crypto_sort_int32.c
  22. +3
    -2
      crypto_kem/sntrup857/avx2/crypto_sort_int32.c

+ 3
- 2
crypto_kem/mceliece348864/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece348864f/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece460896/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece460896f/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece6688128/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece6688128f/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece6960119/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece6960119f/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece8192128/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/mceliece8192128f/avx/int32_sort.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 7
- 4
crypto_kem/ntruhps2048509/avx2/crypto_sort_int32.c View File

@@ -1,8 +1,8 @@
#include "crypto_sort_int32.h"
#include <immintrin.h>
// Based on supercop-20200820/crypto_sort/int32/avx2

#include "crypto_sort_int32.h"

#include <immintrin.h>
#define int32 int32_t

typedef __m256i int32x8;
@@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 1
- 2
crypto_kem/ntruhps2048509/avx2/crypto_sort_int32.h View File

@@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT
#define CRYPTO_SORT

#include "params.h"

#include <stddef.h>
#include <stdint.h>


void PQCLEAN_NTRUHPS2048509_AVX2_crypto_sort_int32(int32_t *x, size_t n);

#endif

+ 7
- 4
crypto_kem/ntruhps2048677/avx2/crypto_sort_int32.c View File

@@ -1,8 +1,8 @@
#include "crypto_sort_int32.h"
#include <immintrin.h>
// Based on supercop-20200820/crypto_sort/int32/avx2

#include "crypto_sort_int32.h"

#include <immintrin.h>
#define int32 int32_t

typedef __m256i int32x8;
@@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 1
- 2
crypto_kem/ntruhps2048677/avx2/crypto_sort_int32.h View File

@@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT
#define CRYPTO_SORT

#include "params.h"

#include <stddef.h>
#include <stdint.h>


void PQCLEAN_NTRUHPS2048677_AVX2_crypto_sort_int32(int32_t *x, size_t n);

#endif

+ 7
- 4
crypto_kem/ntruhps4096821/avx2/crypto_sort_int32.c View File

@@ -1,8 +1,8 @@
#include "crypto_sort_int32.h"
#include <immintrin.h>
// Based on supercop-20200820/crypto_sort/int32/avx2

#include "crypto_sort_int32.h"

#include <immintrin.h>
#define int32 int32_t

typedef __m256i int32x8;
@@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 1
- 2
crypto_kem/ntruhps4096821/avx2/crypto_sort_int32.h View File

@@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT
#define CRYPTO_SORT

#include "params.h"

#include <stddef.h>
#include <stdint.h>


void PQCLEAN_NTRUHPS4096821_AVX2_crypto_sort_int32(int32_t *x, size_t n);

#endif

+ 3
- 2
crypto_kem/ntrulpr653/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/ntrulpr761/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/ntrulpr857/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/sntrup653/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/sntrup761/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


+ 3
- 2
crypto_kem/sntrup857/avx2/crypto_sort_int32.c View File

@@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
}

q = n >> 3;
flip = (p << 1 == q);
flipflip = !flip;
flip = 0;
if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) {


Loading…
Cancel
Save