| 146 | } |
| 147 | |
| 148 | DecryptionStreamCipher::DecryptionStreamCipher(const StreamCipherKey* key, const StreamCipher::IV& iv) |
| 149 | : cipher(key->size()) { |
| 150 | EVP_DecryptInit_ex(cipher.getCtx(), EVP_aes_256_gcm(), nullptr, nullptr, nullptr); |
| 151 | EVP_CIPHER_CTX_ctrl(cipher.getCtx(), EVP_CTRL_AEAD_SET_IVLEN, iv.size(), nullptr); |
| 152 | EVP_DecryptInit_ex(cipher.getCtx(), nullptr, nullptr, key->data(), iv.data()); |
| 153 | } |
| 154 | |
| 155 | StringRef DecryptionStreamCipher::decrypt(unsigned char const* ciphertext, int len, Arena& arena) { |
| 156 | CODE_PROBE(true, "Decrypting data with StreamCipher"); |