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

Function DecryptSecret

src/crypter.cpp:148–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147
148bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext)
149{
150 CCrypter cKeyCrypter;
151 std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
152 memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
153 if (!cKeyCrypter.SetKey(vMasterKey, chIV))
154 return false;
155 return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));
156}
157
158bool DecryptAES256(const SecureString& sKey, const std::string& sCiphertext, const std::string& sIV, SecureString& sPlaintext)
159{

Callers 3

UnlockMethod · 0.85
GetKeyMethod · 0.85
DecryptHDChainMethod · 0.85

Calls 3

memcpyFunction · 0.85
SetKeyMethod · 0.45
DecryptMethod · 0.45

Tested by

no test coverage detected