MCPcopy Create free account
hub / github.com/ElementsProject/elements / DecryptKey

Function DecryptKey

src/wallet/crypter.cpp:128–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)
129{
130 CKeyingMaterial vchSecret;
131 if(!DecryptSecret(vMasterKey, vchCryptedSecret, vchPubKey.GetHash(), vchSecret))
132 return false;
133
134 if (vchSecret.size() != 32)
135 return false;
136
137 key.Set(vchSecret.begin(), vchSecret.end(), vchPubKey.IsCompressed());
138 return key.VerifyPubKey(vchPubKey);
139}
140} // namespace wallet

Callers 3

CheckDecryptionKeyMethod · 0.85
GetKeyMethod · 0.85
GetKeysMethod · 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