xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/aes_base_decrypter.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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_DECRYPTER_H_
6 #define QUICHE_QUIC_CORE_CRYPTO_AES_BASE_DECRYPTER_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_decrypter.h"
13 #include "quiche/quic/platform/api/quic_export.h"
14 
15 namespace quic {
16 
17 class QUICHE_EXPORT AesBaseDecrypter : public AeadBaseDecrypter {
18  public:
19   using AeadBaseDecrypter::AeadBaseDecrypter;
20 
21   bool SetHeaderProtectionKey(absl::string_view key) override;
22   std::string GenerateHeaderProtectionMask(
23       QuicDataReader* sample_reader) override;
24   QuicPacketCount GetIntegrityLimit() const override;
25 
26  private:
27   // The key used for packet number encryption.
28   AES_KEY pne_key_;
29 };
30 
31 }  // namespace quic
32 
33 #endif  // QUICHE_QUIC_CORE_CRYPTO_AES_BASE_DECRYPTER_H_
34