MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / VerifyPubKey

Method VerifyPubKey

src/key.cpp:236–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
237 if (pubkey.IsCompressed() != fCompressed) {
238 return false;
239 }
240 unsigned char rnd[8];
241 std::string str = "Bitcoin key verification\n";
242 GetRandBytes(rnd);
243 uint256 hash{Hash(str, rnd)};
244 std::vector<unsigned char> vchSig;
245 Sign(hash, vchSig);
246 return pubkey.Verify(hash, vchSig);
247}
248
249bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
250 if (!keydata)

Callers 5

ECC_InitSanityCheckFunction · 0.80
DecryptKeyFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
key.cppFile · 0.80

Calls 4

GetRandBytesFunction · 0.85
HashFunction · 0.70
IsCompressedMethod · 0.45
VerifyMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64