From 1a402a19177f547a63eab5b5d9beb3935f09433f Mon Sep 17 00:00:00 2001 From: "John M. Schanck" Date: Wed, 2 Sep 2020 13:01:19 -0400 Subject: [PATCH] NTRU Prime: satisfy linter --- crypto_kem/ntrulpr653/clean/crypto_sort_int32.c | 4 +++- crypto_kem/ntrulpr761/clean/crypto_sort_int32.c | 4 +++- crypto_kem/ntrulpr857/clean/crypto_sort_int32.c | 4 +++- crypto_kem/sntrup653/clean/crypto_sort_int32.c | 4 +++- crypto_kem/sntrup761/clean/crypto_sort_int32.c | 4 +++- crypto_kem/sntrup857/clean/crypto_sort_int32.c | 4 +++- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/crypto_kem/ntrulpr653/clean/crypto_sort_int32.c b/crypto_kem/ntrulpr653/clean/crypto_sort_int32.c index 3993bcbe..275d8e06 100644 --- a/crypto_kem/ntrulpr653/clean/crypto_sort_int32.c +++ b/crypto_kem/ntrulpr653/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p]; diff --git a/crypto_kem/ntrulpr761/clean/crypto_sort_int32.c b/crypto_kem/ntrulpr761/clean/crypto_sort_int32.c index 08e2eb50..e74691c2 100644 --- a/crypto_kem/ntrulpr761/clean/crypto_sort_int32.c +++ b/crypto_kem/ntrulpr761/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p]; diff --git a/crypto_kem/ntrulpr857/clean/crypto_sort_int32.c b/crypto_kem/ntrulpr857/clean/crypto_sort_int32.c index 5a945a3a..8035057e 100644 --- a/crypto_kem/ntrulpr857/clean/crypto_sort_int32.c +++ b/crypto_kem/ntrulpr857/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p]; diff --git a/crypto_kem/sntrup653/clean/crypto_sort_int32.c b/crypto_kem/sntrup653/clean/crypto_sort_int32.c index 6eaffe1a..9d561f78 100644 --- a/crypto_kem/sntrup653/clean/crypto_sort_int32.c +++ b/crypto_kem/sntrup653/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p]; diff --git a/crypto_kem/sntrup761/clean/crypto_sort_int32.c b/crypto_kem/sntrup761/clean/crypto_sort_int32.c index 68b5fb81..f0c3b41d 100644 --- a/crypto_kem/sntrup761/clean/crypto_sort_int32.c +++ b/crypto_kem/sntrup761/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p]; diff --git a/crypto_kem/sntrup857/clean/crypto_sort_int32.c b/crypto_kem/sntrup857/clean/crypto_sort_int32.c index acda3aeb..a00ea032 100644 --- a/crypto_kem/sntrup857/clean/crypto_sort_int32.c +++ b/crypto_kem/sntrup857/clean/crypto_sort_int32.c @@ -38,7 +38,8 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { i = 0; j = 0; for (q = top; q > p; q >>= 1) { - if (j != i) for (;;) { + if (j != i) { + for (;;) { if (j == n - q) { goto done; } @@ -53,6 +54,7 @@ static void crypto_sort_smallindices(int32 *x, int32 n) { break; } } + } while (i + p <= n - q) { for (j = i; j < i + p; ++j) { int32 a = x[j + p];