QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // 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 | #ifndef QUICHE_QUIC_CORE_CRYPTO_CHACHA20_POLY1305_TLS_ENCRYPTER_H_ |
| 6 | #define QUICHE_QUIC_CORE_CRYPTO_CHACHA20_POLY1305_TLS_ENCRYPTER_H_ |
| 7 | |
QUICHE team | 2d18797 | 2019-03-19 16:23:47 -0700 | [diff] [blame] | 8 | #include "net/third_party/quiche/src/quic/core/crypto/chacha_base_encrypter.h" |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 9 | #include "net/third_party/quiche/src/quic/platform/api/quic_export.h" |
| 10 | |
| 11 | namespace quic { |
| 12 | |
| 13 | // A ChaCha20Poly1305Encrypter is a QuicEncrypter that implements the |
| 14 | // AEAD_CHACHA20_POLY1305 algorithm specified in RFC 7539 for use in IETF QUIC. |
| 15 | // |
| 16 | // It uses an authentication tag of 16 bytes (128 bits). It uses a 12 byte IV |
| 17 | // that is XOR'd with the packet number to compute the nonce. |
| 18 | class QUIC_EXPORT_PRIVATE ChaCha20Poly1305TlsEncrypter |
QUICHE team | 2d18797 | 2019-03-19 16:23:47 -0700 | [diff] [blame] | 19 | : public ChaChaBaseEncrypter { |
QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 20 | public: |
| 21 | enum { |
| 22 | kAuthTagSize = 16, |
| 23 | }; |
| 24 | |
| 25 | ChaCha20Poly1305TlsEncrypter(); |
| 26 | ChaCha20Poly1305TlsEncrypter(const ChaCha20Poly1305TlsEncrypter&) = delete; |
| 27 | ChaCha20Poly1305TlsEncrypter& operator=(const ChaCha20Poly1305TlsEncrypter&) = |
| 28 | delete; |
| 29 | ~ChaCha20Poly1305TlsEncrypter() override; |
| 30 | }; |
| 31 | |
| 32 | } // namespace quic |
| 33 | |
| 34 | #endif // QUICHE_QUIC_CORE_CRYPTO_CHACHA20_POLY1305_TLS_ENCRYPTER_H_ |