mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-15 19:34:03 +00:00
AES: refactor and add HAL layer
Refactor the AES driver and add HAL, LL and caps. Add better support for running AES-GCM fully in hardware.
This commit is contained in:
@@ -23,18 +23,16 @@
|
||||
#ifndef GCM_ALT_H
|
||||
#define GCM_ALT_H
|
||||
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_GCM_ALT)
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "esp32s3/gcm.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "esp32c3/gcm.h"
|
||||
#endif
|
||||
#if SOC_AES_SUPPORT_GCM
|
||||
#include "aes/esp_aes_gcm.h"
|
||||
|
||||
|
||||
typedef esp_gcm_context mbedtls_gcm_context;
|
||||
@@ -48,24 +46,7 @@ typedef esp_gcm_context mbedtls_gcm_context;
|
||||
#define mbedtls_gcm_auth_decrypt esp_aes_gcm_auth_decrypt
|
||||
#define mbedtls_gcm_crypt_and_tag esp_aes_gcm_crypt_and_tag
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32S3 || CONFIG_IDF_TARGET_ESP32C3
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S2
|
||||
#include "esp32s2/gcm.h"
|
||||
|
||||
|
||||
typedef esp_gcm_context mbedtls_gcm_context;
|
||||
|
||||
#define mbedtls_gcm_init esp_aes_gcm_init
|
||||
#define mbedtls_gcm_free esp_aes_gcm_free
|
||||
#define mbedtls_gcm_setkey esp_aes_gcm_setkey
|
||||
#define mbedtls_gcm_starts esp_aes_gcm_starts
|
||||
#define mbedtls_gcm_update esp_aes_gcm_update
|
||||
#define mbedtls_gcm_finish esp_aes_gcm_finish
|
||||
#define mbedtls_gcm_auth_decrypt esp_aes_gcm_auth_decrypt
|
||||
#define mbedtls_gcm_crypt_and_tag esp_aes_gcm_crypt_and_tag
|
||||
|
||||
#endif // CONFIG_IDF_TARGET_ESP32S2
|
||||
#endif // SOC_AES_SUPPORT_GCM
|
||||
|
||||
#endif /* MBEDTLS_GCM_ALT */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user