xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/chacha_base_encrypter.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_CHACHA_BASE_ENCRYPTER_H_
6 #define QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_
7 
8 #include <cstddef>
9 
10 #include "absl/strings/string_view.h"
11 #include "quiche/quic/core/crypto/aead_base_encrypter.h"
12 #include "quiche/quic/platform/api/quic_export.h"
13 
14 namespace quic {
15 
16 class QUICHE_EXPORT ChaChaBaseEncrypter : public AeadBaseEncrypter {
17  public:
18   using AeadBaseEncrypter::AeadBaseEncrypter;
19 
20   bool SetHeaderProtectionKey(absl::string_view key) override;
21   std::string GenerateHeaderProtectionMask(absl::string_view sample) override;
22 
23  private:
24   // The key used for packet number encryption.
25   unsigned char pne_key_[kMaxKeySize];
26 };
27 
28 }  // namespace quic
29 
30 #endif  // QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_
31