Browse Source

NTRU Prime: avoid narrowing in loop iteration

kyber
John M. Schanck 4 years ago
committed by Kris Kwiatkowski
parent
commit
6047ae532a
6 changed files with 12 additions and 6 deletions
  1. +2
    -1
      crypto_kem/ntrulpr653/clean/crypto_sort_int32.c
  2. +2
    -1
      crypto_kem/ntrulpr761/clean/crypto_sort_int32.c
  3. +2
    -1
      crypto_kem/ntrulpr857/clean/crypto_sort_int32.c
  4. +2
    -1
      crypto_kem/sntrup653/clean/crypto_sort_int32.c
  5. +2
    -1
      crypto_kem/sntrup761/clean/crypto_sort_int32.c
  6. +2
    -1
      crypto_kem/sntrup857/clean/crypto_sort_int32.c

+ 2
- 1
crypto_kem/ntrulpr653/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR653_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


+ 2
- 1
crypto_kem/ntrulpr761/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR761_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


+ 2
- 1
crypto_kem/ntrulpr857/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR857_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


+ 2
- 1
crypto_kem/sntrup653/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP653_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


+ 2
- 1
crypto_kem/sntrup761/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP761_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


+ 2
- 1
crypto_kem/sntrup857/clean/crypto_sort_int32.c View File

@@ -16,7 +16,8 @@

/* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP857_CLEAN_crypto_sort_int32(int32_t *x, long long n) {
int32 top, p, q, r, i, j;
int32 top, p, q, r, i;
long long j;

top = 1;
while (top < n - top) {


Loading…
Cancel
Save