1
1
Mirror von https://github.com/henrydcase/pqc.git synchronisiert 2024-11-22 15:39:07 +00:00

NTRU Prime: more compiler warnings

Dieser Commit ist enthalten in:
John M. Schanck 2020-09-01 15:56:45 -04:00 committet von Kris Kwiatkowski
Ursprung 09d3f1e1e6
Commit 191aed977f
24 geänderte Dateien mit 39 neuen und 75 gelöschten Zeilen

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_NTRULPR653_AVX2_crypto_decode_653x3(void *v, const unsigned char *s
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_NTRULPR653_CLEAN_crypto_decode_653x3(void *v, const unsigned char *
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_NTRULPR761_AVX2_crypto_decode_761x3(void *v, const unsigned char *s
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_NTRULPR761_CLEAN_crypto_decode_761x3(void *v, const unsigned char *
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_NTRULPR857_AVX2_crypto_decode_857x3(void *v, const unsigned char *s
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_NTRULPR857_CLEAN_crypto_decode_857x3(void *v, const unsigned char *
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}

Datei anzeigen

@ -241,7 +241,7 @@ int PQCLEAN_SNTRUP653_AVX2_crypto_core_mult3sntrup653(unsigned char *outbytes, c
mult768(fg, f, g);
fg[0] -= fg[p - 1];
fg[0] = (int16) (fg[0] - fg[p - 1]);
for (i = 0; i < 768; i += 16) {
int16x16 fgi = load_x16(&fg[i]);
int16x16 fgip = load_x16(&fg[i + p]);

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_SNTRUP653_AVX2_crypto_decode_653x3(void *v, const unsigned char *s)
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_SNTRUP653_CLEAN_crypto_decode_653x3(void *v, const unsigned char *s
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}

Datei anzeigen

@ -241,7 +241,7 @@ int PQCLEAN_SNTRUP761_AVX2_crypto_core_mult3sntrup761(unsigned char *outbytes, c
mult768(fg, f, g);
fg[0] -= fg[p - 1];
fg[0] = (int16) (fg[0] - fg[p - 1]);
for (i = 0; i < 768; i += 16) {
int16x16 fgi = load_x16(&fg[i]);
int16x16 fgip = load_x16(&fg[i + p]);

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_SNTRUP761_AVX2_crypto_decode_761x3(void *v, const unsigned char *s)
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_SNTRUP761_CLEAN_crypto_decode_761x3(void *v, const unsigned char *s
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}

Datei anzeigen

@ -278,7 +278,7 @@ int PQCLEAN_SNTRUP857_AVX2_crypto_core_mult3sntrup857(unsigned char *outbytes, c
mult1024(fg, f, g);
fg[0] -= fg[p - 1];
fg[0] = (int16) (fg[0] - fg[p - 1]);
for (i = 0; i < 1024; i += 16) {
int16x16 fgi = load_x16(&fg[i]);
int16x16 fgip = load_x16(&fg[i + p]);

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -61,5 +61,5 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_decode_857x3(void *v, const unsigned char *s)
nextf += 128;
}
*f = ((uint8)(*s & 3)) - 1;
*f = (uint8) ((*s & 3) - 1);
}

Datei anzeigen

@ -29,10 +29,6 @@ static inline __m256i signedshiftrightconst(__m256i x, int16 y) {
return _mm256_srai_epi16(x, y);
}
static inline __m256i addconst(__m256i x, int16 y) {
return add(x, _mm256_set1_epi16(y));
}
static inline __m256i subconst(__m256i x, int16 y) {
return sub(x, _mm256_set1_epi16(y));
}

Datei anzeigen

@ -11,14 +11,14 @@ void PQCLEAN_SNTRUP857_CLEAN_crypto_decode_857x3(void *v, const unsigned char *s
for (i = 0; i < p / 4; ++i) {
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
x >>= 2;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}
x = *s++;
*f++ = ((uint8)(x & 3)) - 1;
*f++ = (uint8) ((x & 3) - 1);
}