mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(sha): add sha_hal_is_sm3_supported()
Report whether the SHA peripheral can run the SM3 mode. The LL function sha_ll_is_sm3_supported() exists on every chip. ESP32-S31 reads the DIS_SM_CRYPT eFuse, which disables SM2 and SM3 permanently. ESP32-C5 and ESP32-H4 have SM3 but no such eFuse. All other chips have no SM3.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2020-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -195,6 +195,18 @@ static inline void sha_ll_read_digest(esp_sha_type sha_type, void *digest_state,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check whether the SHA peripheral can run the SM3 mode.
|
||||
*
|
||||
* This chip has no SM3 hardware.
|
||||
*
|
||||
* @return false
|
||||
*/
|
||||
static inline bool sha_ll_is_sm3_supported(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user