PSA_ALG_HKDF macro
Macro to build an HKDF algorithm. For example, `PSA_ALG_HKDF(PSA_ALG_SHA_256)` is HKDF using HMAC-SHA-256. This key derivation algorithm uses the following inputs: - #PSA_KEY_DERIVATION_INPUT_SALT is the salt used in the "extract" step. It is optional; if omitted, the derivation uses an empty salt. - #PSA_KEY_DERIVATION_INPUT_SECRET is the secret key used in the "extract" step. - #PSA_KEY_DERIVATION_INPUT_INFO is the info string used in the "expand" step. You must pass #PSA_KEY_DERIVATION_INPUT_SALT before #PSA_KEY_DERIVATION_INPUT_SECRET. You may pass #PSA_KEY_DERIVATION_INPUT_INFO at any time after steup and before starting to generate output. \warning HKDF processes the salt as follows: first hash it with hash_alg if the salt is longer than the block size of the hash algorithm; then pad with null bytes up to the block size. As a result, it is possible for distinct salt inputs to result in the same outputs. To ensure unique outputs, it is recommended to use a fixed length for salt values.
Syntax
#define PSA_ALG_HKDF(hash_alg) \
(PSA_ALG_HKDF_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 HKDF algorithm. Unspecified if \p hash_alg is not a supported hash algorithm.
![]()
#define PSA_ALG_HKDF(hash_alg) \