|
|
@@ -127,9 +127,9 @@ int PQCLEAN_HQCRMRS128_CLEAN_crypto_kem_dec(unsigned char *ss, const unsigned ch |
|
|
|
sha512(ss, mc, VEC_K_SIZE_BYTES + VEC_N_SIZE_BYTES + VEC_N1N2_SIZE_BYTES); |
|
|
|
|
|
|
|
// Abort if c != c' or d != d' |
|
|
|
result = PQCLEAN_HQCRMRS128_CLEAN_vect_compare(u, u2, VEC_N_SIZE_BYTES); |
|
|
|
result |= PQCLEAN_HQCRMRS128_CLEAN_vect_compare(v, v2, VEC_N1N2_SIZE_BYTES); |
|
|
|
result |= memcmp(d, d2, SHA512_BYTES); |
|
|
|
result = PQCLEAN_HQCRMRS128_CLEAN_vect_compare((uint8_t *)u, (uint8_t *)u2, VEC_N_SIZE_BYTES); |
|
|
|
result |= PQCLEAN_HQCRMRS128_CLEAN_vect_compare((uint8_t *)v, (uint8_t *)v2, VEC_N1N2_SIZE_BYTES); |
|
|
|
result |= PQCLEAN_HQCRMRS128_CLEAN_vect_compare(d, d2, SHA512_BYTES); |
|
|
|
result = (uint8_t) (-((int16_t) result) >> 15); |
|
|
|
for (size_t i = 0; i < SHARED_SECRET_BYTES; i++) { |
|
|
|
ss[i] &= ~result; |
|
|
|