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

Method VerifyPubKey

src/key.cpp:184–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
185 if (pubkey.IsCompressed() != fCompressed) {
186 return false;
187 }
188 unsigned char rnd[8];
189 std::string str = "Bitcoin key verification\n";
190 GetRandBytes(rnd, sizeof(rnd));
191 uint256 hash;
192 CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize(hash.begin());
193 std::vector<unsigned char> vchSig;
194 Sign(hash, vchSig);
195 return pubkey.Verify(hash, vchSig);
196}
197
198bool CKey::SignCompact(const uint256 &hash, std::vector<unsigned char>& vchSig) const {
199 if (!fValid)

Callers 6

ECC_InitSanityCheckFunction · 0.80
DecryptKeyFunction · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
GenerateNewKeyMethod · 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