MCPcopy Create free account
hub / github.com/LUX-Core/lux / VerifyPubKey

Method VerifyPubKey

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

Source from the content-addressed store, hash-verified

213}
214
215bool CKey::VerifyPubKey(const CPubKey& pubkey) const {
216 if (pubkey.IsCompressed() != fCompressed) {
217 return false;
218 }
219 unsigned char rnd[8];
220 std::string str = "Bitcoin key verification\n";
221 GetRandBytes(rnd, sizeof(rnd));
222 uint256 hash;
223 CHash256().Write((unsigned char*)str.data(), str.size()).Write(rnd, sizeof(rnd)).Finalize(hash.begin());
224 std::vector<unsigned char> vchSig;
225 SignECDSA(hash, vchSig);
226 return pubkey.VerifyECDSA(hash, vchSig);
227}
228
229bool CKey::SignCompact(const uint256& hash, std::vector<uint8_t>& vchSig) const {
230 if (!fValid)

Callers 8

ECC_InitSanityCheckFunction · 0.80
importprivkeyFunction · 0.80
importwalletFunction · 0.80
bip38decryptFunction · 0.80
GenerateNewKeyMethod · 0.80
DeriveNewChildKeyMethod · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 9

GetRandBytesFunction · 0.85
CHash256Class · 0.85
VerifyECDSAMethod · 0.80
IsCompressedMethod · 0.45
FinalizeMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.64