From 3494c96e5369ad69382408fb2b0d93e02fde6c55 Mon Sep 17 00:00:00 2001 From: Douglas Stebila Date: Sun, 5 May 2019 18:33:34 -0400 Subject: [PATCH] Update to latest changes from upstream, fix correctness on MS Visual Studio (#163) --- crypto_kem/frodokem1344aes/META.yml | 2 +- crypto_kem/frodokem1344aes/clean/noise.c | 4 ++-- crypto_kem/frodokem1344shake/META.yml | 2 +- crypto_kem/frodokem1344shake/clean/noise.c | 4 ++-- crypto_kem/frodokem640aes/META.yml | 2 +- crypto_kem/frodokem640aes/clean/noise.c | 4 ++-- crypto_kem/frodokem640shake/META.yml | 2 +- crypto_kem/frodokem640shake/clean/noise.c | 4 ++-- crypto_kem/frodokem976aes/META.yml | 2 +- crypto_kem/frodokem976aes/clean/noise.c | 4 ++-- crypto_kem/frodokem976shake/META.yml | 2 +- crypto_kem/frodokem976shake/clean/noise.c | 4 ++-- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crypto_kem/frodokem1344aes/META.yml b/crypto_kem/frodokem1344aes/META.yml index 42d24a2c..cd6b1991 100644 --- a/crypto_kem/frodokem1344aes/META.yml +++ b/crypto_kem/frodokem1344aes/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem1344aes/clean/noise.c b/crypto_kem/frodokem1344aes/clean/noise.c index 159506d8..9205c905 100644 --- a/crypto_kem/frodokem1344aes/clean/noise.c +++ b/crypto_kem/frodokem1344aes/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM1344AES_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) { diff --git a/crypto_kem/frodokem1344shake/META.yml b/crypto_kem/frodokem1344shake/META.yml index b047dc51..5048603b 100644 --- a/crypto_kem/frodokem1344shake/META.yml +++ b/crypto_kem/frodokem1344shake/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem1344shake/clean/noise.c b/crypto_kem/frodokem1344shake/clean/noise.c index a49dfc17..289d7aa3 100644 --- a/crypto_kem/frodokem1344shake/clean/noise.c +++ b/crypto_kem/frodokem1344shake/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM1344SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) { diff --git a/crypto_kem/frodokem640aes/META.yml b/crypto_kem/frodokem640aes/META.yml index 154cb2eb..44861a47 100644 --- a/crypto_kem/frodokem640aes/META.yml +++ b/crypto_kem/frodokem640aes/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem640aes/clean/noise.c b/crypto_kem/frodokem640aes/clean/noise.c index 21ffcad8..44cd51be 100644 --- a/crypto_kem/frodokem640aes/clean/noise.c +++ b/crypto_kem/frodokem640aes/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM640AES_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) { diff --git a/crypto_kem/frodokem640shake/META.yml b/crypto_kem/frodokem640shake/META.yml index 6a3c7b40..db07a8c7 100644 --- a/crypto_kem/frodokem640shake/META.yml +++ b/crypto_kem/frodokem640shake/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem640shake/clean/noise.c b/crypto_kem/frodokem640shake/clean/noise.c index 9926a787..32b6938d 100644 --- a/crypto_kem/frodokem640shake/clean/noise.c +++ b/crypto_kem/frodokem640shake/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM640SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) { diff --git a/crypto_kem/frodokem976aes/META.yml b/crypto_kem/frodokem976aes/META.yml index f1eede08..0f4d5dd0 100644 --- a/crypto_kem/frodokem976aes/META.yml +++ b/crypto_kem/frodokem976aes/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem976aes/clean/noise.c b/crypto_kem/frodokem976aes/clean/noise.c index 6fdc30f6..8796e4d4 100644 --- a/crypto_kem/frodokem976aes/clean/noise.c +++ b/crypto_kem/frodokem976aes/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM976AES_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) { diff --git a/crypto_kem/frodokem976shake/META.yml b/crypto_kem/frodokem976shake/META.yml index 11f8acce..181043a8 100644 --- a/crypto_kem/frodokem976shake/META.yml +++ b/crypto_kem/frodokem976shake/META.yml @@ -21,4 +21,4 @@ auxiliary-submitters: - Brian LaMacchia, Microsoft Research implementations: - name: clean - version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/437e228fca580a82435cab09f30ae14b03183119 + version: https://github.com/Microsoft/PQCrypto-LWEKE/commit/d5bbd0417ba111b08a959c0042a1dcc65fb14a89 diff --git a/crypto_kem/frodokem976shake/clean/noise.c b/crypto_kem/frodokem976shake/clean/noise.c index c13b4cad..e23892c8 100644 --- a/crypto_kem/frodokem976shake/clean/noise.c +++ b/crypto_kem/frodokem976shake/clean/noise.c @@ -20,9 +20,9 @@ void PQCLEAN_FRODOKEM976SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { unsigned int j; for (i = 0; i < n; ++i) { - uint8_t sample = 0; + uint16_t sample = 0; uint16_t prnd = s[i] >> 1; // Drop the least significant bit - uint8_t sign = s[i] & 0x1; // Pick the least significant bit + uint16_t sign = s[i] & 0x1; // Pick the least significant bit // No need to compare with the last value. for (j = 0; j < (unsigned int)(CDF_TABLE_LEN - 1); j++) {