blob: 16d1df1020b380f6e28cc44cb5cb1c1e218952ce [file] [log] [blame]
QUICHE team2d187972019-03-19 16:23:47 -07001// Copyright (c) 2013 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_CHACHA_BASE_ENCRYPTER_H_
6#define QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_
7
8#include <cstddef>
9
10#include "net/third_party/quiche/src/quic/core/crypto/aead_base_encrypter.h"
11#include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
dmcardle904ef182019-12-13 08:34:33 -080012#include "net/third_party/quiche/src/common/platform/api/quiche_string_piece.h"
QUICHE team2d187972019-03-19 16:23:47 -070013
14namespace quic {
15
16class QUIC_EXPORT_PRIVATE ChaChaBaseEncrypter : public AeadBaseEncrypter {
17 public:
18 using AeadBaseEncrypter::AeadBaseEncrypter;
19
dmcardle904ef182019-12-13 08:34:33 -080020 bool SetHeaderProtectionKey(quiche::QuicheStringPiece key) override;
21 std::string GenerateHeaderProtectionMask(
22 quiche::QuicheStringPiece sample) override;
QUICHE team2d187972019-03-19 16:23:47 -070023
24 private:
25 // The key used for packet number encryption.
26 unsigned char pne_key_[kMaxKeySize];
27};
28
29} // namespace quic
30
31#endif // QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_ENCRYPTER_H_