CryptoCell utility key derivation APIs

nRF5 SDK v17.1.0

Functions

SaSiUtilError_t SaSi_UtilKeyDerivation ( SaSiUtilKeyType_t keyType, SaSiAesUserKeyData_t *pUserKey, const uint8_t *pLabel, size_t labelSize, const uint8_t *pContextData, size_t contextSize, uint8_t *pDerivedKey, size_t derivedKeySize)
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). More...

Detailed Description

Enumeration Type Documentation

Input key derivation type.

Enumerator
SASI_UTIL_USER_KEY

User's key.

SASI_UTIL_ROOT_KEY

Root key (Kdr).

SASI_UTIL_END_OF_KEY_TYPE

Reserved.

Function Documentation

SaSiUtilError_t SaSi_UtilKeyDerivation ( SaSiUtilKeyType_t keyType ,
SaSiAesUserKeyData_t * pUserKey ,
const uint8_t * pLabel ,
size_t labelSize ,
const uint8_t * pContextData ,
size_t contextSize ,
uint8_t * pDerivedKey ,
size_t derivedKeySize
)

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).