aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/crypto.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-21 19:34:13 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-08-21 19:25:33 +0200
commitfaa5fa9a78d6d23b4e9adea07fdfb34ead170a2f (patch)
treea580529d992ddb465c0edfcdfedf57dc830f93c1 /src/test/fuzz/crypto.cpp
parentf5a406f003a060325128db47552089b3254044e3 (diff)
fuzz: Use LIMITED_WHILE instead of limit_max_ops
Diffstat (limited to 'src/test/fuzz/crypto.cpp')
-rw-r--r--src/test/fuzz/crypto.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/test/fuzz/crypto.cpp b/src/test/fuzz/crypto.cpp
index f83747e424..84b95117e2 100644
--- a/src/test/fuzz/crypto.cpp
+++ b/src/test/fuzz/crypto.cpp
@@ -19,10 +19,6 @@
FUZZ_TARGET(crypto)
{
- // Hashing is expensive with sanitizers enabled, so limit the number of
- // calls
- int limit_max_ops{30};
-
FuzzedDataProvider fuzzed_data_provider{buffer.data(), buffer.size()};
std::vector<uint8_t> data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
if (data.empty()) {
@@ -40,7 +36,8 @@ FUZZ_TARGET(crypto)
SHA3_256 sha3;
CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral<uint64_t>(), fuzzed_data_provider.ConsumeIntegral<uint64_t>()};
- while (--limit_max_ops >= 0 && fuzzed_data_provider.ConsumeBool()) {
+ LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 30)
+ {
CallOneOf(
fuzzed_data_provider,
[&] {