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:
Mahavir Jain
2023-11-03 15:51:05 +05:30
parent d3b4acf7a0
commit f434d21f4a
7 changed files with 4 additions and 69 deletions

View File

@@ -50,7 +50,6 @@ static int test_ecdsa_verify(bool is_p256, uint8_t* sha, uint8_t* r_le, uint8_t*
ecdsa_hal_config_t conf = {
.mode = ECDSA_MODE_SIGN_VERIFY,
.k_mode = ECDSA_K_USE_TRNG,
.sha_mode = ECDSA_Z_USER_PROVIDED,
};
@@ -119,7 +118,6 @@ static void test_ecdsa_sign(bool is_p256, uint8_t* sha, uint8_t* r_le, uint8_t*
ecdsa_hal_config_t conf = {
.mode = ECDSA_MODE_SIGN_GEN,
.k_mode = ECDSA_K_USE_TRNG,
.sha_mode = ECDSA_Z_USER_PROVIDED,
.use_km_key = use_km_key,
};
@@ -144,7 +142,7 @@ static void test_ecdsa_sign(bool is_p256, uint8_t* sha, uint8_t* r_le, uint8_t*
ecdsa_enable_and_reset();
do {
ecdsa_hal_gen_signature(&conf, NULL, sha_le, r_le, s_le, len);
ecdsa_hal_gen_signature(&conf, sha_le, r_le, s_le, len);
} while(!memcmp(r_le, zeroes, len) || !memcmp(s_le, zeroes, len));
ecdsa_disable();