Merge branch 'feat/c5_eco2_ecc' into 'master'

feat(hal): add support for ESP32-C5 ECO2 ECC peripheral

See merge request espressif/esp-idf!38729
This commit is contained in:
Mahavir Jain
2025-04-28 12:34:07 +08:00
2 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
@@ -121,11 +121,11 @@ static inline void ecc_ll_set_mode(ecc_mode_t mode)
static inline void ecc_ll_set_curve(ecc_curve_t curve) static inline void ecc_ll_set_curve(ecc_curve_t curve)
{ {
switch(curve) { switch(curve) {
case ECC_CURVE_SECP256R1:
REG_SET_BIT(ECC_MULT_CONF_REG, ECC_MULT_KEY_LENGTH);
break;
case ECC_CURVE_SECP192R1: case ECC_CURVE_SECP192R1:
REG_CLR_BIT(ECC_MULT_CONF_REG, ECC_MULT_KEY_LENGTH); case ECC_CURVE_SECP256R1:
case ECC_CURVE_SECP384R1:
case ECC_CURVE_SM2:
REG_SET_FIELD(ECC_MULT_CONF_REG, ECC_MULT_KEY_LENGTH, curve);
break; break;
default: default:
HAL_ASSERT(false && "Unsupported curve"); HAL_ASSERT(false && "Unsupported curve");

View File

@@ -26,6 +26,8 @@ typedef enum {
typedef enum { typedef enum {
ECC_CURVE_SECP192R1 = 0x0, ECC_CURVE_SECP192R1 = 0x0,
ECC_CURVE_SECP256R1, ECC_CURVE_SECP256R1,
ECC_CURVE_SECP384R1,
ECC_CURVE_SM2,
} ecc_curve_t; } ecc_curve_t;
typedef enum { typedef enum {