Skip to content

Commit efa76c4

Browse files
committed
group: remove unneeded normalize_weak in secp256k1_ge_is_valid_var
After calculating the right-hand side of the elliptic curve equation (x^3 + 7), the field element `x3` has a magnitude of 2 (1 as result of `secp256k1_fe_mul`, then increased by 1 due to `secp256k1_fe_add_int`). This is fine for `secp256k1_fe_equal_var`, as the second parameter only requires the magnitude to not exceed 31, and the normalize_weak call can hence be dropped.
1 parent 67214f5 commit efa76c4

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/group_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ static int secp256k1_ge_is_valid_var(const secp256k1_ge *a) {
349349
secp256k1_fe_sqr(&y2, &a->y);
350350
secp256k1_fe_sqr(&x3, &a->x); secp256k1_fe_mul(&x3, &x3, &a->x);
351351
secp256k1_fe_add_int(&x3, SECP256K1_B);
352-
secp256k1_fe_normalize_weak(&x3);
353352
return secp256k1_fe_equal_var(&y2, &x3);
354353
}
355354

0 commit comments

Comments
 (0)