mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 03:00:34 +03:00
feat(esp32p4): Support newer Key Manager key sources for ESP32-P4 V3
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -15,8 +15,9 @@
|
||||
#include "soc/chip_revision.h"
|
||||
#endif
|
||||
|
||||
#if SOC_KEY_MANAGER_SUPPORTED && SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY
|
||||
#if SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY
|
||||
#include "hal/key_mgr_hal.h"
|
||||
#include "hal/key_mgr_ll.h"
|
||||
#endif
|
||||
|
||||
#define ECDSA_HAL_P192_COMPONENT_LEN 24
|
||||
@@ -29,9 +30,14 @@ static void configure_ecdsa_periph(ecdsa_hal_config_t *conf)
|
||||
{
|
||||
|
||||
if (conf->use_km_key == 0) {
|
||||
|
||||
efuse_hal_set_ecdsa_key(conf->curve, conf->efuse_key_blk);
|
||||
|
||||
#if SOC_KEY_MANAGER_SUPPORTED && SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY
|
||||
#if SOC_KEY_MANAGER_ECDSA_KEY_DEPLOY
|
||||
if (!key_mgr_ll_is_supported()) {
|
||||
HAL_ASSERT(false && "Key manager is not supported");
|
||||
}
|
||||
|
||||
// Force Key Manager to use eFuse key for XTS-AES operation
|
||||
if (conf->curve == ECDSA_CURVE_SECP192R1) {
|
||||
key_mgr_hal_set_key_usage(ESP_KEY_MGR_ECDSA_192_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
|
||||
|
||||
Reference in New Issue
Block a user