mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-15 06:26:49 +00:00
fix(ecdsa): remove unused k_mode from the ECDSA HAL/LL API
For ESP32-H2 case, the hardware k mode is always enforced through efuse settings (done in startup code). For ESP32-P4 case, the software k mode is not supported in the peripheral itself and code was redundant.
This commit is contained in:
@@ -23,7 +23,6 @@ typedef enum {
|
||||
ECDSA_PARAM_R,
|
||||
ECDSA_PARAM_S,
|
||||
ECDSA_PARAM_Z,
|
||||
ECDSA_PARAM_K,
|
||||
ECDSA_PARAM_QAX,
|
||||
ECDSA_PARAM_QAY
|
||||
} ecdsa_ll_param_t;
|
||||
@@ -199,26 +198,6 @@ static inline void ecdsa_ll_set_curve(ecdsa_curve_t curve)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the source of `K`
|
||||
*
|
||||
* @param mode Mode of K generation
|
||||
*/
|
||||
static inline void ecdsa_ll_set_k_mode(ecdsa_k_mode_t mode)
|
||||
{
|
||||
switch (mode) {
|
||||
case ECDSA_K_USE_TRNG:
|
||||
REG_CLR_BIT(ECDSA_CONF_REG, ECDSA_SOFTWARE_SET_K);
|
||||
break;
|
||||
case ECDSA_K_USER_PROVIDED:
|
||||
REG_SET_BIT(ECDSA_CONF_REG, ECDSA_SOFTWARE_SET_K);
|
||||
break;
|
||||
default:
|
||||
HAL_ASSERT(false && "Unsupported curve");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the source of `Z` (SHA message)
|
||||
*
|
||||
@@ -344,7 +323,6 @@ static inline void ecdsa_ll_write_param(ecdsa_ll_param_t param, const uint8_t *b
|
||||
case ECDSA_PARAM_Z:
|
||||
reg = ECDSA_Z_MEM;
|
||||
break;
|
||||
case ECDSA_PARAM_K:
|
||||
case ECDSA_PARAM_QAX:
|
||||
reg = ECDSA_QAX_MEM;
|
||||
break;
|
||||
@@ -382,7 +360,6 @@ static inline void ecdsa_ll_read_param(ecdsa_ll_param_t param, uint8_t *buf, uin
|
||||
case ECDSA_PARAM_Z:
|
||||
reg = ECDSA_Z_MEM;
|
||||
break;
|
||||
case ECDSA_PARAM_K:
|
||||
case ECDSA_PARAM_QAX:
|
||||
reg = ECDSA_QAX_MEM;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user