Fix hash length in NTRU

This commit is contained in:
Thom Wiggers 2019-04-16 13:24:34 +02:00
parent 873216c702
commit e711d6e3b9
No known key found for this signature in database
GPG Key ID: 001BB0A7CE26E363

View File

@ -52,7 +52,7 @@ int PQCLEAN_NTRUHPS2048509_CLEAN_crypto_kem_dec(uint8_t *k, const uint8_t *c, co
for (i = 0; i < NTRU_CIPHERTEXTBYTES; i++) { for (i = 0; i < NTRU_CIPHERTEXTBYTES; i++) {
cmp[i] = c[i]; cmp[i] = c[i];
} }
sha3_256(rm, cmp, NTRU_PRFKEYBYTES + NTRU_CIPHERTEXTBYTES); sha3_256(rm, cmp, NTRU_CIPHERTEXTBYTES);
PQCLEAN_NTRUHPS2048509_CLEAN_cmov(k, rm, NTRU_SHAREDKEYBYTES, (unsigned char) fail); PQCLEAN_NTRUHPS2048509_CLEAN_cmov(k, rm, NTRU_SHAREDKEYBYTES, (unsigned char) fail);