Merge branch 'bugfix/uecc_antifault' into 'master'

secure boot: Fix anti-fault value if hash is shorter than curve

See merge request espressif/esp-idf!7940
This commit is contained in:
Angus Gratton 2020-03-18 15:51:09 +08:00
commit 99a7581974

View file

@ -133,7 +133,7 @@ int uECC_verify_antifault(const uint8_t *public_key,
} }
/* Curve may be longer than hash, in which case keep reading the rest of the bytes */ /* Curve may be longer than hash, in which case keep reading the rest of the bytes */
for (int w = hash_words; w < curve->num_words; w++) { for (int w = hash_words; w < curve->num_words; w++) {
vhash_words[w % hash_words] |= rx[w] | r[w]; vhash_words[w % hash_words] |= rx[w] ^ r[w];
} }
/* Accept only if v == r. */ /* Accept only if v == r. */