23 static const auto testing_setup = MakeNoLogFileContext<>();
34 const std::optional<CMutableTransaction> mutable_transaction = ConsumeDeserializable<CMutableTransaction>(fuzzed_data_provider,
TX_WITH_WITNESS);
36 const unsigned int n_in = fuzzed_data_provider.
ConsumeIntegral<
unsigned int>();
38 const bool store = fuzzed_data_provider.
ConsumeBool();
42 const auto random_bytes = fuzzed_data_provider.
ConsumeBytes<
unsigned char>(64);
44 if (random_bytes.size() == 64) {
45 (void)caching_transaction_signature_checker.VerifySchnorrSignature(random_bytes, pub_key,
ConsumeUInt256(fuzzed_data_provider));
49 const auto pub_key = ConsumeDeserializable<CPubKey>(fuzzed_data_provider);
51 if (!random_bytes.empty()) {
52 (void)caching_transaction_signature_checker.VerifyECDSASignature(random_bytes, *pub_key,
ConsumeUInt256(fuzzed_data_provider));
int64_t CAmount
Amount in satoshis (Can be negative)
The basic transaction that is broadcasted on the network and contained in blocks.
std::vector< T > ConsumeBytes(size_t num_bytes)
T ConsumeIntegralInRange(T min, T max)
Valid signature cache, to avoid doing expensive ECDSA signature checking twice for every transaction ...
static constexpr TransactionSerParams TX_WITH_WITNESS
FUZZ_TARGET(script_sigcache,.init=initialize_script_sigcache)
void initialize_script_sigcache()
static constexpr size_t DEFAULT_SIGNATURE_CACHE_BYTES
A mutable version of CTransaction.
CAmount ConsumeMoney(FuzzedDataProvider &fuzzed_data_provider, const std::optional< CAmount > &max) noexcept
uint256 ConsumeUInt256(FuzzedDataProvider &fuzzed_data_provider) noexcept
std::vector< B > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
void SeedRandomStateForTest(SeedRand seedtype)
Seed the global RNG state for testing and log the seed value.
@ ZEROS
Seed with a compile time constant of zeros.