|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
RFC 5869 HKDF over HMAC-SHA-256, plus the TLS 1.3 / QUIC HKDF-Expand-Label construction (RFC 8446 7.1, RFC 9001 5.1). More...
#include "crypto/symmetric/hash/hash/hmac.h"Go to the source code of this file.
Data Structures | |
| struct | quic_hkdf_label |
| HkdfLabel inputs (RFC 8446 7.1): the label (without the "tls13 " prefix) and the context (may be empty: {0, 0}). More... | |
Macros | |
| #define | QUIC_HKDF_PRK QUIC_SHA256_DIGEST |
| pseudorandom key length | |
| #define | QUIC_HKDF_PRK_384 QUIC_SHA384_DIGEST |
| pseudorandom key length for the SHA-384 instantiation | |
Functions | |
| void | quic_hkdf_extract (quic_span salt, quic_span ikm, u8 prk[QUIC_HKDF_PRK]) |
| prk = HKDF-Extract(salt, ikm). | |
| int | quic_hkdf_expand (const u8 prk[QUIC_HKDF_PRK], quic_span info, quic_mspan okm) |
| okm = HKDF-Expand(prk, info, okm.n). | |
| int | quic_hkdf_expand_label (const u8 prk[QUIC_HKDF_PRK], const quic_hkdf_label *l, quic_mspan okm) |
| okm = HKDF-Expand-Label(prk, label, context, okm.n) with the "tls13 " prefix. | |
| void | quic_hkdf_extract_384 (quic_span salt, quic_span ikm, u8 prk[QUIC_HKDF_PRK_384]) |
| prk = HKDF-Extract(salt, ikm) instantiated with HMAC-SHA-384 (RFC 5869 2.2, TLS_AES_256_GCM_SHA384). | |
| int | quic_hkdf_expand_384 (const u8 prk[QUIC_HKDF_PRK_384], quic_span info, quic_mspan okm) |
| okm = HKDF-Expand(prk, info, okm.n) instantiated with HMAC-SHA-384 (RFC 5869 2.3). | |
| int | quic_hkdf_expand_label_384 (const u8 prk[QUIC_HKDF_PRK_384], const quic_hkdf_label *l, quic_mspan okm) |
| okm = HKDF-Expand-Label(prk, label, context, okm.n) with the "tls13 " prefix, instantiated with HMAC-SHA-384 (RFC 8446 7.1, RFC 9001 5.1). | |
RFC 5869 HKDF over HMAC-SHA-256, plus the TLS 1.3 / QUIC HKDF-Expand-Label construction (RFC 8446 7.1, RFC 9001 5.1).
| int quic_hkdf_expand | ( | const u8 | prk[QUIC_HKDF_PRK], |
| quic_span | info, | ||
| quic_mspan | okm ) |
okm = HKDF-Expand(prk, info, okm.n).
okm.n must be <= 255*32.
| prk | 32-byte pseudorandom key from quic_hkdf_extract() |
| info | context/application-specific info (may be empty) |
| okm | receives exactly okm.n bytes of output keying material |
| int quic_hkdf_expand_384 | ( | const u8 | prk[QUIC_HKDF_PRK_384], |
| quic_span | info, | ||
| quic_mspan | okm ) |
okm = HKDF-Expand(prk, info, okm.n) instantiated with HMAC-SHA-384 (RFC 5869 2.3).
okm.n must be <= 255*48.
| prk | 48-byte pseudorandom key from quic_hkdf_extract_384() |
| info | context/application-specific info (may be empty) |
| okm | receives exactly okm.n bytes of output keying material |
| int quic_hkdf_expand_label | ( | const u8 | prk[QUIC_HKDF_PRK], |
| const quic_hkdf_label * | l, | ||
| quic_mspan | okm ) |
okm = HKDF-Expand-Label(prk, label, context, okm.n) with the "tls13 " prefix.
| prk | 32-byte pseudorandom key |
| l | label and context inputs (see quic_hkdf_label) |
| okm | receives exactly okm.n bytes of output keying material |
| int quic_hkdf_expand_label_384 | ( | const u8 | prk[QUIC_HKDF_PRK_384], |
| const quic_hkdf_label * | l, | ||
| quic_mspan | okm ) |
okm = HKDF-Expand-Label(prk, label, context, okm.n) with the "tls13 " prefix, instantiated with HMAC-SHA-384 (RFC 8446 7.1, RFC 9001 5.1).
| prk | 48-byte pseudorandom key |
| l | label and context inputs (see quic_hkdf_label) |
| okm | receives exactly okm.n bytes of output keying material |
prk = HKDF-Extract(salt, ikm).
| salt | optional salt (may be empty) |
| ikm | input keying material |
| prk | receives the 32-byte pseudorandom key |