The key derivation function is as specified in [SP800-108] in section "KDF in Counter Mode". The derivation is based on length l, label L, context C and derivation key Ki. AES-CMAC is used as the pseudorandom function (PRF).
- Returns
- SASI_UTIL_OK on success.
-
A non-zero value from ssi_util_error.h on failure.
- Parameters
-
[in] | keyType | The key type that is used as an input to a key derivation function. Can be one of: SASI_UTIL_USER_KEY or SASI_UTIL_ROOT_KEY. |
[in] | pUserKey | A pointer to the user's key buffer (in case of SASI_UTIL_USER_KEY). |
[in] | pLabel | A string that identifies the purpose for the derived keying material. |
[in] | labelSize | The label size should be in range of 1 to 64 bytes length. |
[in] | pContextData | A binary string containing the information related to the derived keying material. |
[in] | contextSize | The context size should be in range of 1 to 64 bytes length. |
[out] | pDerivedKey | Keying material output (MUST be atleast the size of derivedKeySize). |
[in] | derivedKeySize | Size of the derived keying material in bytes (limited to 4080 bytes). |