blob: a5f09e5d61709e5adac0a7a7485b73c1eb3a4ec1 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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
12namespace quic {
13
14namespace {
15
16const size_t kKeySize = 32;
17const size_t kNonceSize = 12;
18
19} // namespace
20
21Aes256GcmDecrypter::Aes256GcmDecrypter()
QUICHE team2d187972019-03-19 16:23:47 -070022 : AesBaseDecrypter(EVP_aead_aes_256_gcm,
23 kKeySize,
24 kAuthTagSize,
25 kNonceSize,
26 /* use_ietf_nonce_construction */ true) {
QUICHE teama6ef0a62019-03-07 20:34:33 -050027 static_assert(kKeySize <= kMaxKeySize, "key size too big");
28 static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big");
29}
30
31Aes256GcmDecrypter::~Aes256GcmDecrypter() {}
32
33uint32_t Aes256GcmDecrypter::cipher_id() const {
34 return TLS1_CK_AES_256_GCM_SHA384;
35}
36
37} // namespace quic