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

This commit is contained in:
John M. Schanck 2020-09-15 12:24:07 -04:00
parent 8ec84d0c3a
commit 938a5dcd5d
22 changed files with 72 additions and 50 deletions

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) {

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) {

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) {

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) {

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) {

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) {

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) {

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) {

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) {

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) {

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) {

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

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) {

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

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) {

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

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) {

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) {

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) {

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) {

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) {

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) {