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

Function EncryptSecret

src/wallet/crypter.cpp:111–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110
111static bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)
112{
113 CCrypter cKeyCrypter;
114 std::vector<unsigned char> chIV(WALLET_CRYPTO_IV_SIZE);
115 memcpy(chIV.data(), &nIV, WALLET_CRYPTO_IV_SIZE);
116 if(!cKeyCrypter.SetKey(vMasterKey, chIV))
117 return false;
118 return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext);
119}
120
121static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext)
122{

Callers 2

AddKeyPubKeyMethod · 0.85
EncryptKeysMethod · 0.85

Calls 4

memcpyFunction · 0.85
dataMethod · 0.45
SetKeyMethod · 0.45
EncryptMethod · 0.45

Tested by

no test coverage detected