Skip to content

Commit

Permalink
Merge #1247: Apply Checks only in VERIFY mode.
Browse files Browse the repository at this point in the history
4ebd828 Apply Checks only in VERIFY mode. (roconnor-blockstream)

Pull request description:

  This is already done in `field_5x52_impl.h`.

ACKs for top commit:
  sipa:
    ACK 4ebd828
  jonasnick:
    ACK 4ebd828

Tree-SHA512: c24211e5219907e41e2c5792255734bd50ca5866a4863abbb3ec174ed92d1792dd10563a94c08e8fecd6cdf776a9c49ca87e8f9806a023d9081ecc0d55ae3e66
  • Loading branch information
sipa committed Mar 24, 2023
2 parents 70be3ca + 4ebd828 commit f16a709
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 f16a709

Please sign in to comment.