25 auto new_size = fuzzed_data_provider.ConsumeIntegralInRange<
size_t>(1, 4096);
26 auto x = fuzzed_data_provider.ConsumeIntegral<uint8_t>();
27 data.resize(new_size, x);
39 CSipHasher sip_hasher{fuzzed_data_provider.ConsumeIntegral<uint64_t>(), fuzzed_data_provider.ConsumeIntegral<uint64_t>()};
46 if (fuzzed_data_provider.ConsumeBool()) {
47 data = ConsumeRandomLengthByteVector(fuzzed_data_provider);
49 auto new_size = fuzzed_data_provider.ConsumeIntegralInRange<size_t>(1, 4096);
50 auto x = fuzzed_data_provider.ConsumeIntegral<uint8_t>();
51 data.resize(new_size, x);
64 (void)sip_hasher.Write(
data);
71 (void)hash160.
Reset();
72 (void)hash256.
Reset();
92 hmac_sha256.Finalize(
data.data());
96 hmac_sha512.Finalize(
data.data());
116 data[0] = sip_hasher.Finalize() % 256;
124 if (fuzzed_data_provider.ConsumeBool()) {
126 for (
size_t i = 0; i < 25; ++i) {
127 state[i] = fuzzed_data_provider.ConsumeIntegral<uint64_t>();
A hasher class for HMAC-SHA-256.
static const size_t OUTPUT_SIZE
A hasher class for HMAC-SHA-512.
static const size_t OUTPUT_SIZE
A hasher class for Bitcoin's 160-bit hash (SHA-256 + RIPEMD-160).
static const size_t OUTPUT_SIZE
void Finalize(Span< unsigned char > output)
CHash160 & Write(Span< const unsigned char > input)
A hasher class for Bitcoin's 256-bit hash (double SHA-256).
void Finalize(Span< unsigned char > output)
CHash256 & Write(Span< const unsigned char > input)
static const size_t OUTPUT_SIZE
A hasher class for RIPEMD-160.
static const size_t OUTPUT_SIZE
static const size_t OUTPUT_SIZE
A hasher class for SHA-256.
static const size_t OUTPUT_SIZE
A hasher class for SHA-512.
static constexpr size_t OUTPUT_SIZE
SHA3_256 & Write(Span< const unsigned char > data)
SHA3_256 & Finalize(Span< unsigned char > output)
static constexpr size_t OUTPUT_SIZE
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
uint160 Hash160(const T1 &in1)
Compute the 160-bit hash an object.
uint256 Hash(const T &in1)
Compute the 256-bit hash of an object.
Internal RIPEMD-160 implementation.
Internal SHA-1 implementation.
Internal SHA-256 implementation.
Internal SHA-512 implementation.
void KeccakF(uint64_t(&st)[25])
The Keccak-f[1600] transform.
size_t CallOneOf(FuzzedDataProvider &fuzzed_data_provider, Callables... callables)
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept