mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-15 01:40:57 +00:00
Removed test for point equality in ecdsa_verify_digest, point_add() already handles that.
This commit is contained in:
parent
da6a09880d
commit
6d61cefdb3
7
ecdsa.c
7
ecdsa.c
@ -520,13 +520,6 @@ int ecdsa_verify_digest(const uint8_t *pub_key, const uint8_t *sig, const uint8_
|
|||||||
for (j = 0; j < 30; j++) {
|
for (j = 0; j < 30; j++) {
|
||||||
if (i == 8 && (s.val[i] >> j) == 0) break;
|
if (i == 8 && (s.val[i] >> j) == 0) break;
|
||||||
if (s.val[i] & (1u << j)) {
|
if (s.val[i] & (1u << j)) {
|
||||||
bn_mod(&(pub.x), &prime256k1);
|
|
||||||
bn_mod(&(res.x), &prime256k1);
|
|
||||||
if (bn_is_equal(&(pub.x), &(res.x))) {
|
|
||||||
// this is not a failure, but a very inprobable case
|
|
||||||
// that we don't handle because of its inprobability
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
point_add(&pub, &res);
|
point_add(&pub, &res);
|
||||||
}
|
}
|
||||||
point_double(&pub);
|
point_double(&pub);
|
||||||
|
Loading…
Reference in New Issue
Block a user