diff --git a/crypto_kem/hqc-128/avx2/kem.c b/crypto_kem/hqc-128/avx2/kem.c index d10fa308..e70f0952 100644 --- a/crypto_kem/hqc-128/avx2/kem.c +++ b/crypto_kem/hqc-128/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQC128_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned char *c } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-128/clean/kem.c b/crypto_kem/hqc-128/clean/kem.c index 1444bff7..76173dc2 100644 --- a/crypto_kem/hqc-128/clean/kem.c +++ b/crypto_kem/hqc-128/clean/kem.c @@ -140,5 +140,5 @@ int PQCLEAN_HQC128_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned char * } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-192/avx2/kem.c b/crypto_kem/hqc-192/avx2/kem.c index 243a2e60..4807780e 100644 --- a/crypto_kem/hqc-192/avx2/kem.c +++ b/crypto_kem/hqc-192/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQC192_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned char *c } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-192/clean/kem.c b/crypto_kem/hqc-192/clean/kem.c index 4d1f12a5..90bfe9d3 100644 --- a/crypto_kem/hqc-192/clean/kem.c +++ b/crypto_kem/hqc-192/clean/kem.c @@ -140,5 +140,5 @@ int PQCLEAN_HQC192_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned char * } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-256/avx2/kem.c b/crypto_kem/hqc-256/avx2/kem.c index 86c39a58..de7761fa 100644 --- a/crypto_kem/hqc-256/avx2/kem.c +++ b/crypto_kem/hqc-256/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQC256_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned char *c } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-256/clean/kem.c b/crypto_kem/hqc-256/clean/kem.c index 47195987..4073cecd 100644 --- a/crypto_kem/hqc-256/clean/kem.c +++ b/crypto_kem/hqc-256/clean/kem.c @@ -140,5 +140,5 @@ int PQCLEAN_HQC256_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned char * } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-128/avx2/kem.c b/crypto_kem/hqc-rmrs-128/avx2/kem.c index 0d2e0453..bdde55b0 100644 --- a/crypto_kem/hqc-rmrs-128/avx2/kem.c +++ b/crypto_kem/hqc-rmrs-128/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS128_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned cha } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-128/clean/kem.c b/crypto_kem/hqc-rmrs-128/clean/kem.c index 05c10fac..d92d7bc7 100644 --- a/crypto_kem/hqc-rmrs-128/clean/kem.c +++ b/crypto_kem/hqc-rmrs-128/clean/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS128_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned ch } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-192/avx2/kem.c b/crypto_kem/hqc-rmrs-192/avx2/kem.c index 5507d41e..b216d1bc 100644 --- a/crypto_kem/hqc-rmrs-192/avx2/kem.c +++ b/crypto_kem/hqc-rmrs-192/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS192_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned cha } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-192/clean/kem.c b/crypto_kem/hqc-rmrs-192/clean/kem.c index 1e1519ad..8af76320 100644 --- a/crypto_kem/hqc-rmrs-192/clean/kem.c +++ b/crypto_kem/hqc-rmrs-192/clean/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS192_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned ch } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-256/avx2/kem.c b/crypto_kem/hqc-rmrs-256/avx2/kem.c index e2259232..02403028 100644 --- a/crypto_kem/hqc-rmrs-256/avx2/kem.c +++ b/crypto_kem/hqc-rmrs-256/avx2/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS256_AVX2_crypto_kem_dec(unsigned char *ss, const unsigned cha } - return result & 1; + return -(result & 1); } diff --git a/crypto_kem/hqc-rmrs-256/clean/kem.c b/crypto_kem/hqc-rmrs-256/clean/kem.c index fd97e8a2..4f857d87 100644 --- a/crypto_kem/hqc-rmrs-256/clean/kem.c +++ b/crypto_kem/hqc-rmrs-256/clean/kem.c @@ -136,5 +136,5 @@ int PQCLEAN_HQCRMRS256_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned ch } - return result & 1; + return -(result & 1); }