| 12 | constexpr auto kTag = "[utils][AesEncryptor]"; |
| 13 | |
| 14 | AesEncryptor::AesEncryptor(const AesEncryptor::Key& key, const AesEncryptor::Iv& iv) |
| 15 | : _cipher(EVP_aead_aes_128_gcm()), _key(key), _iv(iv) { |
| 16 | SC_ASSERT(_key.size() == EVP_AEAD_key_length(_cipher)); |
| 17 | SC_ASSERT(_iv.size() == EVP_AEAD_nonce_length(_cipher)); |
| 18 | } |
| 19 | |
| 20 | AesEncryptor::AesEncryptor(const bssl::Span<uint8_t>& key, const bssl::Span<uint8_t>& iv) |
| 21 | : _cipher(EVP_aead_aes_128_gcm()), _key{}, _iv{} { |