xref: /aosp_15_r20/external/cronet/net/third_party/quiche/src/quiche/quic/core/crypto/aes_256_gcm_decrypter.cc (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 #include "quiche/quic/core/crypto/aes_256_gcm_decrypter.h"
6 
7 #include "openssl/aead.h"
8 #include "openssl/tls1.h"
9 #include "quiche/quic/platform/api/quic_flag_utils.h"
10 #include "quiche/quic/platform/api/quic_flags.h"
11 
12 namespace quic {
13 
14 namespace {
15 
16 const size_t kKeySize = 32;
17 const size_t kNonceSize = 12;
18 
19 }  // namespace
20 
Aes256GcmDecrypter()21 Aes256GcmDecrypter::Aes256GcmDecrypter()
22     : AesBaseDecrypter(EVP_aead_aes_256_gcm, kKeySize, kAuthTagSize, kNonceSize,
23                        /* use_ietf_nonce_construction */ true) {
24   static_assert(kKeySize <= kMaxKeySize, "key size too big");
25   static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big");
26 }
27 
~Aes256GcmDecrypter()28 Aes256GcmDecrypter::~Aes256GcmDecrypter() {}
29 
cipher_id() const30 uint32_t Aes256GcmDecrypter::cipher_id() const {
31   return TLS1_CK_AES_256_GCM_SHA384;
32 }
33 
34 }  // namespace quic
35