From 999b76cb90e5bfc91082bc78fa7fc15ffdbfeb72 Mon Sep 17 00:00:00 2001 From: "Matthias J. Kannwischer" Date: Thu, 5 Mar 2020 11:31:28 +0100 Subject: [PATCH] fix MSVS warning --- crypto_kem/newhope1024cca/clean/verify.c | 2 +- crypto_kem/newhope1024cpa/clean/verify.c | 2 +- crypto_kem/newhope512cca/clean/verify.c | 2 +- crypto_kem/newhope512cpa/clean/verify.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto_kem/newhope1024cca/clean/verify.c b/crypto_kem/newhope1024cca/clean/verify.c index f2930ec0..f68c9328 100644 --- a/crypto_kem/newhope1024cca/clean/verify.c +++ b/crypto_kem/newhope1024cca/clean/verify.c @@ -22,7 +22,7 @@ int PQCLEAN_NEWHOPE1024CCA_CLEAN_verify(const unsigned char *a, const unsigned c r |= a[i] ^ b[i]; } - r = (-r) >> 63; + r = (uint64_t)(-(int64_t)r) >> 63; return (int)r; } diff --git a/crypto_kem/newhope1024cpa/clean/verify.c b/crypto_kem/newhope1024cpa/clean/verify.c index 3cf20833..677e3ae9 100644 --- a/crypto_kem/newhope1024cpa/clean/verify.c +++ b/crypto_kem/newhope1024cpa/clean/verify.c @@ -22,7 +22,7 @@ int PQCLEAN_NEWHOPE1024CPA_CLEAN_verify(const unsigned char *a, const unsigned c r |= a[i] ^ b[i]; } - r = (-r) >> 63; + r = (uint64_t)(-(int64_t)r) >> 63; return (int)r; } diff --git a/crypto_kem/newhope512cca/clean/verify.c b/crypto_kem/newhope512cca/clean/verify.c index 96694524..37e65f94 100644 --- a/crypto_kem/newhope512cca/clean/verify.c +++ b/crypto_kem/newhope512cca/clean/verify.c @@ -22,7 +22,7 @@ int PQCLEAN_NEWHOPE512CCA_CLEAN_verify(const unsigned char *a, const unsigned ch r |= a[i] ^ b[i]; } - r = (-r) >> 63; + r = (uint64_t)(-(int64_t)r) >> 63; return (int)r; } diff --git a/crypto_kem/newhope512cpa/clean/verify.c b/crypto_kem/newhope512cpa/clean/verify.c index 471f052b..a03cf862 100644 --- a/crypto_kem/newhope512cpa/clean/verify.c +++ b/crypto_kem/newhope512cpa/clean/verify.c @@ -22,7 +22,7 @@ int PQCLEAN_NEWHOPE512CPA_CLEAN_verify(const unsigned char *a, const unsigned ch r |= a[i] ^ b[i]; } - r = (-r) >> 63; + r = (uint64_t)(-(int64_t)r) >> 63; return (int)r; }