MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / DecryptSecret

Function DecryptSecret

src/wallet/crypter.cpp:121–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

DecryptKeyFunction · 0.85

Calls 4

memcpyFunction · 0.85
dataMethod · 0.45
SetKeyMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected