PSA_ALG_TLS12_PRF macro
Macro to build a TLS-1.2 PRF algorithm. TLS 1.2 uses a custom pseudorandom function (PRF) for key schedule, specified in Section 5 of RFC 5246. It is based on HMAC and can be used with either SHA-256 or SHA-384. This key derivation algorithm uses the following inputs, which must be passed in the order given here: - #PSA_KEY_DERIVATION_INPUT_SEED is the seed. - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret key. - #PSA_KEY_DERIVATION_INPUT_LABEL is the label. For the application to TLS-1.2 key expansion, the seed is the concatenation of ServerHello.Random + ClientHello.Random, and the label is "key expansion". For example, `PSA_ALG_TLS12_PRF(PSA_ALG_SHA_256)` represents the TLS 1.2 PRF using HMAC-SHA-256.
Syntax
#define PSA_ALG_TLS12_PRF(hash_alg) \
(PSA_ALG_TLS12_PRF_BASE | ((hash_alg) & PSA_ALG_HASH_MASK))
Arguments
hash_alg
A hash algorithm (\c PSA_ALG_XXX value such that #PSA_ALG_IS_HASH(\p hash_alg) is true).
Return value
The corresponding TLS-1.2 PRF algorithm. Unspecified if \p hash_alg is not a supported hash algorithm.
![]()
#define PSA_ALG_TLS12_PRF(hash_alg) \