2023-06-21 11:00:59 +00:00
|
|
|
/*
|
2023-12-12 15:42:41 +00:00
|
|
|
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
|
2023-06-21 11:00:59 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2021-01-14 07:25:06 +00:00
|
|
|
|
2021-02-25 07:06:41 +00:00
|
|
|
#include "esp_aes_dma_priv.h"
|
2023-10-12 09:21:04 +00:00
|
|
|
#include "esp_crypto_dma.h"
|
2021-02-25 07:06:41 +00:00
|
|
|
#include "esp_crypto_shared_gdma.h"
|
2021-01-14 07:25:06 +00:00
|
|
|
|
2023-10-12 09:21:04 +00:00
|
|
|
esp_err_t esp_aes_dma_start(const crypto_dma_desc_t *input, const crypto_dma_desc_t *output)
|
2021-01-14 07:25:06 +00:00
|
|
|
{
|
2023-10-12 09:21:04 +00:00
|
|
|
return esp_crypto_shared_gdma_start_axi_ahb(input, output, GDMA_TRIG_PERIPH_AES);
|
2021-01-14 07:25:06 +00:00
|
|
|
}
|
|
|
|
|
2023-10-12 09:21:04 +00:00
|
|
|
bool esp_aes_dma_done(const crypto_dma_desc_t *output)
|
2021-01-14 07:25:06 +00:00
|
|
|
{
|
2023-12-12 15:42:41 +00:00
|
|
|
#if SOC_AXI_GDMA_SUPPORTED
|
|
|
|
return esp_crypto_shared_gdma_done();
|
|
|
|
#else
|
2023-10-12 09:21:04 +00:00
|
|
|
return (output->dw0.owner == 0);
|
2023-12-12 15:42:41 +00:00
|
|
|
#endif
|
2021-01-14 07:25:06 +00:00
|
|
|
}
|