3.4.2.4 Crypto_Hash_Shake_Digest

crypto_Hash_Status_E Crypto_Hash_Shake_Digest(
    crypto_HandlerType_E shakeHandlerType_en, 
    crypto_Hash_Algo_E shakeAlgorithm_en, 
    uint8_t *ptr_data, 
    uint32_t dataLen, 
    uint8_t *ptr_digest, 
    uint32_t digestLen, 
    uint32_t shakeSessionId
    );

Description

This API performs hash generation for different variants of SHAKE algorithms in a single step without initializing.

Parameters

No.Argument TypeArgument NameTypeDescription
1crypto_HandlerType_EshakeHandlerType_enInputEnum for crypto operation handler i.e., SW, HW
2crypto_Hash_Algo_EshakeAlgorithm_enInputSelection of SHAKE algorithm variant
3uint8_t*ptr_dataInputInput data which digest needs to calculate
4uint32_tdataLenInputLength of the input data in number of bytes
5uint8_t*ptr_digestOutputPointer to store calculated digest
6uint32_tdigestLenInputExpected length of hash/digest input data in number of bytes
7uint32_tshakeSessionIdInputIt defines the session ID, must be more than zero

Returns

Return TypeDescription
crypto_Hash_Status_EFunction returns the status of the API.

Example

#define sessionID 1
crypto_Hash_Status_E status;
crypto_HandlerType_E handlerType_en = CRYPTO_HANDLER_HW_INTERNAL;
crypto_Hash_Algo_E shaAlgorithm_en = CRYPTO_HASH_SHA3_SHAKE128;
uint8_t inputData[32] = {/*data*/};
uint32_t dataLen = sizeof(inputData);
uint8_t outData[64];
uint32_t digestLen = 100;

status = Crypto_Hash_Shake_Digest(
    handlerType_en, 
    shaAlgorithm_en, 
    inputData, 
    dataLen, 
    outData, 
    digestLen, 
    sessionID
    );