File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
features/mbedtls/targets/TARGET_STM Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,19 @@ extern "C" {
33
33
#endif
34
34
35
35
/**
36
- * \brief SHA-1 context structure
36
+ * \brief SHA-1 context structure
37
+ * \note HAL_HASH_SHA1_Accumulate cannot handle less than 4 bytes, unless it is the last call to the function
38
+ * In case of buffer size < 4, flag is set to 1, remaining bytes are copied in a temp buffer.
39
+ * The pointer and the length are saved in sbuf and sbuf_len.
40
+ * At the next accumulation, the saved values are taken into account, and flag is set to 0
41
+ * If SHA1_finish is called and flag=1, the remaining bytes are accumulated before the call to HAL_HASH_SHA1_Finish
37
42
*/
38
43
typedef struct
39
44
{
40
- unsigned char * sbuf ;
41
- unsigned char sbuf_len ;
42
- HASH_HandleTypeDef hhash_sha1 ;
43
- int flag ; /* flag to manage buffer constraint of crypto Hw */
45
+ unsigned char * sbuf ; /*!< pointer to the remaining buffer to be processed */
46
+ unsigned char sbuf_len ; /*!< number of bytes remaining in sbuf to be processed */
47
+ HASH_HandleTypeDef hhash_sha1 ; /*!< ST HAL HASH struct */
48
+ int flag ; /*!< 1 : there are sbuf_len bytes to be processed in sbuf, 0 : every data have been processed. */
44
49
}
45
50
mbedtls_sha1_context ;
46
51
You can’t perform that action at this time.
0 commit comments