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:
Ashish Sharma
2026-09-04 14:26:23 +08:00
parent 7f413c914d
commit 8956f3b86c
15 changed files with 185 additions and 13 deletions
@@ -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
*/
@@ -180,6 +180,18 @@ static inline void sha_ll_write_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