xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/aes_128_gcm_12_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_AES_128_GCM_12_ENCRYPTER_H_
6 #define QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_12_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 Aes128Gcm12Encrypter is a QuicEncrypter that implements the
14 // AEAD_AES_128_GCM_12 algorithm specified in RFC 5282. Create an instance by
15 // calling QuicEncrypter::Create(kAESG).
16 //
17 // It uses an authentication tag of 12 bytes (96 bits). The fixed prefix
18 // of the nonce is four bytes.
19 class QUICHE_EXPORT Aes128Gcm12Encrypter : public AesBaseEncrypter {
20  public:
21   enum {
22     // Authentication tags are truncated to 96 bits.
23     kAuthTagSize = 12,
24   };
25 
26   Aes128Gcm12Encrypter();
27   Aes128Gcm12Encrypter(const Aes128Gcm12Encrypter&) = delete;
28   Aes128Gcm12Encrypter& operator=(const Aes128Gcm12Encrypter&) = delete;
29   ~Aes128Gcm12Encrypter() override;
30 };
31 
32 }  // namespace quic
33 
34 #endif  // QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_12_ENCRYPTER_H_
35