Skip to content

Commit

Permalink
Apply Checks only in VERIFY mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
roconnor-blockstream committed Mar 23, 2023
1 parent 9c8c4f4 commit 4ebd828
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/field_10x26_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,9 @@ static void secp256k1_fe_inv(secp256k1_fe *r, const secp256k1_fe *x) {
secp256k1_modinv32(&s, &secp256k1_const_modinfo_fe);
secp256k1_fe_from_signed30(r, &s);

#ifdef VERIFY
VERIFY_CHECK(secp256k1_fe_normalizes_to_zero(r) == secp256k1_fe_normalizes_to_zero(&tmp));
#endif
}

static void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *x) {
Expand All @@ -1376,7 +1378,9 @@ static void secp256k1_fe_inv_var(secp256k1_fe *r, const secp256k1_fe *x) {
secp256k1_modinv32_var(&s, &secp256k1_const_modinfo_fe);
secp256k1_fe_from_signed30(r, &s);

#ifdef VERIFY
VERIFY_CHECK(secp256k1_fe_normalizes_to_zero(r) == secp256k1_fe_normalizes_to_zero(&tmp));
#endif
}

static int secp256k1_fe_is_square_var(const secp256k1_fe *x) {
Expand Down

0 comments on commit 4ebd828

Please sign in to comment.