5 #include <chainparams.h>
32 std::string signature;
33 const bool message_signed =
MessageSign(private_key, random_message, signature);
void SelectParams(const ChainType chain)
Sets the params returned by Params() to those for the given chain type.
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.
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.
void initialize_message()
FUZZ_TARGET(message,.init=initialize_message)
CKey ConsumePrivateKey(FuzzedDataProvider &fuzzed_data_provider, std::optional< bool > compressed) 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.