summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quic/core/crypto/aes_256_gcm_encrypter.h
blob: 0e4582263759cbf84f17ca7e4a796d9823a1b6c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef QUICHE_QUIC_CORE_CRYPTO_AES_256_GCM_ENCRYPTER_H_
#define QUICHE_QUIC_CORE_CRYPTO_AES_256_GCM_ENCRYPTER_H_

#include "net/third_party/quiche/src/quic/core/crypto/aes_base_encrypter.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"

namespace quic {

// An Aes256GcmEncrypter is a QuicEncrypter that implements the
// AEAD_AES_256_GCM algorithm specified in RFC 5116 for use in IETF QUIC.
//
// It uses an authentication tag of 16 bytes (128 bits). It uses a 12 byte IV
// that is XOR'd with the packet number to compute the nonce.
class QUIC_EXPORT_PRIVATE Aes256GcmEncrypter : public AesBaseEncrypter {
 public:
  enum {
    kAuthTagSize = 16,
  };

  Aes256GcmEncrypter();
  Aes256GcmEncrypter(const Aes256GcmEncrypter&) = delete;
  Aes256GcmEncrypter& operator=(const Aes256GcmEncrypter&) = delete;
  ~Aes256GcmEncrypter() override;
};

}  // namespace quic

#endif  // QUICHE_QUIC_CORE_CRYPTO_AES_256_GCM_ENCRYPTER_H_