/* Read OUTDATA registers. 
This function copies OUTDATA to output buffer. */
static void hashcrypt_get_data(HASHCRYPT_Type *base, uint32_t *output, size_t outputSize)
/* Read OUTDATA registers. 
This function copies OUTDATA to output buffer. */
static void hashcrypt_get_data(HASHCRYPT_Type *base, uint32_t *output, size_t outputSize)
{
    uint32_t digest[8];
    while (0U == (base->STATUS & HASHCRYPT_STATUS_DIGEST_MASK))
    {
    }
    for (int i = 0; i < 8; i++)
    {
        digest[i] = swap_bytes(base->DIGEST0[i]);
    }
    if (outputSize > sizeof(digest))
    {
        outputSize = sizeof(digest);
    }
    (void)hashcrypt_memcpy(output, digest, outputSize);
}