/* Initialize the SHA engine for new hash. 
This function sets NEW and MODE fields in SHA Control register to start new hash. */
static status_t cau3_hash_engine_init(CAU3_Type *base, cau3_hash_ctx_internal_t *ctxInternal)
/* Initialize the SHA engine for new hash. 
This function sets NEW and MODE fields in SHA Control register to start new hash. */
static status_t cau3_hash_engine_init(CAU3_Type *base, cau3_hash_ctx_internal_t *ctxInternal)
{
    status_t status;
    status = kStatus_InvalidArgument;
    if (kCAU3_Sha256 == ctxInternal->algo)
    {
        status = CAU3_Sha256InitializeOutput(base, ctxInternal->runningHash, kCAU3_TaskDonePoll);
    }
    if (kCAU3_Sha1 == ctxInternal->algo)
    {
        status = CAU3_Sha1InitializeOutput(base, ctxInternal->runningHash, kCAU3_TaskDonePoll);
    }
    return status;
}