quic_hkdf (quic v1.3.1)

View Source

HKDF implementation for QUIC key derivation.

HKDF is used in QUIC/TLS 1.3 for deriving keys from shared secrets. This module implements the Extract-Expand paradigm with SHA-256.

Summary

Functions

HKDF-Expand using SHA-256. Expands a pseudorandom key to the desired length.

HKDF-Expand with specified hash algorithm.

HKDF-Expand-Label for TLS 1.3/QUIC. Label format: "tls13 " ++ Label Context is the additional info (often empty for QUIC).

HKDF-Expand-Label with specified hash algorithm. Implements TLS 1.3 HKDF-Expand-Label (RFC 8446 Section 7.1)

HKDF-Extract using SHA-256. Extracts a pseudorandom key from input keying material. Salt defaults to a string of HashLen zeros if not provided.

HKDF-Extract with specified hash algorithm.

Functions

expand(PRK, Info, Length)

-spec expand(binary(), binary(), non_neg_integer()) -> binary().

HKDF-Expand using SHA-256. Expands a pseudorandom key to the desired length.

expand(Hash, PRK, Info, Length)

-spec expand(atom(), binary(), binary(), non_neg_integer()) -> binary().

HKDF-Expand with specified hash algorithm.

expand_label(Secret, Label, Context, Length)

-spec expand_label(binary(), binary(), binary(), non_neg_integer()) -> binary().

HKDF-Expand-Label for TLS 1.3/QUIC. Label format: "tls13 " ++ Label Context is the additional info (often empty for QUIC).

expand_label(Hash, Secret, Label, Context, Length)

-spec expand_label(atom(), binary(), binary(), binary(), non_neg_integer()) -> binary().

HKDF-Expand-Label with specified hash algorithm. Implements TLS 1.3 HKDF-Expand-Label (RFC 8446 Section 7.1)

extract(Salt, IKM)

-spec extract(binary(), binary()) -> binary().

HKDF-Extract using SHA-256. Extracts a pseudorandom key from input keying material. Salt defaults to a string of HashLen zeros if not provided.

extract(Hash, Salt, IKM)

-spec extract(atom(), binary(), binary()) -> binary().

HKDF-Extract with specified hash algorithm.