Skip to content

Commit c3e6307

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 c3e6307

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/ecmult_impl.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,12 @@ 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+
VERIFY_CHECK(carry == 0);
204+
205+
int verify_bit = bit;
206+
while (verify_bit < 256) {
207+
VERIFY_CHECK(secp256k1_scalar_get_bits(&s, verify_bit, 1) == 0);
208+
veirfy_bit++;
206209
}
207210
#endif
208211
return last_set_bit + 1;

0 commit comments

Comments
 (0)