From 85de23bdfe5ba9b04b1025c71dcd5bec6d3e5354 Mon Sep 17 00:00:00 2001 From: Thom Wiggers Date: Fri, 13 Mar 2020 13:27:02 -0400 Subject: [PATCH] Fix too-large shift in mceliece*f --- crypto_kem/mceliece348864f/vec/pk_gen.c | 2 +- crypto_kem/mceliece460896f/vec/pk_gen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto_kem/mceliece348864f/vec/pk_gen.c b/crypto_kem/mceliece348864f/vec/pk_gen.c index b47c27a5..314a809c 100644 --- a/crypto_kem/mceliece348864f/vec/pk_gen.c +++ b/crypto_kem/mceliece348864f/vec/pk_gen.c @@ -57,7 +57,7 @@ static inline int ctz(uint64_t in) { int i, b, m = 0, r = 0; for (i = 0; i < 64; i++) { - b = ((int)in >> i) & 1; + b = ((int)(in >> i)) & 1; m |= b; r += (m ^ 1) & (b ^ 1); } diff --git a/crypto_kem/mceliece460896f/vec/pk_gen.c b/crypto_kem/mceliece460896f/vec/pk_gen.c index 7aa02221..5b1bb6cb 100644 --- a/crypto_kem/mceliece460896f/vec/pk_gen.c +++ b/crypto_kem/mceliece460896f/vec/pk_gen.c @@ -57,7 +57,7 @@ static inline int ctz(uint64_t in) { int i, b, m = 0, r = 0; for (i = 0; i < 64; i++) { - b = ((int)in >> i) & 1; + b = ((int)(in >> i)) & 1; m |= b; r += (m ^ 1) & (b ^ 1); }