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

Function DecryptSecret

src/wallet/crypter.cpp:115–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext)
116{
117 CCrypter cKeyCrypter;
118 std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE);
119 memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE);
120 if(!cKeyCrypter.SetKey(vMasterKey, chIV))
121 return false;
122 return cKeyCrypter.Decrypt(vchCiphertext, *((CKeyingMaterial*)&vchPlaintext));
123}
124
125static bool DecryptKey(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCryptedSecret, const CPubKey& vchPubKey, CKey& key)
126{

Callers 1

DecryptKeyFunction · 0.85

Calls 3

memcpyFunction · 0.85
DecryptMethod · 0.80
SetKeyMethod · 0.45

Tested by

no test coverage detected