xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_encrypter.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright (c) 2017 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_128_GCM_ENCRYPTER_H_
6 #define QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_ENCRYPTER_H_
7 
8 #include "quiche/quic/core/crypto/aes_base_encrypter.h"
9 #include "quiche/quic/platform/api/quic_export.h"
10 
11 namespace quic {
12 
13 // An Aes128GcmEncrypter is a QuicEncrypter that implements the
14 // AEAD_AES_128_GCM algorithm specified in RFC 5116 for use in IETF QUIC.
15 //
16 // It uses an authentication tag of 16 bytes (128 bits). It uses a 12 byte IV
17 // that is XOR'd with the packet number to compute the nonce.
18 class QUICHE_EXPORT Aes128GcmEncrypter : public AesBaseEncrypter {
19  public:
20   enum {
21     kAuthTagSize = 16,
22   };
23 
24   Aes128GcmEncrypter();
25   Aes128GcmEncrypter(const Aes128GcmEncrypter&) = delete;
26   Aes128GcmEncrypter& operator=(const Aes128GcmEncrypter&) = delete;
27   ~Aes128GcmEncrypter() override;
28 };
29 
30 }  // namespace quic
31 
32 #endif  // QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_ENCRYPTER_H_
33