11/*
2- * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+ * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 */
@@ -39,14 +39,24 @@ static inline void sha_ll_reset_register(void)
3939 PCR .ecdsa_conf .ecdsa_rst_en = 0 ;
4040}
4141
42+ /**
43+ * @brief Load the mode for the SHA engine
44+ *
45+ * @param sha_type The SHA algorithm type
46+ */
47+ static inline void sha_ll_set_mode (esp_sha_type sha_type )
48+ {
49+ REG_WRITE (SHA_MODE_REG , sha_type );
50+ }
51+
4252/**
4353 * @brief Start a new SHA block conversions (no initial hash in HW)
4454 *
4555 * @param sha_type The SHA algorithm type
4656 */
4757static inline void sha_ll_start_block (esp_sha_type sha_type )
4858{
49- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
59+ ( void ) sha_type ;
5060 REG_WRITE (SHA_START_REG , 1 );
5161}
5262
@@ -57,29 +67,23 @@ static inline void sha_ll_start_block(esp_sha_type sha_type)
5767 */
5868static inline void sha_ll_continue_block (esp_sha_type sha_type )
5969{
60- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
70+ ( void ) sha_type ;
6171 REG_WRITE (SHA_CONTINUE_REG , 1 );
6272}
6373
6474/**
6575 * @brief Start a new SHA message conversion using DMA (no initial hash in HW)
66- *
67- * @param sha_type The SHA algorithm type
6876 */
69- static inline void sha_ll_start_dma (esp_sha_type sha_type )
77+ static inline void sha_ll_start_dma (void )
7078{
71- REG_WRITE (SHA_MODE_REG , sha_type );
7279 REG_WRITE (SHA_DMA_START_REG , 1 );
7380}
7481
7582/**
7683 * @brief Continue a SHA message conversion using DMA (initial hash in HW)
77- *
78- * @param sha_type The SHA algorithm type
7984 */
80- static inline void sha_ll_continue_dma (esp_sha_type sha_type )
85+ static inline void sha_ll_continue_dma (void )
8186{
82- REG_WRITE (SHA_MODE_REG , sha_type );
8387 REG_WRITE (SHA_DMA_CONTINUE_REG , 1 );
8488}
8589
@@ -168,6 +172,25 @@ static inline void sha_ll_write_digest(esp_sha_type sha_type, void *digest_state
168172 }
169173}
170174
175+ /**
176+ * @brief Sets SHA512_t T_string parameter
177+ *
178+ * @param t_string T_string parameter
179+ */
180+ static inline void sha_ll_t_string_set (uint32_t t_string )
181+ {
182+ REG_WRITE (SHA_T_STRING_REG , t_string );
183+ }
184+
185+ /**
186+ * @brief Sets SHA512_t T_string parameter's length
187+ *
188+ * @param t_len T_string parameter length
189+ */
190+ static inline void sha_ll_t_len_set (uint8_t t_len )
191+ {
192+ REG_WRITE (SHA_T_LENGTH_REG , t_len );
193+ }
171194
172195#ifdef __cplusplus
173196}
0 commit comments