/* param base BEE peripheral address. param region Selection of the BEE region to be configured. param nonce AES nonce (in little-endian format). param nonceSize Size of AES nonce.  */
status_t BEE_SetRegionNonce(BEE_Type *base, bee_region_t region, const uint8_t *nonce, size_t nonceSize)
/* param base BEE peripheral address. param region Selection of the BEE region to be configured. param nonce AES nonce (in little-endian format). param nonceSize Size of AES nonce.  */
status_t BEE_SetRegionNonce(BEE_Type *base, bee_region_t region, const uint8_t *nonce, size_t nonceSize)
{
    if ((0U != ((uintptr_t)nonce & 0x3u)) || (nonceSize != 16U))
    {
        return kStatus_InvalidArgument;
    }
    while (0U == (BEE_GetStatusFlags(base) & (uint32_t)kBEE_IdleFlag))
    {
    }
    if (region == kBEE_Region0)
    {
        aligned_memcpy((uint32_t *)(uint32_t)&base->CTR_NONCE0_W0, nonce, nonceSize);
    }
    else if (region == kBEE_Region1)
    {
        aligned_memcpy((uint32_t *)(uint32_t)&base->CTR_NONCE1_W0, nonce, nonceSize);
    }
    else
    {
        return kStatus_InvalidArgument;
    }
    return kStatus_Success;
}