2023-10-30 05:48:45 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-10-12 05:21:04 -04:00
|
|
|
#include <stdbool.h>
|
2023-10-30 05:48:45 -04:00
|
|
|
#include "aes/esp_aes.h"
|
|
|
|
#include "soc/soc_caps.h"
|
2023-10-12 05:21:04 -04:00
|
|
|
#include "esp_crypto_dma.h"
|
2023-10-30 05:48:45 -04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
bool valid_key_length(const esp_aes_context *ctx);
|
|
|
|
|
|
|
|
#if SOC_AES_SUPPORT_GCM
|
|
|
|
/**
|
|
|
|
* @brief Run a AES-GCM conversion using DMA
|
|
|
|
*
|
|
|
|
* @param ctx Aes context
|
|
|
|
* @param input Pointer to input data
|
|
|
|
* @param output Pointer to output data
|
|
|
|
* @param len Length of the input data
|
|
|
|
* @param aad_desc GCM additional data DMA descriptor
|
|
|
|
* @param aad_len GCM additional data length
|
|
|
|
* @return int -1 on error
|
|
|
|
*/
|
2023-10-12 05:21:04 -04:00
|
|
|
int esp_aes_process_dma_gcm(esp_aes_context *ctx, const unsigned char *input, unsigned char *output, size_t len, crypto_dma_desc_t *aad_desc, size_t aad_len);
|
2023-10-30 05:48:45 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|