mirror of
https://github.com/henrydcase/pqc.git
synced 2024-11-22 23:48:58 +00:00
Fix Windows warnings
This commit is contained in:
parent
f0ba4f2051
commit
ca798ee18a
@ -140,10 +140,10 @@ void PQCLEAN_FRODOKEM640SHAKE_CLEAN_pack(unsigned char *out, const size_t outlen
|
|||||||
while (b < 8) {
|
while (b < 8) {
|
||||||
int nbits = min(8 - b, bits);
|
int nbits = min(8 - b, bits);
|
||||||
uint16_t mask = (1 << nbits) - 1;
|
uint16_t mask = (1 << nbits) - 1;
|
||||||
unsigned char t = (w >> (bits - nbits)) & mask; // the bits to copy from w to out
|
unsigned char t = (unsigned char) ((w >> (bits - nbits)) & mask); // the bits to copy from w to out
|
||||||
out[i] = out[i] + (t << (8 - b - nbits));
|
out[i] = out[i] + (t << (8 - b - nbits));
|
||||||
b += nbits;
|
b += (unsigned char) nbits;
|
||||||
bits -= nbits;
|
bits -= (unsigned char) nbits;
|
||||||
w &= ~(mask << bits); // not strictly necessary; mostly for debugging
|
w &= ~(mask << bits); // not strictly necessary; mostly for debugging
|
||||||
|
|
||||||
if (bits == 0) {
|
if (bits == 0) {
|
||||||
@ -191,8 +191,8 @@ void PQCLEAN_FRODOKEM640SHAKE_CLEAN_unpack(uint16_t *out, const size_t outlen, c
|
|||||||
uint16_t mask = (1 << nbits) - 1;
|
uint16_t mask = (1 << nbits) - 1;
|
||||||
unsigned char t = (w >> (bits - nbits)) & mask; // the bits to copy from w to out
|
unsigned char t = (w >> (bits - nbits)) & mask; // the bits to copy from w to out
|
||||||
out[i] = out[i] + (t << (lsb - b - nbits));
|
out[i] = out[i] + (t << (lsb - b - nbits));
|
||||||
b += nbits;
|
b += (unsigned char) nbits;
|
||||||
bits -= nbits;
|
bits -= (unsigned char) nbits;
|
||||||
w &= ~(mask << bits); // not strictly necessary; mostly for debugging
|
w &= ~(mask << bits); // not strictly necessary; mostly for debugging
|
||||||
|
|
||||||
if (bits == 0) {
|
if (bits == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user