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