| 124 | } |
| 125 | |
| 126 | EncryptionStreamCipher::EncryptionStreamCipher(const StreamCipherKey* key, const StreamCipher::IV& iv) |
| 127 | : cipher(StreamCipher(key->size())) { |
| 128 | EVP_EncryptInit_ex(cipher.getCtx(), EVP_aes_256_gcm(), nullptr, nullptr, nullptr); |
| 129 | EVP_CIPHER_CTX_ctrl(cipher.getCtx(), EVP_CTRL_AEAD_SET_IVLEN, iv.size(), nullptr); |
| 130 | EVP_EncryptInit_ex(cipher.getCtx(), nullptr, nullptr, key->data(), iv.data()); |
| 131 | } |
| 132 | |
| 133 | StringRef EncryptionStreamCipher::encrypt(unsigned char const* plaintext, int len, Arena& arena) { |
| 134 | CODE_PROBE(true, "Encrypting data with StreamCipher"); |
nothing calls this directly
no test coverage detected