Browse Source

NTRU Prime: More changes for MS compiler

kyber
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
09d3f1e1e6
40 changed files with 52 additions and 52 deletions
  1. +1
    -1
      crypto_kem/ntrulpr653/avx2/crypto_encode_653x1541.c
  2. +1
    -1
      crypto_kem/ntrulpr653/avx2/crypto_encode_653x1541round.c
  3. +1
    -1
      crypto_kem/ntrulpr653/avx2/kem.c
  4. +1
    -1
      crypto_kem/ntrulpr653/clean/crypto_decode_653x1541.c
  5. +1
    -1
      crypto_kem/ntrulpr653/clean/crypto_encode_653x1541.c
  6. +1
    -1
      crypto_kem/ntrulpr653/clean/kem.c
  7. +1
    -1
      crypto_kem/ntrulpr761/avx2/crypto_encode_761x1531.c
  8. +1
    -1
      crypto_kem/ntrulpr761/avx2/crypto_encode_761x1531round.c
  9. +1
    -1
      crypto_kem/ntrulpr761/avx2/kem.c
  10. +1
    -1
      crypto_kem/ntrulpr761/clean/crypto_decode_761x1531.c
  11. +1
    -1
      crypto_kem/ntrulpr761/clean/crypto_encode_761x1531.c
  12. +1
    -1
      crypto_kem/ntrulpr761/clean/kem.c
  13. +1
    -1
      crypto_kem/ntrulpr857/avx2/crypto_encode_857x1723.c
  14. +1
    -1
      crypto_kem/ntrulpr857/avx2/crypto_encode_857x1723round.c
  15. +1
    -1
      crypto_kem/ntrulpr857/avx2/kem.c
  16. +1
    -1
      crypto_kem/ntrulpr857/clean/crypto_decode_857x1723.c
  17. +1
    -1
      crypto_kem/ntrulpr857/clean/crypto_encode_857x1723.c
  18. +1
    -1
      crypto_kem/ntrulpr857/clean/kem.c
  19. +1
    -1
      crypto_kem/sntrup653/avx2/crypto_encode_653x1541.c
  20. +1
    -1
      crypto_kem/sntrup653/avx2/crypto_encode_653x1541round.c
  21. +2
    -2
      crypto_kem/sntrup653/avx2/crypto_encode_653x4621.c
  22. +1
    -1
      crypto_kem/sntrup653/clean/crypto_decode_653x1541.c
  23. +1
    -1
      crypto_kem/sntrup653/clean/crypto_decode_653x4621.c
  24. +1
    -1
      crypto_kem/sntrup653/clean/crypto_encode_653x1541.c
  25. +4
    -4
      crypto_kem/sntrup653/clean/crypto_encode_653x4621.c
  26. +1
    -1
      crypto_kem/sntrup761/avx2/crypto_encode_761x1531.c
  27. +1
    -1
      crypto_kem/sntrup761/avx2/crypto_encode_761x1531round.c
  28. +2
    -2
      crypto_kem/sntrup761/avx2/crypto_encode_761x4591.c
  29. +1
    -1
      crypto_kem/sntrup761/clean/crypto_decode_761x1531.c
  30. +1
    -1
      crypto_kem/sntrup761/clean/crypto_decode_761x4591.c
  31. +1
    -1
      crypto_kem/sntrup761/clean/crypto_encode_761x1531.c
  32. +4
    -4
      crypto_kem/sntrup761/clean/crypto_encode_761x4591.c
  33. +1
    -1
      crypto_kem/sntrup857/avx2/crypto_decode_857x5167.c
  34. +1
    -1
      crypto_kem/sntrup857/avx2/crypto_encode_857x1723.c
  35. +1
    -1
      crypto_kem/sntrup857/avx2/crypto_encode_857x1723round.c
  36. +2
    -2
      crypto_kem/sntrup857/avx2/crypto_encode_857x5167.c
  37. +1
    -1
      crypto_kem/sntrup857/clean/crypto_decode_857x1723.c
  38. +1
    -1
      crypto_kem/sntrup857/clean/crypto_decode_857x5167.c
  39. +1
    -1
      crypto_kem/sntrup857/clean/crypto_encode_857x1723.c
  40. +4
    -4
      crypto_kem/sntrup857/clean/crypto_encode_857x5167.c

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

