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