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

Method VerifyPubKey

src/key.cpp:227–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
228 if (pubkey.IsCompressed() != fCompressed) {
229 return false;
230 }
231 unsigned char rnd[8];
232 std::string str = "Bitcoin key verification\n";
233 GetRandBytes(rnd, sizeof(rnd));
234 uint256 hash;
235 CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize(hash.begin());
236 std::vector<unsigned char> vchSig;
237 Sign(hash, vchSig);
238 return pubkey.Verify(hash, vchSig);
239}
240
241bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
242 if (!fValid)

Callers 8

ECC_InitSanityCheckFunction · 0.80
DecryptKeyFunction · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
rpcdump.cppFile · 0.80
GenerateNewKeyMethod · 0.80
DeriveNewSeedMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 9

GetRandBytesFunction · 0.85
CHash256Class · 0.85
IsCompressedMethod · 0.45
FinalizeMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
VerifyMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64