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