Skip to content

Commit 97c63b9

Browse files
committed
Avoid normalize conditional on VERIFY
1 parent 341cc19 commit 97c63b9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ecmult_impl.h

-3
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ static void secp256k1_ecmult_strauss_wnaf(const struct secp256k1_strauss_state *
279279
*/
280280
tmp = a[np];
281281
if (no) {
282-
#ifdef VERIFY
283-
secp256k1_fe_normalize_var(&Z);
284-
#endif
285282
secp256k1_gej_rescale(&tmp, &Z);
286283
}
287284
secp256k1_ecmult_odd_multiples_table(ECMULT_TABLE_SIZE(WINDOW_A), state->pre_a + no * ECMULT_TABLE_SIZE(WINDOW_A), state->aux + no * ECMULT_TABLE_SIZE(WINDOW_A), &Z, &tmp);

src/group_impl.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,9 @@ static void secp256k1_gej_rescale(secp256k1_gej *r, const secp256k1_fe *s) {
748748
secp256k1_fe zz;
749749
secp256k1_gej_verify(r);
750750
secp256k1_fe_verify(s);
751-
VERIFY_CHECK(!secp256k1_fe_is_zero(s));
751+
#ifdef VERIFY
752+
VERIFY_CHECK(!secp256k1_fe_normalizes_to_zero_var(s));
753+
#endif
752754
secp256k1_fe_sqr(&zz, s);
753755
secp256k1_fe_mul(&r->x, &r->x, &zz); /* r->x *= s^2 */
754756
secp256k1_fe_mul(&r->y, &r->y, &zz);

0 commit comments

Comments
 (0)