94 std::array<uint8_t, secret_size>
secret{};
97 std::array<uint8_t, aes_128_key_size>
key{};
100 std::array<uint8_t, aead_iv_size>
iv{};
103 std::array<uint8_t, hp_key_size>
hp_key{};
109 [[nodiscard]]
auto is_valid() const noexcept ->
bool;
114 void clear() noexcept;
121 [[nodiscard]] auto operator==(const
quic_keys& other) const noexcept ->
bool;
126 [[nodiscard]] auto operator!=(const
quic_keys& other) const noexcept ->
bool;
141 [[nodiscard]]
auto is_valid() const noexcept ->
bool;
146 void clear() noexcept;
auto encryption_level_to_string(encryption_level level) -> std::string
Convert encryption level to string for debugging.
constexpr size_t aes_256_key_size
AES-256-GCM key size in bytes.
constexpr size_t secret_size
Traffic secret size (SHA-256 output)
constexpr size_t aead_tag_size
AEAD authentication tag size in bytes.
constexpr size_t hp_sample_size
Header protection sample size.
constexpr size_t aes_128_key_size
AES-128-GCM key size in bytes.
encryption_level
QUIC encryption levels (RFC 9001 Section 4)
@ application
1-RTT application data encryption
@ handshake
Handshake encryption.
@ zero_rtt
0-RTT early data encryption
constexpr auto encryption_level_count() noexcept -> size_t
Get the encryption level count.
constexpr size_t aead_iv_size
AEAD IV/nonce size in bytes.
constexpr size_t hp_key_size
Header protection key size for AES-128.
A pair of read and write keys for bidirectional communication.
quic_keys read
Keys for decrypting received packets.
quic_keys write
Keys for encrypting outgoing packets.
QUIC encryption keys for a single encryption level (RFC 9001 Section 5)
auto is_valid() const noexcept -> bool
Check if keys are initialized (non-zero)
std::array< uint8_t, hp_key_size > hp_key
Header protection key.
void clear() noexcept
Clear all key material securely.
std::array< uint8_t, aes_128_key_size > key
AEAD encryption key (AES-128-GCM by default)
std::array< uint8_t, secret_size > secret
Traffic secret (used for key updates)
std::array< uint8_t, aead_iv_size > iv
AEAD initialization vector.