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 | #ifndef QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_ENCRYPTER_H_ |
| 6 | #define QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_ENCRYPTER_H_ |
| 7 | |
| 8 | #include "base/macros.h" |
| 9 | #include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h" |
| 10 | #include "net/third_party/quiche/src/quic/platform/api/quic_export.h" |
| 11 | |
| 12 | namespace quic { |
| 13 | |
| 14 | // An Aes128GcmEncrypter is a QuicEncrypter that implements the |
| 15 | // AEAD_AES_128_GCM algorithm specified in RFC 5116 for use in IETF QUIC. |
| 16 | // |
| 17 | // It uses an authentication tag of 16 bytes (128 bits). It uses a 12 byte IV |
| 18 | // that is XOR'd with the packet number to compute the nonce. |
| 19 | class QUIC_EXPORT_PRIVATE Aes128GcmEncrypter : public AeadBaseEncrypter { |
| 20 | public: |
| 21 | enum { |
| 22 | kAuthTagSize = 16, |
| 23 | }; |
| 24 | |
| 25 | Aes128GcmEncrypter(); |
| 26 | Aes128GcmEncrypter(const Aes128GcmEncrypter&) = delete; |
| 27 | Aes128GcmEncrypter& operator=(const Aes128GcmEncrypter&) = delete; |
| 28 | ~Aes128GcmEncrypter() override; |
| 29 | }; |
| 30 | |
| 31 | } // namespace quic |
| 32 | |
| 33 | #endif // QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_ENCRYPTER_H_ |