| 109 | |
| 110 | |
| 111 | static 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 | |
| 121 | static bool DecryptSecret(const CKeyingMaterial& vMasterKey, const std::vector<unsigned char>& vchCiphertext, const uint256& nIV, CKeyingMaterial& vchPlaintext) |
| 122 | { |
no test coverage detected