37 #define TRACE_LEVEL CRYPTO_TRACE_LEVEL
45 #if (CONCAT_KDF_SUPPORT == ENABLED)
61 const uint8_t *otherInfo,
size_t otherInfoLen, uint8_t *dk,
size_t dkLen)
66 #if (CRYPTO_STATIC_MEM_SUPPORT == DISABLED)
73 if(hash == NULL ||
z == NULL || dk == NULL)
77 if(otherInfo == NULL && otherInfoLen != 0)
80 #if (CRYPTO_STATIC_MEM_SUPPORT == DISABLED)
84 if(hashContext == NULL)
89 for(i = 1; dkLen > 0; i++)
95 hash->
init(hashContext);
96 hash->
update(hashContext, counter,
sizeof(uint32_t));
97 hash->
update(hashContext,
z, zLen);
102 hash->
update(hashContext, otherInfo, otherInfoLen);
106 hash->
final(hashContext, NULL);
118 #if (CRYPTO_STATIC_MEM_SUPPORT == DISABLED)
error_t concatKdf(const HashAlgo *hash, const uint8_t *z, size_t zLen, const uint8_t *otherInfo, size_t otherInfoLen, uint8_t *dk, size_t dkLen)
Concat KDF key derivation function.
General definitions for cryptographic algorithms.
#define cryptoAllocMem(size)
@ ERROR_INVALID_PARAMETER
Invalid parameter.
HMAC (Keyed-Hashing for Message Authentication)
#define osMemcpy(dest, src, length)
PBKDF (Password-Based Key Derivation Function)
Common interface for hash algorithms.
Generic hash algorithm context.
uint8_t digest[MAX_HASH_DIGEST_SIZE]