Skip to content

Commit 6a965b6

Browse files
committed
Remove usage of CHECK from non-test file
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 in preparation for moving the definition of `CHECK` as part of an effort to allow secp256k1 to be compiled to WASM as part of `rust-secp256k1`.
1 parent a43e982 commit 6a965b6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ecmult_impl.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,15 @@ static int secp256k1_ecmult_wnaf(int *wnaf, int len, const secp256k1_scalar *a,
200200
bit += now;
201201
}
202202
#ifdef VERIFY
203-
CHECK(carry == 0);
204-
while (bit < 256) {
205-
CHECK(secp256k1_scalar_get_bits(&s, bit++, 1) == 0);
203+
{
204+
int verify_bit = bit;
205+
206+
VERIFY_CHECK(carry == 0);
207+
208+
while (verify_bit < 256) {
209+
VERIFY_CHECK(secp256k1_scalar_get_bits(&s, verify_bit, 1) == 0);
210+
verify_bit++;
211+
}
206212
}
207213
#endif
208214
return last_set_bit + 1;

0 commit comments

Comments
 (0)