1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 07:35:38 +00:00

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 committed by Kris Kwiatkowski
parent fdd73d893c
commit 798a7ba86b
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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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 // Based on supercop-20200820/crypto_sort/int32/avx2
#include "crypto_sort_int32.h"
#include <immintrin.h>
#define int32 int32_t #define int32 int32_t
typedef __m256i int32x8; typedef __m256i int32x8;
@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
} }
q = n >> 3; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { for (i = k; i < k + p; i += 8) {

View File

@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT #ifndef CRYPTO_SORT
#define CRYPTO_SORT #define CRYPTO_SORT
#include "params.h" #include "params.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
void PQCLEAN_NTRUHPS2048509_AVX2_crypto_sort_int32(int32_t *x, size_t n); void PQCLEAN_NTRUHPS2048509_AVX2_crypto_sort_int32(int32_t *x, size_t n);
#endif #endif

View File

@ -1,8 +1,8 @@
#include "crypto_sort_int32.h"
#include <immintrin.h>
// Based on supercop-20200820/crypto_sort/int32/avx2 // Based on supercop-20200820/crypto_sort/int32/avx2
#include "crypto_sort_int32.h"
#include <immintrin.h>
#define int32 int32_t #define int32 int32_t
typedef __m256i int32x8; typedef __m256i int32x8;
@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
} }
q = n >> 3; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { for (i = k; i < k + p; i += 8) {

View File

@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT #ifndef CRYPTO_SORT
#define CRYPTO_SORT #define CRYPTO_SORT
#include "params.h" #include "params.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
void PQCLEAN_NTRUHPS2048677_AVX2_crypto_sort_int32(int32_t *x, size_t n); void PQCLEAN_NTRUHPS2048677_AVX2_crypto_sort_int32(int32_t *x, size_t n);
#endif #endif

View File

@ -1,8 +1,8 @@
#include "crypto_sort_int32.h"
#include <immintrin.h>
// Based on supercop-20200820/crypto_sort/int32/avx2 // Based on supercop-20200820/crypto_sort/int32/avx2
#include "crypto_sort_int32.h"
#include <immintrin.h>
#define int32 int32_t #define int32 int32_t
typedef __m256i int32x8; typedef __m256i int32x8;
@ -469,8 +469,11 @@ static void int32_sort_2power(int32 *x, size_t n, int flagdown) {
} }
q = n >> 3; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) {
flip = 1;
}
flipflip = 1 - flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { for (i = k; i < k + p; i += 8) {

View File

@ -1,11 +1,10 @@
#ifndef CRYPTO_SORT #ifndef CRYPTO_SORT
#define CRYPTO_SORT #define CRYPTO_SORT
#include "params.h" #include "params.h"
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
void PQCLEAN_NTRUHPS4096821_AVX2_crypto_sort_int32(int32_t *x, size_t n); void PQCLEAN_NTRUHPS4096821_AVX2_crypto_sort_int32(int32_t *x, size_t n);
#endif #endif

View File

@ -462,8 +462,9 @@ static void int32_sort_2power(int32 *x, long long n, int flagdown) {
} }
q = n >> 3; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { 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; q = n >> 3;
flip = (p << 1 == q); flip = 0;
flipflip = !flip; if (p << 1 == q) flip = 1;
flipflip = 1-flip;
for (j = 0; j < q; j += p + p) { for (j = 0; j < q; j += p + p) {
for (k = j; k < j + p + p; k += p) { for (k = j; k < j + p + p; k += p) {
for (i = k; i < k + p; i += 8) { for (i = k; i < k + p; i += 8) {