1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 09:28:13 +00:00

small cosmetic changes

This commit is contained in:
Pavol Rusnak 2013-10-24 19:44:54 +02:00
parent 9308fddb7f
commit a439d8674d

View File

@ -379,8 +379,7 @@ int ecdsa_verify(const uint8_t *pub_key, const uint8_t *sig, const uint8_t *msg,
bn_read_be(hash, &z); bn_read_be(hash, &z);
if (bn_is_zero(&r) || if (bn_is_zero(&r) || bn_is_zero(&s) ||
bn_is_zero(&s) ||
(!bn_is_less(&r, &order256k1)) || (!bn_is_less(&r, &order256k1)) ||
(!bn_is_less(&s, &order256k1))) return 2; (!bn_is_less(&s, &order256k1))) return 2;
@ -410,10 +409,14 @@ int ecdsa_verify(const uint8_t *pub_key, const uint8_t *sig, const uint8_t *msg,
bn_mod(&(res.x), &prime256k1); bn_mod(&(res.x), &prime256k1);
bn_mod(&(res.x), &order256k1); bn_mod(&(res.x), &order256k1);
// signature does not match
for (i = 0; i < 9; i++) { for (i = 0; i < 9; i++) {
if (res.x.val[i] != r.val[i]) { if (res.x.val[i] != r.val[i]) {
return 3; return 4;
} }
} }
// all OK
return 0; return 0;
} }