| 153 | } |
| 154 | |
| 155 | StringRef DecryptionStreamCipher::decrypt(unsigned char const* ciphertext, int len, Arena& arena) { |
| 156 | CODE_PROBE(true, "Decrypting data with StreamCipher"); |
| 157 | auto plaintext = new (arena) unsigned char[len]; |
| 158 | int bytesDecrypted{ 0 }; |
| 159 | EVP_DecryptUpdate(cipher.getCtx(), plaintext, &bytesDecrypted, ciphertext, len); |
| 160 | int finalBlockBytes{ 0 }; |
| 161 | EVP_DecryptFinal_ex(cipher.getCtx(), plaintext + bytesDecrypted, &finalBlockBytes); |
| 162 | return StringRef(plaintext, bytesDecrypted + finalBlockBytes); |
| 163 | } |
| 164 | |
| 165 | StringRef DecryptionStreamCipher::finish(Arena& arena) { |
| 166 | auto plaintext = new (arena) unsigned char[AES_BLOCK_SIZE]; |
no test coverage detected