# `Quic.Protection`
[🔗](https://github.com/gsmlg-dev/http_fetch/blob/v1.0.0-rc.9/apps/elixir_quic/lib/quic/protection.ex#L1)

QUIC v1 Initial packet protection primitives.

# `aead_decrypt`

# `aead_encrypt`

# `header_protection_mask`

```elixir
@spec header_protection_mask(
  binary(),
  binary(),
  :aes_128_gcm | :aes_256_gcm | :chacha20_poly1305
) ::
  {:ok, binary()} | {:error, atom()}
```

# `initial_secrets`

```elixir
@spec initial_secrets(binary(), :client | :server) :: {:ok, map()} | {:error, atom()}
```

# `packet_keys`

```elixir
@spec packet_keys(atom(), non_neg_integer(), atom(), atom(), binary()) ::
  {:ok, map()} | {:error, term()}
```

Derive QUIC Handshake/Application packet protection keys from a TLS secret.

# `remove_header_protection`

```elixir
@spec remove_header_protection(
  binary(),
  non_neg_integer(),
  binary(),
  :aes_128_gcm | :chacha20_poly1305
) ::
  {:ok, binary(), non_neg_integer()} | {:error, atom()}
```

Removes QUIC header protection from a packet prefix and packet number bytes.

# `retry_tag`

```elixir
@spec retry_tag(binary(), binary()) :: {:ok, binary()} | {:error, atom()}
```

# `validate_retry`

```elixir
@spec validate_retry(binary(), binary()) :: :ok | {:error, atom()}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
