mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-15 14:36:45 +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:
@@ -30,22 +30,17 @@ static void configure_ecdsa_periph(ecdsa_hal_config_t *conf)
|
||||
ecdsa_ll_set_curve(conf->curve);
|
||||
|
||||
if (conf->mode != ECDSA_MODE_EXPORT_PUBKEY) {
|
||||
ecdsa_ll_set_k_mode(conf->k_mode);
|
||||
ecdsa_ll_set_z_mode(conf->sha_mode);
|
||||
}
|
||||
}
|
||||
|
||||
void ecdsa_hal_gen_signature(ecdsa_hal_config_t *conf, const uint8_t *k, const uint8_t *hash,
|
||||
void ecdsa_hal_gen_signature(ecdsa_hal_config_t *conf, const uint8_t *hash,
|
||||
uint8_t *r_out, uint8_t *s_out, uint16_t len)
|
||||
{
|
||||
if (len != ECDSA_HAL_P192_COMPONENT_LEN && len != ECDSA_HAL_P256_COMPONENT_LEN) {
|
||||
HAL_ASSERT(false && "Incorrect length");
|
||||
}
|
||||
|
||||
if (conf->k_mode == ECDSA_K_USER_PROVIDED && k == NULL) {
|
||||
HAL_ASSERT(false && "Mismatch in K configuration");
|
||||
}
|
||||
|
||||
if (conf->sha_mode == ECDSA_Z_USER_PROVIDED && hash == NULL) {
|
||||
HAL_ASSERT(false && "Mismatch in SHA configuration");
|
||||
}
|
||||
|
Reference in New Issue
Block a user