|
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 | 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 | HKDF_PRK SHA256_DIGEST |
| pseudorandom key length | |
| #define | HKDF_PRK_384 SHA384_DIGEST |
| pseudorandom key length for the SHA-384 instantiation | |
Functions | |
| void | hkdf_extract (wired_span salt, wired_span ikm, u8 prk[HKDF_PRK]) |
| prk = HKDF-Extract(salt, ikm). | |
| int | hkdf_expand (const u8 prk[HKDF_PRK], wired_span info, wired_mspan okm) |
| okm = HKDF-Expand(prk, info, okm.n). | |
| int | hkdf_expand_label (const u8 prk[HKDF_PRK], const hkdf_label *l, wired_mspan okm) |
| okm = HKDF-Expand-Label(prk, label, context, okm.n) with the "tls13 " prefix. | |
| void | hkdf_extract_384 (wired_span salt, wired_span ikm, u8 prk[HKDF_PRK_384]) |
| prk = HKDF-Extract(salt, ikm) instantiated with HMAC-SHA-384 (RFC 5869 2.2, TLS_AES_256_GCM_SHA384). | |
| int | hkdf_expand_384 (const u8 prk[HKDF_PRK_384], wired_span info, wired_mspan okm) |
| okm = HKDF-Expand(prk, info, okm.n) instantiated with HMAC-SHA-384 (RFC 5869 2.3). | |
| int | hkdf_expand_label_384 (const u8 prk[HKDF_PRK_384], const hkdf_label *l, wired_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 hkdf_expand | ( | const u8 | prk[HKDF_PRK], |
| wired_span | info, | ||
| wired_mspan | okm ) |
okm = HKDF-Expand(prk, info, okm.n).
okm.n must be <= 255*32.
| prk | 32-byte pseudorandom key from hkdf_extract() |
| info | context/application-specific info (may be empty) |
| okm | receives exactly okm.n bytes of output keying material |
| int hkdf_expand_384 | ( | const u8 | prk[HKDF_PRK_384], |
| wired_span | info, | ||
| wired_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 hkdf_extract_384() |
| info | context/application-specific info (may be empty) |
| okm | receives exactly okm.n bytes of output keying material |
| int hkdf_expand_label | ( | const u8 | prk[HKDF_PRK], |
| const hkdf_label * | l, | ||
| wired_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 hkdf_label) |
| okm | receives exactly okm.n bytes of output keying material |
| int hkdf_expand_label_384 | ( | const u8 | prk[HKDF_PRK_384], |
| const hkdf_label * | l, | ||
| wired_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 hkdf_label) |
| okm | receives exactly okm.n bytes of output keying material |
| void hkdf_extract | ( | wired_span | salt, |
| wired_span | ikm, | ||
| u8 | prk[HKDF_PRK] ) |
prk = HKDF-Extract(salt, ikm).
| salt | optional salt (may be empty) |
| ikm | input keying material |
| prk | receives the 32-byte pseudorandom key |
| void hkdf_extract_384 | ( | wired_span | salt, |
| wired_span | ikm, | ||
| u8 | prk[HKDF_PRK_384] ) |
prk = HKDF-Extract(salt, ikm) instantiated with HMAC-SHA-384 (RFC 5869 2.2, TLS_AES_256_GCM_SHA384).
| salt | optional salt (may be empty) |
| ikm | input keying material |
| prk | receives the 48-byte pseudorandom key |