33 return std::any_of(
key.begin(),
key.end(), [](uint8_t b) { return b != 0; });
42 std::memset(
const_cast<uint8_t*
>(p), 0,
secret.size());
45 std::memset(
const_cast<uint8_t*
>(p), 0,
key.size());
48 std::memset(
const_cast<uint8_t*
>(p), 0,
iv.size());
51 std::memset(
const_cast<uint8_t*
>(p), 0,
hp_key.size());
56 return secret == other.secret && key == other.key && iv == other.iv &&
57 hp_key == other.hp_key;
62 return !(*
this == other);
auto encryption_level_to_string(encryption_level level) -> std::string
Convert encryption level to string for debugging.
encryption_level
QUIC encryption levels (RFC 9001 Section 4)
@ application
1-RTT application data encryption
@ handshake
Handshake encryption.
@ initial
Initial encryption (derived from DCID)
@ zero_rtt
0-RTT early data encryption
quic_keys read
Keys for decrypting received packets.
auto is_valid() const noexcept -> bool
Check if both read and write keys are valid.
quic_keys write
Keys for encrypting outgoing packets.
void clear() noexcept
Clear all key material securely.
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)
auto operator!=(const quic_keys &other) const noexcept -> bool
Inequality comparison.
auto operator==(const quic_keys &other) const noexcept -> bool
Equality comparison.
std::array< uint8_t, secret_size > secret
Traffic secret (used for key updates)
std::array< uint8_t, aead_iv_size > iv
AEAD initialization vector.