This PR removes unneeded normalize_weak calls in two group element functions:
-
secp256k1_ge_is_valid_var
: After calculating the right-hand side of the elliptic curve equation (x^3 + 7), the field elementx3
has a magnitude of 2 (1 as result ofsecp256k1_fe_mul
, then increased by 1 due tosecp256k1_fe_add_int
). This is fine forsecp256k1_fe_equal_var
, as the second parameter only requires the magnitude to not exceed 31, and the normalize_weak call is hence not needed and can be dropped. Note that the interface description forsecp256k1_fe_equal
(which also applies tosecp256k1_fe_equal_var
) once stated that both parameters need to have magnitude 1, but that was corrected in commit 7d7d43c6dd2741853de4631881d77ae38a14cd23. -
secp256k1_gej_eq_x_var
: By requiring that the input group element’s X coordinate (a->x
) has a magnitude of <= 31, the normalize_weak call and also the field element variabler2
are not needed anymore and hence can be dropped.