blob: c650b27f40e40546f4ff0e11c40980811305e2b9 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// Copyright 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/chacha20_poly1305_tls_encrypter.h"
6
7#include "third_party/boringssl/src/include/openssl/evp.h"
8
9namespace quic {
10
11namespace {
12
13const size_t kKeySize = 32;
14const size_t kNonceSize = 12;
15
16} // namespace
17
18ChaCha20Poly1305TlsEncrypter::ChaCha20Poly1305TlsEncrypter()
QUICHE team2d187972019-03-19 16:23:47 -070019 : ChaChaBaseEncrypter(EVP_aead_chacha20_poly1305,
20 kKeySize,
21 kAuthTagSize,
22 kNonceSize,
23 /* use_ietf_nonce_construction */ true) {
QUICHE teama6ef0a62019-03-07 20:34:33 -050024 static_assert(kKeySize <= kMaxKeySize, "key size too big");
25 static_assert(kNonceSize <= kMaxNonceSize, "nonce size too big");
26}
27
28ChaCha20Poly1305TlsEncrypter::~ChaCha20Poly1305TlsEncrypter() {}
29
30} // namespace quic