|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -194,11 +194,11 @@ static inline void ecdsa_ll_set_mode(ecdsa_mode_t mode) |
194 | 194 | static inline void ecdsa_ll_set_curve(ecdsa_curve_t curve) |
195 | 195 | { |
196 | 196 | switch (curve) { |
197 | | - case ECDSA_CURVE_SECP256R1: |
198 | | - REG_SET_BIT(ECDSA_CONF_REG, ECDSA_ECC_CURVE); |
199 | | - break; |
200 | 197 | case ECDSA_CURVE_SECP192R1: |
201 | | - REG_CLR_BIT(ECDSA_CONF_REG, ECDSA_ECC_CURVE); |
| 198 | + case ECDSA_CURVE_SECP256R1: |
| 199 | + case ECDSA_CURVE_SECP384R1: |
| 200 | + case ECDSA_CURVE_SM2: |
| 201 | + REG_SET_FIELD(ECDSA_CONF_REG, ECDSA_ECC_CURVE, curve); |
202 | 202 | break; |
203 | 203 | default: |
204 | 204 | HAL_ASSERT(false && "Unsupported curve"); |
@@ -248,16 +248,6 @@ static inline void ecdsa_ll_set_k_type(ecdsa_sign_type_t type) |
248 | 248 | } |
249 | 249 | } |
250 | 250 |
|
251 | | -/** |
252 | | - * @brief Set the loop number value that is used for deterministic derivation of K |
253 | | - * |
254 | | - * @param loop_number Loop number for deterministic K |
255 | | - */ |
256 | | -static inline void ecdsa_ll_set_deterministic_loop(uint16_t loop_number) |
257 | | -{ |
258 | | - REG_SET_FIELD(ECDSA_CONF_REG, ECDSA_DETERMINISTIC_LOOP, loop_number); |
259 | | -} |
260 | | - |
261 | 251 | /** |
262 | 252 | * @brief Set the stage of ECDSA operation |
263 | 253 | * |
@@ -415,17 +405,6 @@ static inline int ecdsa_ll_get_operation_result(void) |
415 | 405 | return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_OPERATION_RESULT); |
416 | 406 | } |
417 | 407 |
|
418 | | -/** |
419 | | - * @brief Check if the k value is greater than the curve order. |
420 | | - * |
421 | | - * @return 0, k value is not greater than the curve order. In this case, the k value is the set k value. |
422 | | - * @return 1, k value is greater than than the curve order. In this case, the k value is the set (k mod n). |
423 | | - */ |
424 | | -static inline int ecdsa_ll_check_k_value(void) |
425 | | -{ |
426 | | - return REG_GET_BIT(ECDSA_RESULT_REG, ECDSA_K_VALUE_WARNING); |
427 | | -} |
428 | | - |
429 | 408 | #ifdef __cplusplus |
430 | 409 | } |
431 | 410 | #endif |
0 commit comments