| 99 | |
| 100 | |
| 101 | bool EncryptSecret(const CKeyingMaterial& vMasterKey, const CKeyingMaterial& vchPlaintext, const uint256& nIV, std::vector<unsigned char>& vchCiphertext) |
| 102 | { |
| 103 | CCrypter cKeyCrypter; |
| 104 | std::vector<unsigned char> chIV(WALLET_CRYPTO_KEY_SIZE); |
| 105 | memcpy(&chIV[0], &nIV, WALLET_CRYPTO_KEY_SIZE); |
| 106 | if (!cKeyCrypter.SetKey(vMasterKey, chIV)) |
| 107 | return false; |
| 108 | return cKeyCrypter.Encrypt(*((const CKeyingMaterial*)&vchPlaintext), vchCiphertext); |
| 109 | } |
| 110 | |
| 111 | |
| 112 | // General secure AES 256 CBC encryption routine |
no test coverage detected