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

Function EncryptSecret

src/crypter.cpp:101–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99
100
101bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial& vchPlaintext, const uint256& nIV, std::vector<unsigned char>& vchCiphertext)
102{
103 CCrypter cKeyCrypter;
104 std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
105 memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
106 if (!cKeyCrypter.SetKey(vMasterKey, chIV))
107 return false;
108 return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);
109}
110
111
112// General secure AES 256 CBC encryption routine

Callers 3

AddKeyPubKeyMethod · 0.85
EncryptKeysMethod · 0.85
EncryptHDChainMethod · 0.85

Calls 3

memcpyFunction · 0.85
SetKeyMethod · 0.45
EncryptMethod · 0.45

Tested by

no test coverage detected