5 #include <chainparams.h>
32 private_key.
Set(random_bytes.begin(), random_bytes.end(), fuzzed_data_provider.
ConsumeBool());
33 std::string signature;
34 const bool message_signed =
MessageSign(private_key, random_message, signature);
void SelectParams(const std::string &network)
Sets the params returned by Params() to those for the given chain name.
static const std::string REGTEST
An encapsulated private key.
bool IsValid() const
Check whether this private key is valid.
CPubKey GetPubKey() const
Compute the public key from a private key.
void Set(const T pbegin, const T pend, bool fCompressedIn)
Initialize using begin and end iterators to byte data.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
std::string ConsumeRandomLengthString(size_t max_length)
T PickValueInArray(const T(&array)[size])
std::string EncodeDestination(const CTxDestination &dest)
@ PRIVATE_KEY_NOT_AVAILABLE
MessageVerificationResult
The result of a signed message verification.
@ OK
The message verification was successful.
FUZZ_TARGET_INIT(message, initialize_message)
void initialize_message()
std::vector< uint8_t > ConsumeRandomLengthByteVector(FuzzedDataProvider &fuzzed_data_provider, const std::optional< size_t > &max_length=std::nullopt) noexcept
uint256 MessageHash(const std::string &message)
Hashes a message for signing and verification in a manner that prevents inadvertently signing a trans...
bool MessageSign(const CKey &privkey, const std::string &message, std::string &signature)
Sign a message.
std::string SigningResultString(const SigningResult res)
MessageVerificationResult MessageVerify(const std::string &address, const std::string &signature, const std::string &message)
Verify a signed message.