PSA_ALG_PBKDF2_HMAC macro
Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm. PBKDF2 is defined by PKCS#5, republished as RFC 8018 (section 5.2). This macro specifies the PBKDF2 algorithm constructed using a PRF based on HMAC with the specified hash. For example, `PSA_ALG_PBKDF2_HMAC(PSA_ALG_SHA_256)` specifies PBKDF2 using the PRF HMAC-SHA-256. This key derivation algorithm uses the following inputs, which must be provided in the following order: - #PSA_KEY_DERIVATION_INPUT_COST is the iteration count. This input step must be used exactly once. - #PSA_KEY_DERIVATION_INPUT_SALT is the salt. This input step must be used one or more times; if used several times, the inputs will be concatenated. This can be used to build the final salt from multiple sources, both public and secret (also known as pepper). - #PSA_KEY_DERIVATION_INPUT_PASSWORD is the password to be hashed. This input step must be used exactly once.
Syntax
#define PSA_ALG_PBKDF2_HMAC(hash_alg) \
(PSA_ALG_PBKDF2_HMAC_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 PBKDF2-HMAC-XXX algorithm. Unspecified if \p hash_alg is not a supported hash algorithm.
![]()
#define PSA_ALG_PBKDF2_HMAC(hash_alg) \