3.7.2.4 Crypto_Hash_Ripemd160_Final

crypto_Hash_Status_E Crypto_Hash_Ripemd160_Final(
    st_Crypto_Hash_Ripemd160_Ctx *ptr_ripemdCtx_st, 
    uint8_t *ptr_digest
    );

Description

This API is used to get the calculated hash/digest for RIPEMD-160 algorithm in multi-steps. Initialize context by calling Crypto_Hash_Ripemd160_Init function and calculate hash using Crypto_Hash_Ripemd160_Update and then call this function.

Parameters

No.Argument TypeArgument NameTypeDescription
1st_Crypto_Hash_Ripemd160_Ctx*ptr_ripemdCtx_stInputHash algorithm and crypto handler context
2uint8_t*ptr_digestOutputPointer to store calculated digest

Returns

Return TypeDescription
crypto_Hash_Status_EFunction returns the status of the API.

Example

crypto_HandlerType_E status;

Example

#define sessionID 1
crypto_Hash_Status_E status;
crypto_HandlerType_E handlerType_en = CRYPTO_HANDLER_HW_INTERNAL;
st_Crypto_Hash_Ripemd160_Ctx Hash_Ctx;
uint8_t inputData[32] = {/*data*/};
uint32_t dataLen = sizeof(inputData);
uint8_t digest[64];

status = Crypto_Hash_Ripemd160_Init(
    &Hash_Ctx, 
    handlerType_en, 
    sessionID
    );

status =  Crypto_Hash_Ripemd160_Update(
    &Hash_Ctx, 
    inputData, 
    dataLen
    ); 

status = Crypto_Hash_Ripemd160_Final(
    &Hash_Ctx, 
    digest
    );