mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 12:35:28 +00:00
Merge branch 'esp32p4/add_aes_support' into 'master'
feat: add AES support for ESP32-P4 Closes IDF-6519 See merge request espressif/esp-idf!26429
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include "soc/hwcrypto_reg.h"
|
||||
#include "soc/pcr_struct.h"
|
||||
#include "hal/aes_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -25,6 +26,27 @@ typedef enum {
|
||||
ESP_AES_STATE_DONE, /* Transform completed */
|
||||
} esp_aes_state_t;
|
||||
|
||||
/**
|
||||
* @brief Enable the bus clock for AES peripheral module
|
||||
*
|
||||
* @param enable true to enable the module, false to disable the module
|
||||
*/
|
||||
static inline void aes_ll_enable_bus_clock(bool enable)
|
||||
{
|
||||
PCR.aes_conf.aes_clk_en = enable;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reset the AES peripheral module
|
||||
*/
|
||||
static inline void aes_ll_reset_register(void)
|
||||
{
|
||||
PCR.aes_conf.aes_rst_en = 1;
|
||||
PCR.aes_conf.aes_rst_en = 0;
|
||||
|
||||
// Clear reset on digital signature also, otherwise AES is held in reset
|
||||
PCR.ds_conf.ds_rst_en = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Write the encryption/decryption key to hardware
|
||||
|
Reference in New Issue
Block a user