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

Function DecryptKey

src/wallet/crypter.cpp:132–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132bool DecryptKey(const CKeyingMaterial& master_key, const std::span<const unsigned char> crypted_secret, const CPubKey& pub_key, CKey& key)
133{
134 CKeyingMaterial secret;
135 if (!DecryptSecret(master_key, crypted_secret, pub_key.GetHash(), secret)) {
136 return false;
137 }
138
139 if (secret.size() != 32) {
140 return false;
141 }
142
143 key.Set(secret.begin(), secret.end(), pub_key.IsCompressed());
144 return key.VerifyPubKey(pub_key);
145}
146} // namespace wallet

Callers 4

CheckDecryptionKeyMethod · 0.85
GetKeyMethod · 0.85
GetKeysMethod · 0.85
crypter.cppFile · 0.85

Calls 8

DecryptSecretFunction · 0.85
VerifyPubKeyMethod · 0.80
GetHashMethod · 0.45
sizeMethod · 0.45
SetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
IsCompressedMethod · 0.45

Tested by

no test coverage detected