1 // 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_DECRYPTER_H_ 6 #define QUICHE_QUIC_CORE_CRYPTO_CHACHA_BASE_DECRYPTER_H_ 7 8 #include <cstddef> 9 10 #include "absl/strings/string_view.h" 11 #include "quiche/quic/core/crypto/aead_base_decrypter.h" 12 #include "quiche/quic/platform/api/quic_export.h" 13 14 namespace quic { 15 16 class QUICHE_EXPORT ChaChaBaseDecrypter : public AeadBaseDecrypter { 17 public: 18 using AeadBaseDecrypter::AeadBaseDecrypter; 19 20 bool SetHeaderProtectionKey(absl::string_view key) override; 21 std::string GenerateHeaderProtectionMask( 22 QuicDataReader* sample_reader) override; 23 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_DECRYPTER_H_ 32