blob: 6ddbe01e5aaaaf686e335af1ed8f5417f6c0f06f [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#ifndef QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_DECRYPTER_H_
6#define QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_DECRYPTER_H_
7
8#include <cstdint>
9
QUICHE team2d187972019-03-19 16:23:47 -070010#include "net/third_party/quiche/src/quic/core/crypto/aes_base_decrypter.h"
QUICHE teama6ef0a62019-03-07 20:34:33 -050011#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
12
13namespace quic {
14
15// An Aes128GcmDecrypter is a QuicDecrypter that implements the
16// AEAD_AES_128_GCM algorithm specified in RFC 5116 for use in IETF QUIC.
17//
18// It uses an authentication tag of 16 bytes (128 bits). It uses a 12 byte IV
19// that is XOR'd with the packet number to compute the nonce.
QUICHE team2d187972019-03-19 16:23:47 -070020class QUIC_EXPORT_PRIVATE Aes128GcmDecrypter : public AesBaseDecrypter {
QUICHE teama6ef0a62019-03-07 20:34:33 -050021 public:
22 enum {
23 kAuthTagSize = 16,
24 };
25
26 Aes128GcmDecrypter();
27 Aes128GcmDecrypter(const Aes128GcmDecrypter&) = delete;
28 Aes128GcmDecrypter& operator=(const Aes128GcmDecrypter&) = delete;
29 ~Aes128GcmDecrypter() override;
30
31 uint32_t cipher_id() const override;
32};
33
34} // namespace quic
35
36#endif // QUICHE_QUIC_CORE_CRYPTO_AES_128_GCM_DECRYPTER_H_