Skip to content

Commit

Permalink
Remove usage of CHECK from non-test file
Browse files Browse the repository at this point in the history
Currently CHECK is used only in test and bench mark files except for one
usage in `ecmult_impl.h`.

We would like to move the definition of CHECK out of `util.h` so that
`util.h` no longer has a hard dependency on `stdio.h`.

Done as part of an effort to allow secp256k1 to be compiled to WASM
as part of `rust-secp256k1`.
  • Loading branch information
tcharding committed Nov 4, 2022
1 parent a43e982 commit 0a3ebd7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/ecmult_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,13 @@ static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a,

bit += now;
}
#ifdef VERIFY
CHECK(carry == 0);

VERIFY_CHECK(carry == 0);
while (bit < 256) {
CHECK(secp256k1_scalar_get_bits(&s, bit++, 1) == 0);
VERIFY_CHECK(secp256k1_scalar_get_bits(&s, bit, 1) == 0);
bit++;
}
#endif

return last_set_bit + 1;
}

Expand Down

0 comments on commit 0a3ebd7

Please sign in to comment.