diff --git a/src/kem/frodokem/pqclean_frodokem1344aes_clean/noise.c b/src/kem/frodokem/pqclean_frodokem1344aes_clean/noise.c index d83162bcf..9205c9052 100644 --- a/src/kem/frodokem/pqclean_frodokem1344aes_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem1344aes_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM1344AES_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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/src/kem/frodokem/pqclean_frodokem1344shake_clean/noise.c b/src/kem/frodokem/pqclean_frodokem1344shake_clean/noise.c index decce08a2..289d7aa36 100644 --- a/src/kem/frodokem/pqclean_frodokem1344shake_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem1344shake_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM1344SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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/src/kem/frodokem/pqclean_frodokem640aes_clean/noise.c b/src/kem/frodokem/pqclean_frodokem640aes_clean/noise.c index 2221219e0..44cd51be1 100644 --- a/src/kem/frodokem/pqclean_frodokem640aes_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem640aes_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM640AES_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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/src/kem/frodokem/pqclean_frodokem640shake_clean/noise.c b/src/kem/frodokem/pqclean_frodokem640shake_clean/noise.c index 08c975d5e..32b6938d8 100644 --- a/src/kem/frodokem/pqclean_frodokem640shake_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem640shake_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM640SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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/src/kem/frodokem/pqclean_frodokem976aes_clean/noise.c b/src/kem/frodokem/pqclean_frodokem976aes_clean/noise.c index 45d868edc..8796e4d40 100644 --- a/src/kem/frodokem/pqclean_frodokem976aes_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem976aes_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM976AES_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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/src/kem/frodokem/pqclean_frodokem976shake_clean/noise.c b/src/kem/frodokem/pqclean_frodokem976shake_clean/noise.c index b2b4f2dc9..e23892c84 100644 --- a/src/kem/frodokem/pqclean_frodokem976shake_clean/noise.c +++ b/src/kem/frodokem/pqclean_frodokem976shake_clean/noise.c @@ -16,12 +16,13 @@ void PQCLEAN_FRODOKEM976SHAKE_CLEAN_sample_n(uint16_t *s, size_t n) { // Fills vector s with n samples from the noise distribution which requires 16 bits to sample. // The distribution is specified by its CDF. // Input: pseudo-random values (2*n bytes) passed in s. The input is overwritten by the output. - unsigned int i, j; + size_t i; + 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++) {