mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
esp_hw_support: cleanup crypto lock APIs for ESP32-C2
This commit is contained in:
parent
0621a6f513
commit
f7fc3e2d88
@ -10,58 +10,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
// Place-holder lock APIs as hardware AES is not supported in ESP32-C2
|
||||||
* @brief Acquire lock for HMAC cryptography peripheral
|
static inline void esp_crypto_sha_aes_lock_acquire(void) {}
|
||||||
*
|
static inline void esp_crypto_sha_aes_lock_release(void) {}
|
||||||
* Internally also locks the SHA peripheral, as the HMAC depends on the SHA peripheral
|
|
||||||
*/
|
|
||||||
void esp_crypto_hmac_lock_acquire(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Release lock for HMAC cryptography peripheral
|
|
||||||
*
|
|
||||||
* Internally also releases the SHA peripheral, as the HMAC depends on the SHA peripheral
|
|
||||||
*/
|
|
||||||
void esp_crypto_hmac_lock_release(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Acquire lock for DS cryptography peripheral
|
|
||||||
*
|
|
||||||
* Internally also locks the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals
|
|
||||||
*/
|
|
||||||
void esp_crypto_ds_lock_acquire(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Release lock for DS cryptography peripheral
|
|
||||||
*
|
|
||||||
* Internally also releases the HMAC (which locks SHA), AES and MPI peripheral, as the DS depends on these peripherals
|
|
||||||
*/
|
|
||||||
void esp_crypto_ds_lock_release(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Acquire lock for the SHA and AES cryptography peripheral.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void esp_crypto_sha_aes_lock_acquire(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Release lock for the SHA and AES cryptography peripheral.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void esp_crypto_sha_aes_lock_release(void);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Acquire lock for the mpi cryptography peripheral.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void esp_crypto_mpi_lock_acquire(void);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Release lock for the mpi/rsa cryptography peripheral.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
void esp_crypto_mpi_lock_release(void);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@ set(srcs "cpu_util_esp32c2.c"
|
|||||||
|
|
||||||
if(NOT BOOTLOADER_BUILD)
|
if(NOT BOOTLOADER_BUILD)
|
||||||
list(APPEND srcs "../async_memcpy_impl_gdma.c"
|
list(APPEND srcs "../async_memcpy_impl_gdma.c"
|
||||||
"esp_crypto_lock.c"
|
|
||||||
"dport_access.c")
|
"dport_access.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <sys/lock.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include "esp_crypto_lock.h"
|
|
||||||
|
|
||||||
/* Lock overview:
|
|
||||||
SHA: peripheral independent, but DMA is shared with AES
|
|
||||||
AES: peripheral independent, but DMA is shared with SHA
|
|
||||||
MPI/RSA: independent
|
|
||||||
HMAC: needs SHA
|
|
||||||
DS: needs HMAC (which needs SHA), AES and MPI
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if 0 // TODO: IDF-4229
|
|
||||||
/* Lock for DS peripheral */
|
|
||||||
static _lock_t s_crypto_ds_lock;
|
|
||||||
|
|
||||||
/* Lock for HMAC peripheral */
|
|
||||||
static _lock_t s_crypto_hmac_lock;
|
|
||||||
|
|
||||||
/* Lock for the MPI/RSA peripheral, also used by the DS peripheral */
|
|
||||||
static _lock_t s_crypto_mpi_lock;
|
|
||||||
|
|
||||||
/* Single lock for SHA and AES, sharing a reserved GDMA channel */
|
|
||||||
static _lock_t s_crypto_sha_aes_lock;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void esp_crypto_hmac_lock_acquire(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_hmac_lock_release(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_ds_lock_acquire(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_ds_lock_release(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_sha_aes_lock_acquire(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_sha_aes_lock_release(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_mpi_lock_acquire(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
||||||
|
|
||||||
void esp_crypto_mpi_lock_release(void)
|
|
||||||
{
|
|
||||||
abort(); // TODO: IDF-4229
|
|
||||||
}
|
|
@ -15,8 +15,6 @@
|
|||||||
#include "esp32h2/rom/digital_signature.h"
|
#include "esp32h2/rom/digital_signature.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||||
#include "esp32s3/rom/digital_signature.h"
|
#include "esp32s3/rom/digital_signature.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32C2
|
|
||||||
#include "esp32c2/rom/digital_signature.h"
|
|
||||||
#else
|
#else
|
||||||
#error "Selected target does not support esp_rsa_sign_alt (for DS)"
|
#error "Selected target does not support esp_rsa_sign_alt (for DS)"
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user