@@ -282,5 +282,5 @@ void PQCLEAN_NTRULPR653_AVX2_crypto_encode_653x1541(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -284,5 +284,5 @@ void PQCLEAN_NTRULPR653_AVX2_crypto_encode_653x1541round(unsigned char *out, con
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



+ 1
- 1
crypto_kem/ntrulpr653/clean/crypto_decode_653x1541.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/ntrulpr653/clean/crypto_encode_653x1541.c View File

@@ -123,5 +123,5 @@ void PQCLEAN_NTRULPR653_CLEAN_crypto_encode_653x1541(unsigned char *out, const v
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/ntrulpr653/clean/kem.c View File

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



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

@@ -297,5 +297,5 @@ void PQCLEAN_NTRULPR761_AVX2_crypto_encode_761x1531(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -299,5 +299,5 @@ void PQCLEAN_NTRULPR761_AVX2_crypto_encode_761x1531round(unsigned char *out, con
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



+ 1
- 1
crypto_kem/ntrulpr761/clean/crypto_decode_761x1531.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/ntrulpr761/clean/crypto_encode_761x1531.c View File

@@ -115,5 +115,5 @@ void PQCLEAN_NTRULPR761_CLEAN_crypto_encode_761x1531(unsigned char *out, const v
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/ntrulpr761/clean/kem.c View File

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



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

@@ -279,5 +279,5 @@ void PQCLEAN_NTRULPR857_AVX2_crypto_encode_857x1723(unsigned char *out, const vo
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -281,5 +281,5 @@ void PQCLEAN_NTRULPR857_AVX2_crypto_encode_857x1723round(unsigned char *out, con
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



+ 1
- 1
crypto_kem/ntrulpr857/clean/crypto_decode_857x1723.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/ntrulpr857/clean/crypto_encode_857x1723.c View File

@@ -126,5 +126,5 @@ void PQCLEAN_NTRULPR857_CLEAN_crypto_encode_857x1723(unsigned char *out, const v
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/ntrulpr857/clean/kem.c View File

@@ -48,7 +48,7 @@ static Fq Fq_bigfreeze(uint32 x) {
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= (uint32) (q * ((x * (uint64)q31) >> 31));
x -= q;
x += (-(x >> 31)) & (uint32)q;
x += (~(x >> 31) + 1) & (uint32)q;
return (Fq) x;
}



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

@@ -282,5 +282,5 @@ void PQCLEAN_SNTRUP653_AVX2_crypto_encode_653x1541(unsigned char *out, const voi
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -284,5 +284,5 @@ void PQCLEAN_SNTRUP653_AVX2_crypto_encode_653x1541round(unsigned char *out, cons
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 2
- 2
crypto_kem/sntrup653/avx2/crypto_encode_653x4621.c View File

@@ -58,7 +58,7 @@ void PQCLEAN_SNTRUP653_AVX2_crypto_encode_653x4621(unsigned char *out, const voi
writing += 16;
out += 32;
}
R[326] = ((R0[652] + 2310) & 16383);
R[326] = (uint16) (((R0[652] + 2310) & 16383));

reading = (uint16 *) R;
writing = R;
@@ -284,5 +284,5 @@ void PQCLEAN_SNTRUP653_AVX2_crypto_encode_653x4621(unsigned char *out, const voi
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/sntrup653/clean/crypto_decode_653x1541.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup653/clean/crypto_decode_653x4621.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup653/clean/crypto_encode_653x1541.c View File

@@ -123,5 +123,5 @@ void PQCLEAN_SNTRUP653_CLEAN_crypto_encode_653x1541(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 4
- 4
crypto_kem/sntrup653/clean/crypto_encode_653x4621.c View File

@@ -15,8 +15,8 @@ void PQCLEAN_SNTRUP653_CLEAN_crypto_encode_653x4621(unsigned char *out, const vo
uint32 r2;

for (i = 0; i < 326; ++i) {
r0 = (R0[2 * i] + 2310) & 16383;
r1 = (R0[2 * i + 1] + 2310) & 16383;
r0 = (uint16) ((R0[2 * i] + 2310) & 16383);
r1 = (uint16) ((R0[2 * i + 1] + 2310) & 16383);
r2 = r0 + r1 * (uint32)4621;
*out++ = (unsigned char) r2;
r2 >>= 8;
@@ -24,7 +24,7 @@ void PQCLEAN_SNTRUP653_CLEAN_crypto_encode_653x4621(unsigned char *out, const vo
r2 >>= 8;
R[i] = (uint16) r2;
}
R[326] = (R0[652] + 2310) & 16383;
R[326] = (uint16) ((R0[652] + 2310) & 16383);

for (i = 0; i < 163; ++i) {
r0 = R[2 * i];
@@ -123,5 +123,5 @@ void PQCLEAN_SNTRUP653_CLEAN_crypto_encode_653x4621(unsigned char *out, const vo
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -297,5 +297,5 @@ void PQCLEAN_SNTRUP761_AVX2_crypto_encode_761x1531(unsigned char *out, const voi
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -299,5 +299,5 @@ void PQCLEAN_SNTRUP761_AVX2_crypto_encode_761x1531round(unsigned char *out, cons
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 2
- 2
crypto_kem/sntrup761/avx2/crypto_encode_761x4591.c View File

@@ -58,7 +58,7 @@ void PQCLEAN_SNTRUP761_AVX2_crypto_encode_761x4591(unsigned char *out, const voi
writing += 16;
out += 32;
}
R[380] = ((R0[760] + 2295) & 16383);
R[380] = (uint16) (((R0[760] + 2295) & 16383));

reading = (uint16 *) R;
writing = R;
@@ -304,5 +304,5 @@ void PQCLEAN_SNTRUP761_AVX2_crypto_encode_761x4591(unsigned char *out, const voi
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/sntrup761/clean/crypto_decode_761x1531.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup761/clean/crypto_decode_761x4591.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup761/clean/crypto_encode_761x1531.c View File

@@ -115,5 +115,5 @@ void PQCLEAN_SNTRUP761_CLEAN_crypto_encode_761x1531(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 4
- 4
crypto_kem/sntrup761/clean/crypto_encode_761x4591.c View File

@@ -15,8 +15,8 @@ void PQCLEAN_SNTRUP761_CLEAN_crypto_encode_761x4591(unsigned char *out, const vo
uint32 r2;

for (i = 0; i < 380; ++i) {
r0 = (R0[2 * i] + 2295) & 16383;
r1 = (R0[2 * i + 1] + 2295) & 16383;
r0 = (uint16) ((R0[2 * i] + 2295) & 16383);
r1 = (uint16) ((R0[2 * i + 1] + 2295) & 16383);
r2 = r0 + r1 * (uint32)4591;
*out++ = (unsigned char) r2;
r2 >>= 8;
@@ -24,7 +24,7 @@ void PQCLEAN_SNTRUP761_CLEAN_crypto_encode_761x4591(unsigned char *out, const vo
r2 >>= 8;
R[i] = (uint16) r2;
}
R[380] = (R0[760] + 2295) & 16383;
R[380] = (uint16) ((R0[760] + 2295) & 16383);

for (i = 0; i < 190; ++i) {
r0 = R[2 * i];
@@ -143,5 +143,5 @@ void PQCLEAN_SNTRUP761_CLEAN_crypto_encode_761x4591(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -112,7 +112,7 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_decode_857x5167(void *v, const unsigned char
a2 = a0 = R9[i];
a0 = mulhi(a0, -28) - mulhi(mullo(a0, -886), 74); /* -44...37 */
a0 += (a0 >> 15) & 74; /* 0...73 */
a1 = (int16) (a2 - a0) >> 1;
a1 = (int16) ((a2 - a0) >> 1);
a1 = mullo(a1, 7085);

/* invalid inputs might need reduction mod 74 */


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

@@ -279,5 +279,5 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_encode_857x1723(unsigned char *out, const voi
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

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

@@ -281,5 +281,5 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_encode_857x1723round(unsigned char *out, cons
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 2
- 2
crypto_kem/sntrup857/avx2/crypto_encode_857x5167.c View File

@@ -58,7 +58,7 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_encode_857x5167(unsigned char *out, const voi
writing += 16;
out += 32;
}
R[428] = ((R0[856] + 2583) & 16383);
R[428] = (uint16) (((R0[856] + 2583) & 16383));

reading = (uint16 *) R;
writing = R;
@@ -327,5 +327,5 @@ void PQCLEAN_SNTRUP857_AVX2_crypto_encode_857x5167(unsigned char *out, const voi
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 1
- 1
crypto_kem/sntrup857/clean/crypto_decode_857x1723.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup857/clean/crypto_decode_857x5167.c View File

@@ -54,7 +54,7 @@ static void uint32_divmod_uint14(uint32 *q, uint16 *r, uint32 x, uint16 m) {

x -= m;
*q += 1;
mask = -(x >> 31);
mask = (~(x >> 31) + 1);
x += mask & (uint32)m;
*q += mask;
/* x < m */


+ 1
- 1
crypto_kem/sntrup857/clean/crypto_encode_857x1723.c View File

@@ -126,5 +126,5 @@ void PQCLEAN_SNTRUP857_CLEAN_crypto_encode_857x1723(unsigned char *out, const vo
R[0] = (uint16) r2;

r0 = R[0];
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

+ 4
- 4
crypto_kem/sntrup857/clean/crypto_encode_857x5167.c View File

@@ -15,8 +15,8 @@ void PQCLEAN_SNTRUP857_CLEAN_crypto_encode_857x5167(unsigned char *out, const vo
uint32 r2;

for (i = 0; i < 428; ++i) {
r0 = (R0[2 * i] + 2583) & 16383;
r1 = (R0[2 * i + 1] + 2583) & 16383;
r0 = (uint16) ((R0[2 * i] + 2583) & 16383);
r1 = (uint16) ((R0[2 * i + 1] + 2583) & 16383);
r2 = r0 + r1 * (uint32)5167;
*out++ = (unsigned char) r2;
r2 >>= 8;
@@ -24,7 +24,7 @@ void PQCLEAN_SNTRUP857_CLEAN_crypto_encode_857x5167(unsigned char *out, const vo
r2 >>= 8;
R[i] = (uint16) r2;
}
R[428] = (R0[856] + 2583) & 16383;
R[428] = (uint16) ((R0[856] + 2583) & 16383);

for (i = 0; i < 214; ++i) {
r0 = R[2 * i];
@@ -134,5 +134,5 @@ void PQCLEAN_SNTRUP857_CLEAN_crypto_encode_857x5167(unsigned char *out, const vo
r0 = R[0];
*out++ = (unsigned char) r0;
r0 >>= 8;
*out++ = (unsigned char) r0; /*clang-analyzer-deadcode.DeadStores*/ /*r0 >>= 8;*/
*out++ = (unsigned char) r0;
}

Loading…
Cancel
Save