openHiTLS API openHiTLS 0.1.0-Alpha1

◆ CRYPT_EAL_Hkdf()

int32_t CRYPT_EAL_Hkdf ( CRYPT_MAC_AlgId  id,
const uint8_t *  key,
uint32_t  keyLen,
const uint8_t *  salt,
uint32_t  saltLen,
const uint8_t *  info,
uint32_t  infoLen,
uint8_t *  out,
uint32_t  len 
)

HKDF

参数
id[IN] MAC algorithm ID (Only the HMAC algorithm ID is supported, including CRYPT_MAC_HMAC_SHA1, CRYPT_MAC_HMAC_SHA224, CRYPT_MAC_HMAC_SHA256, CRYPT_MAC_HMAC_SHA384, CRYPT_MAC_HMAC_SHA512)
key[IN] Password, a string input by the user.
keyLen[IN] Key length, any length
salt[IN] Salt value, a string input by the user.
saltLen[IN] Salt length, any length
info[IN] Additional information about the user, which is optional.
infoLen[IN] Length of the additional information. The value can be 0. [0,0xFFFFFFFF]
out[OUT] Derive the key.
len[IN] Derived key length, any integer other than 0. The maximum value is as follows: The maximum value of CRYPT_MAC_HMAC_SHA1 is 5100. The maximum value of CRYPT_MAC_HMAC_SHA224 is 7140. The maximum value of CRYPT_MAC_HMAC_SHA256 is 8160. The maximum value of CRYPT_MAC_HMAC_SHA384 is 12240. The maximum value of CRYPT_MAC_HMAC_SHA512 is 16320.
返回值
CRYPT_SUCCESS,ifsuccess. Other error codes see the crypt_errno.h