1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 07:35:38 +00:00

NTRU Prime: avoid narrowing in loop iteration

This commit is contained in:
John M. Schanck 2020-09-02 17:30:26 -04:00 committed by Kris Kwiatkowski
parent 4971f4a4b0
commit 6047ae532a
6 changed files with 12 additions and 6 deletions

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR653_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR761_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_NTRULPR857_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP653_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP761_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {

View File

@ -16,7 +16,8 @@
/* assume 2 <= n <= 0x40000000 */ /* assume 2 <= n <= 0x40000000 */
void PQCLEAN_SNTRUP857_CLEAN_crypto_sort_int32(int32_t *x, long long n) { 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; top = 1;
while (top < n - top) { while (top < n - top) {