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

Method Decrypt

src/wallet/crypter.cpp:92–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92bool CCrypter::Decrypt(const std::vector<unsigned char>& vchCiphertext, CKeyingMaterial& vchPlaintext) const
93{
94 if (!fKeySet)
95 return false;
96
97 // plaintext will always be equal to or lesser than length of ciphertext
98 int nLen = vchCiphertext.size();
99
100 vchPlaintext.resize(nLen);
101
102 AES256CBCDecrypt dec(vchKey.data(), vchIV.data(), true);
103 nLen = dec.Decrypt(vchCiphertext.data(), vchCiphertext.size(), &vchPlaintext[0]);
104 if(nLen == 0)
105 return false;
106 vchPlaintext.resize(nLen);
107 return true;
108}
109
110
111static bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256& nIV, std::vector<unsigned char> &vchCiphertext)

Callers 4

DecryptSecretFunction · 0.45
UnlockMethod · 0.45
TestDecryptMethod · 0.45

Calls 3

sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by 1

TestDecryptMethod · 0.36