Also check curve in verify()

This is the only function that performs computations without calling
EccPoint_mult_safer() and that didn't have that guard yet.
This commit is contained in:
Manuel Pégourié-Gonnard 2019-11-04 15:37:42 +01:00
parent 913534837a
commit ad166d8db7

View file

@ -220,6 +220,9 @@ int uECC_verify(const uint8_t *public_key, const uint8_t *message_hash,
wordcount_t num_words = curve->num_words;
wordcount_t num_n_words = BITS_TO_WORDS(curve->num_n_bits);
if (curve != uECC_secp256r1())
return 0;
rx[num_n_words - 1] = 0;
r[num_n_words - 1] = 0;
s[num_n_words - 1] = 0;