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

Function DecryptSecret

src/wallet/crypter.cpp:118–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext)
119{
120 CCrypter cKeyCrypter;
121 std::vector<unsigned char> chIV(WALLET_CRYPTO_IV_SIZE);
122 memcpy(chIV.data(), &nIV, WALLET_CRYPTO_IV_SIZE);
123 if(!cKeyCrypter.SetKey(vMasterKey, chIV))
124 return false;
125 return cKeyCrypter.Decrypt(vchCiphertext, vchPlaintext);
126}
127
128bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)
129{

Callers 1

DecryptKeyFunction · 0.85

Calls 3

dataMethod · 0.45
SetKeyMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected