feat(hal): enabled hardware deterministic mode in ESP32H21

This commit is contained in:
nilesh.kale
2025-05-27 14:54:13 +05:30
parent 456ae964a1
commit 7926ffd13f
3 changed files with 5 additions and 21 deletions

View File

@@ -242,16 +242,6 @@ static inline void ecdsa_ll_set_k_type(ecdsa_sign_type_t type)
} }
} }
/**
* @brief Set the loop number value that is used for deterministic derivation of K
*
* @param loop_number Loop number for deterministic K
*/
static inline void ecdsa_ll_set_deterministic_loop(uint16_t loop_number)
{
REG_SET_FIELD(ECDSA_CONF_REG, ECDSA_DETERMINISTIC_LOOP, loop_number);
}
/** /**
* @brief Set the stage of ECDSA operation * @brief Set the stage of ECDSA operation
* *
@@ -409,17 +399,6 @@ static inline int ecdsa_ll_get_operation_result(void)
return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_OPERATION_RESULT); return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_OPERATION_RESULT);
} }
/**
* @brief Check if the k value is greater than the curve order.
*
* @return 0, k value is not greater than the curve order. In this case, the k value is the set k value.
* @return 1, k value is greater than than the curve order. In this case, the k value is the set (k mod n).
*/
static inline int ecdsa_ll_check_k_value(void)
{
return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_K_VALUE_WARNING);
}
/** /**
* @brief Check if the ECDSA curves configuration is supported * @brief Check if the ECDSA curves configuration is supported
*/ */

View File

@@ -747,6 +747,10 @@ config SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE
bool bool
default y default y
config SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP
bool
default y
config SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED config SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
bool bool
default y default y

View File

@@ -488,6 +488,7 @@
/*------------------------- ECDSA CAPS -------------------------*/ /*------------------------- ECDSA CAPS -------------------------*/
#define SOC_ECDSA_SUPPORT_EXPORT_PUBKEY (1) #define SOC_ECDSA_SUPPORT_EXPORT_PUBKEY (1)
#define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1) #define SOC_ECDSA_SUPPORT_DETERMINISTIC_MODE (1)
#define SOC_ECDSA_SUPPORT_HW_DETERMINISTIC_LOOP (1)
#define SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED (1) #define SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED (1)
/*-------------------------- UART CAPS ---------------------------------------*/ /*-------------------------- UART CAPS ---------------------------------------*/