Browse Source

NTRU Prime: more compiler warnings

tags/v0.0.1
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
191aed977f
24 changed files with 39 additions and 75 deletions
  1. +0
    -4
      crypto_kem/ntrulpr653/avx2/crypto_decode_653x1541.c
  2. +1
    -1
      crypto_kem/ntrulpr653/avx2/crypto_decode_653x3.c
  3. +5
    -5
      crypto_kem/ntrulpr653/clean/crypto_decode_653x3.c
  4. +0
    -4
      crypto_kem/ntrulpr761/avx2/crypto_decode_761x1531.c
  5. +1
    -1
      crypto_kem/ntrulpr761/avx2/crypto_decode_761x3.c
  6. +5
    -5
      crypto_kem/ntrulpr761/clean/crypto_decode_761x3.c
  7. +0
    -4
      crypto_kem/ntrulpr857/avx2/crypto_decode_857x1723.c
  8. +1
    -1
      crypto_kem/ntrulpr857/avx2/crypto_decode_857x3.c
  9. +5
    -5
      crypto_kem/ntrulpr857/clean/crypto_decode_857x3.c
  10. +1
    -1
      crypto_kem/sntrup653/avx2/crypto_core_mult3sntrup653.c
  11. +0
    -4
      crypto_kem/sntrup653/avx2/crypto_decode_653x1541.c
  12. +1
    -1
      crypto_kem/sntrup653/avx2/crypto_decode_653x3.c
  13. +0
    -4
      crypto_kem/sntrup653/avx2/crypto_decode_653x4621.c
  14. +5
    -5
      crypto_kem/sntrup653/clean/crypto_decode_653x3.c
  15. +1
    -1
      crypto_kem/sntrup761/avx2/crypto_core_mult3sntrup761.c
  16. +0
    -4
      crypto_kem/sntrup761/avx2/crypto_decode_761x1531.c
  17. +1
    -1
      crypto_kem/sntrup761/avx2/crypto_decode_761x3.c
  18. +0
    -4
      crypto_kem/sntrup761/avx2/crypto_decode_761x4591.c
  19. +5
    -5
      crypto_kem/sntrup761/clean/crypto_decode_761x3.c
  20. +1
    -1
      crypto_kem/sntrup857/avx2/crypto_core_mult3sntrup857.c
  21. +0
    -4
      crypto_kem/sntrup857/avx2/crypto_decode_857x1723.c
  22. +1
    -1
      crypto_kem/sntrup857/avx2/crypto_decode_857x3.c
  23. +0
    -4
      crypto_kem/sntrup857/avx2/crypto_decode_857x5167.c
  24. +5
    -5
      crypto_kem/sntrup857/clean/crypto_decode_857x3.c

+ 0
- 4
crypto_kem/ntrulpr653/avx2/crypto_decode_653x1541.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/ntrulpr653/avx2/crypto_decode_653x3.c View File

@@ -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);
}

+ 5
- 5
crypto_kem/ntrulpr653/clean/crypto_decode_653x3.c View File

@@ -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);
}

+ 0
- 4
crypto_kem/ntrulpr761/avx2/crypto_decode_761x1531.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/ntrulpr761/avx2/crypto_decode_761x3.c View File

@@ -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);
}

+ 5
- 5
crypto_kem/ntrulpr761/clean/crypto_decode_761x3.c View File

@@ -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);
}

+ 0
- 4
crypto_kem/ntrulpr857/avx2/crypto_decode_857x1723.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/ntrulpr857/avx2/crypto_decode_857x3.c View File

@@ -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);
}

+ 5
- 5
crypto_kem/ntrulpr857/clean/crypto_decode_857x3.c View File

@@ -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);
}

+ 1
- 1
crypto_kem/sntrup653/avx2/crypto_core_mult3sntrup653.c View File

@@ -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]);


+ 0
- 4
crypto_kem/sntrup653/avx2/crypto_decode_653x1541.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/sntrup653/avx2/crypto_decode_653x3.c View File

@@ -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);
}

+ 0
- 4
crypto_kem/sntrup653/avx2/crypto_decode_653x4621.c View File

@@ -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));
}


+ 5
- 5
crypto_kem/sntrup653/clean/crypto_decode_653x3.c View File

@@ -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);
}

+ 1
- 1
crypto_kem/sntrup761/avx2/crypto_core_mult3sntrup761.c View File

@@ -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]);


+ 0
- 4
crypto_kem/sntrup761/avx2/crypto_decode_761x1531.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/sntrup761/avx2/crypto_decode_761x3.c View File

@@ -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);
}

+ 0
- 4
crypto_kem/sntrup761/avx2/crypto_decode_761x4591.c View File

@@ -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));
}


+ 5
- 5
crypto_kem/sntrup761/clean/crypto_decode_761x3.c View File

@@ -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);
}

+ 1
- 1
crypto_kem/sntrup857/avx2/crypto_core_mult3sntrup857.c View File

@@ -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]);


+ 0
- 4
crypto_kem/sntrup857/avx2/crypto_decode_857x1723.c View File

@@ -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));
}


+ 1
- 1
crypto_kem/sntrup857/avx2/crypto_decode_857x3.c View File

@@ -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);
}

+ 0
- 4
crypto_kem/sntrup857/avx2/crypto_decode_857x5167.c View File

@@ -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));
}


+ 5
- 5
crypto_kem/sntrup857/clean/crypto_decode_857x3.c View File

@@ -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);
}

Loading…
Cancel
Save