MCPcopy Create free account
hub / github.com/ElementsProject/elements / VerifyPubKey

Method VerifyPubKey

src/key.cpp:251–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
252 if (pubkey.IsCompressed() != fCompressed) {
253 return false;
254 }
255 unsigned char rnd[8];
256 std::string str = "Bitcoin key verification\n";
257 GetRandBytes(rnd, sizeof(rnd));
258 uint256 hash;
259 CHash256().Write(MakeUCharSpan(str)).Write(rnd).Finalize(hash);
260 std::vector<unsigned char> vchSig;
261 Sign(hash, vchSig);
262 return pubkey.Verify(hash, vchSig);
263}
264
265bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
266 if (!fValid)

Callers 11

ECC_InitSanityCheckFunction · 0.80
GenerateNewKeyMethod · 0.80
DeriveNewSeedMethod · 0.80
ImportPrivKeysMethod · 0.80
DecryptKeyFunction · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
getpegoutkeysFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
FUZZ_TARGET_INITFunction · 0.80

Calls 7

GetRandBytesFunction · 0.85
CHash256Class · 0.85
MakeUCharSpanFunction · 0.85
IsCompressedMethod · 0.45
FinalizeMethod · 0.45
WriteMethod · 0.45
VerifyMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.64
FUZZ_TARGET_INITFunction · 0.64