Skip to content

Commit 7926ffd

Browse files
committed
feat(hal): enabled hardware deterministic mode in ESP32H21
1 parent 456ae96 commit 7926ffd

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

components/hal/esp32h21/include/hal/ecdsa_ll.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,6 @@ static inline void ecdsa_ll_set_k_type(ecdsa_sign_type_t type)
242242
}
243243
}
244244

245-
/**
246-
* @brief Set the loop number value that is used for deterministic derivation of K
247-
*
248-
* @param loop_number Loop number for deterministic K
249-
*/
250-
static inline void ecdsa_ll_set_deterministic_loop(uint16_t loop_number)
251-
{
252-
REG_SET_FIELD(ECDSA_CONF_REG, ECDSA_DETERMINISTIC_LOOP, loop_number);
253-
}
254-
255245
/**
256246
* @brief Set the stage of ECDSA operation
257247
*
@@ -409,17 +399,6 @@ static inline int ecdsa_ll_get_operation_result(void)
409399
return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_OPERATION_RESULT);
410400
}
411401

412-
/**
413-
* @brief Check if the k value is greater than the curve order.
414-
*
415-
* @return 0, k value is not greater than the curve order. In this case, the k value is the set k value.
416-
* @return 1, k value is greater than than the curve order. In this case, the k value is the set (k mod n).
417-
*/
418-
static inline int ecdsa_ll_check_k_value(void)
419-
{
420-
return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_K_VALUE_WARNING);
421-
}
422-
423402
/**
424403
* @brief Check if the ECDSA curves configuration is supported
425404
*/

components/soc/esp32h21/include/soc/Kconfig.soc_caps.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,10 @@ config SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE
747747
bool
748748
default y
749749

750+
config SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP
751+
bool
752+
default y
753+
750754
config SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
751755
bool
752756
default y

components/soc/esp32h21/include/soc/soc_caps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,7 @@
488488
/*------------------------- ECDSA CAPS -------------------------*/
489489
#define SOC_ECDSA_SUPPORT_EXPORT_PUBKEY (1)
490490
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
491+
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
491492
#define SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED (1)
492493

493494
/*-------------------------- UART CAPS ---------------------------------------*/

0 commit comments

Comments
 (0)