/* Config the HASH peripheral according to the specified parameters in the hashConfig.  */
void HASH_Config(HASH_Config_T *hashConfig)
/* Config the HASH peripheral according to the specified parameters in the hashConfig.  */
void HASH_Config(HASH_Config_T *hashConfig)
{
    HASH->CTRL_B.ALGSEL = RESET;
    HASH->CTRL_B.DTYPE = RESET;
    HASH->CTRL_B.MODESEL = RESET;
    HASH->CTRL_B.ALGSEL = hashConfig->algoSelect;
    HASH->CTRL_B.DTYPE = hashConfig->dataType;
    HASH->CTRL_B.MODESEL = hashConfig->algoMode;
    if (hashConfig->algoMode == HASH_ALGO_MODE_HMAC)
    {
        HASH->CTRL_B.LKEYSEL = RESET;
        HASH->CTRL_B.LKEYSEL = hashConfig->hmacKeyType;
    }
    HASH->CTRL_B.INITCAL = SET;
}