5 #include <chainparams.h> 32 std::string signature;
33 const bool message_signed =
MessageSign(private_key, random_message, signature);
42 (void)
MessageVerify(fuzzed_data_provider.ConsumeRandomLengthString(1024), fuzzed_data_provider.ConsumeRandomLengthString(1024), random_message);
43 (void)
SigningResultString(fuzzed_data_provider.PickValueInArray({SigningResult::OK, SigningResult::PRIVATE_KEY_NOT_AVAILABLE, SigningResult::SIGNING_FAILED}));
std::string SigningResultString(const SigningResult res)
RAII class initializing and deinitializing global state for elliptic curve support.
The message verification was successful.
CPubKey GetPubKey() const
Compute the public key from a private key.
bool MessageSign(const CKey &privkey, const std::string &message, std::string &signature)
Sign a message.
void initialize_message()
MessageVerificationResult MessageVerify(const std::string &address, const std::string &signature, const std::string &message)
Verify a signed message.
MessageVerificationResult
The result of a signed message verification.
CKeyID GetID() const
Get the KeyID of this public key (hash of its serialization)
FUZZ_TARGET(message,.init=initialize_message)
std::string ConsumeRandomLengthString(size_t max_length)
std::string EncodeDestination(const CTxDestination &dest)
uint256 MessageHash(const std::string &message)
Hashes a message for signing and verification in a manner that prevents inadvertently signing a trans...
An encapsulated private key.
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
CKey ConsumePrivateKey(FuzzedDataProvider &fuzzed_data_provider, std::optional< bool > compressed) noexcept
bool IsValid() const
Check whether this private key is valid.