QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 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 "net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_decrypter.h" |
| 6 | |
| 7 | #include "third_party/boringssl/src/include/openssl/aead.h" |
| 8 | #include "third_party/boringssl/src/include/openssl/tls1.h" |
| 9 | #include "net/third_party/quiche/src/quic/platform/api/quic_flag_utils.h" |
| 10 | #include "net/third_party/quiche/src/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 | |
| 21 | Aes256GcmDecrypter::Aes256GcmDecrypter() |
QUICHE team | 2d18797 | 2019-03-19 16:23:47 -0700 | [diff] [blame] | 22 | : AesBaseDecrypter(EVP_aead_aes_256_gcm, |
| 23 | kKeySize, |
| 24 | kAuthTagSize, |
| 25 | kNonceSize, |
| 26 | /* use_ietf_nonce_construction */ true) { |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 27 | static_assert(kKeySize <= kMaxKeySize, "key size too big"); |
| 28 | static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big"); |
| 29 | } |
| 30 | |
| 31 | Aes256GcmDecrypter::~Aes256GcmDecrypter() {} |
| 32 | |
| 33 | uint32_t Aes256GcmDecrypter::cipher_id() const { |
| 34 | return TLS1_CK_AES_256_GCM_SHA384; |
| 35 | } |
| 36 | |
| 37 | } // namespace quic |