| 131 | } |
| 132 | |
| 133 | StringRef EncryptionStreamCipher::encrypt(unsigned char const* plaintext, int len, Arena& arena) { |
| 134 | CODE_PROBE(true, "Encrypting data with StreamCipher"); |
| 135 | auto ciphertext = new (arena) unsigned char[len + AES_BLOCK_SIZE]; |
| 136 | int bytes{ 0 }; |
| 137 | EVP_EncryptUpdate(cipher.getCtx(), ciphertext, &bytes, plaintext, len); |
| 138 | return StringRef(ciphertext, bytes); |
| 139 | } |
| 140 | |
| 141 | StringRef EncryptionStreamCipher::finish(Arena& arena) { |
| 142 | auto ciphertext = new (arena) unsigned char[AES_BLOCK_SIZE]; |
no test coverage detected