1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-18 05:28:40 +00:00

refactor(crypto): remove unnecessary if

This commit is contained in:
Ondřej Vejpustek 2024-04-03 15:22:13 +02:00
parent 916dbdff9c
commit 80029823be

View File

@ -1112,9 +1112,6 @@ int tc_ecdsa_verify_digest(const ecdsa_curve *curve, const uint8_t *pub_key,
bn_inverse(&s, &curve->order); // s = s^-1 bn_inverse(&s, &curve->order); // s = s^-1
bn_multiply(&s, &z, &curve->order); // z = z * s [u1 = z * s^-1 mod n] bn_multiply(&s, &z, &curve->order); // z = z * s [u1 = z * s^-1 mod n]
bn_mod(&z, &curve->order); bn_mod(&z, &curve->order);
}
if (result == 0) {
bn_multiply(&r, &s, &curve->order); // s = r * s [u2 = r * s^-1 mod n] bn_multiply(&r, &s, &curve->order); // s = r * s [u2 = r * s^-1 mod n]
bn_mod(&s, &curve->order); bn_mod(&s, &curve->order);
scalar_multiply(curve, &z, &res); // res = z * G [= u1 * G] scalar_multiply(curve, &z, &res); // res = z * G [= u1 * G]