1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef QUICHE_QUIC_CORE_CRYPTO_AES_BASE_ENCRYPTER_H_ 6 #define QUICHE_QUIC_CORE_CRYPTO_AES_BASE_ENCRYPTER_H_ 7 8 #include <cstddef> 9 10 #include "absl/strings/string_view.h" 11 #include "openssl/aes.h" 12 #include "quiche/quic/core/crypto/aead_base_encrypter.h" 13 #include "quiche/quic/platform/api/quic_export.h" 14 15 namespace quic { 16 17 class QUICHE_EXPORT AesBaseEncrypter : public AeadBaseEncrypter { 18 public: 19 using AeadBaseEncrypter::AeadBaseEncrypter; 20 21 bool SetHeaderProtectionKey(absl::string_view key) override; 22 std::string GenerateHeaderProtectionMask(absl::string_view sample) override; 23 QuicPacketCount GetConfidentialityLimit() const override; 24 25 private: 26 // The key used for packet number encryption. 27 AES_KEY pne_key_; 28 }; 29 30 } // namespace quic 31 32 #endif // QUICHE_QUIC_CORE_CRYPTO_AES_BASE_ENCRYPTER_H_ 33