1
1
/*
2
- * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2
+ * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
3
3
*
4
4
* SPDX-License-Identifier: Apache-2.0
5
5
*/
@@ -39,14 +39,24 @@ static inline void sha_ll_reset_register(void)
39
39
PCR .ecdsa_conf .ecdsa_rst_en = 0 ;
40
40
}
41
41
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
+
42
52
/**
43
53
* @brief Start a new SHA block conversions (no initial hash in HW)
44
54
*
45
55
* @param sha_type The SHA algorithm type
46
56
*/
47
57
static inline void sha_ll_start_block (esp_sha_type sha_type )
48
58
{
49
- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
59
+ ( void ) sha_type ;
50
60
REG_WRITE (SHA_START_REG , 1 );
51
61
}
52
62
@@ -57,29 +67,23 @@ static inline void sha_ll_start_block(esp_sha_type sha_type)
57
67
*/
58
68
static inline void sha_ll_continue_block (esp_sha_type sha_type )
59
69
{
60
- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
70
+ ( void ) sha_type ;
61
71
REG_WRITE (SHA_CONTINUE_REG , 1 );
62
72
}
63
73
64
74
/**
65
75
* @brief Start a new SHA message conversion using DMA (no initial hash in HW)
66
- *
67
- * @param sha_type The SHA algorithm type
68
76
*/
69
- static inline void sha_ll_start_dma (esp_sha_type sha_type )
77
+ static inline void sha_ll_start_dma (void )
70
78
{
71
- REG_WRITE (SHA_MODE_REG , sha_type );
72
79
REG_WRITE (SHA_DMA_START_REG , 1 );
73
80
}
74
81
75
82
/**
76
83
* @brief Continue a SHA message conversion using DMA (initial hash in HW)
77
- *
78
- * @param sha_type The SHA algorithm type
79
84
*/
80
- static inline void sha_ll_continue_dma (esp_sha_type sha_type )
85
+ static inline void sha_ll_continue_dma (void )
81
86
{
82
- REG_WRITE (SHA_MODE_REG , sha_type );
83
87
REG_WRITE (SHA_DMA_CONTINUE_REG , 1 );
84
88
}
85
89
@@ -168,6 +172,25 @@ static inline void sha_ll_write_digest(esp_sha_type sha_type, void *digest_state
168
172
}
169
173
}
170
174
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
+ }
171
194
172
195
#ifdef __cplusplus
173
196
}
0 commit comments