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
*/
@@ -37,14 +37,24 @@ static inline void sha_ll_reset_register(void)
37
37
PCR .hmac_conf .hmac_rst_en = 0 ;
38
38
}
39
39
40
+ /**
41
+ * @brief Load the mode for the SHA engine
42
+ *
43
+ * @param sha_type The SHA algorithm type
44
+ */
45
+ static inline void sha_ll_set_mode (esp_sha_type sha_type )
46
+ {
47
+ REG_WRITE (SHA_MODE_REG , sha_type );
48
+ }
49
+
40
50
/**
41
51
* @brief Start a new SHA block conversions (no initial hash in HW)
42
52
*
43
53
* @param sha_type The SHA algorithm type
44
54
*/
45
55
static inline void sha_ll_start_block (esp_sha_type sha_type )
46
56
{
47
- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
57
+ ( void ) sha_type ;
48
58
REG_WRITE (SHA_START_REG , 1 );
49
59
}
50
60
@@ -55,29 +65,23 @@ static inline void sha_ll_start_block(esp_sha_type sha_type)
55
65
*/
56
66
static inline void sha_ll_continue_block (esp_sha_type sha_type )
57
67
{
58
- REG_WRITE ( SHA_MODE_REG , sha_type ) ;
68
+ ( void ) sha_type ;
59
69
REG_WRITE (SHA_CONTINUE_REG , 1 );
60
70
}
61
71
62
72
/**
63
73
* @brief Start a new SHA message conversion using DMA (no initial hash in HW)
64
- *
65
- * @param sha_type The SHA algorithm type
66
74
*/
67
- static inline void sha_ll_start_dma (esp_sha_type sha_type )
75
+ static inline void sha_ll_start_dma (void )
68
76
{
69
- REG_WRITE (SHA_MODE_REG , sha_type );
70
77
REG_WRITE (SHA_DMA_START_REG , 1 );
71
78
}
72
79
73
80
/**
74
81
* @brief Continue a SHA message conversion using DMA (initial hash in HW)
75
- *
76
- * @param sha_type The SHA algorithm type
77
82
*/
78
- static inline void sha_ll_continue_dma (esp_sha_type sha_type )
83
+ static inline void sha_ll_continue_dma (void )
79
84
{
80
- REG_WRITE (SHA_MODE_REG , sha_type );
81
85
REG_WRITE (SHA_DMA_CONTINUE_REG , 1 );
82
86
}
83
87
0 commit comments