Skip to content

Commit b38eea2

Browse files
committed
Remove tabs, fix doxygen comments
1 parent c2a85fb commit b38eea2

File tree

2 files changed

+10
-15
lines changed

2 files changed

+10
-15
lines changed

features/mbedtls/targets/TARGET_STM/sha1_alt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void mbedtls_sha1_free( mbedtls_sha1_context *ctx )
4040
if( ctx == NULL )
4141
return;
4242

43-
/* Force the HASH Periheral Clock Reset */
43+
/* Force the HASH Periheral Clock Reset */
4444
__HAL_RCC_HASH_FORCE_RESET();
4545

4646
/* Release the HASH Periheral Clock Reset */

features/mbedtls/targets/TARGET_STM/sha1_alt.h

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/*
2-
* sha1_alt.h SHA-1 hash
3-
*******************************************************************************
2+
* \file sha1_alt.h
3+
*
4+
* \brief SHA1 hw acceleration (hash function)
5+
*
46
* Copyright (C) 2017, STMicroelectronics
57
* SPDX-License-Identifier: Apache-2.0
68
*
@@ -30,16 +32,17 @@
3032
extern "C" {
3133
#endif
3234

33-
#define MBEDTLS_SHA1_BLOCK_SIZE (64)
35+
#define MBEDTLS_SHA1_BLOCK_SIZE (64) // must be a multiple of 4
3436
/**
3537
* \brief SHA-1 context structure
3638
* \note HAL_HASH_SHA1_Accumulate cannot handle less than 4 bytes, unless it is the last call to the function
37-
* A 64 bytes buffer is used to save values and handle the processing 64 bytes per 64 bytes
38-
* If SHA1_finish is called and sbuf_len>0, the remaining bytes are accumulated before the call to HAL_HASH_SHA1_Finish
39+
* A MBEDTLS_SHA1_BLOCK_SIZE bytes buffer is used to save values and handle the processing
40+
* MBEDTLS_SHA1_BLOCK_SIZE bytes per MBEDTLS_SHA1_BLOCK_SIZE bytes
41+
* If SHA1_finish is called and sbuf_len>0, the remaining bytes are accumulated prior to the call to HAL_HASH_SHA1_Finish
3942
*/
4043
typedef struct
4144
{
42-
unsigned char sbuf[MBEDTLS_SHA1_BLOCK_SIZE]; /*!< 64 buffer to store values so that algorithm is caled once the buffer is filled */
45+
unsigned char sbuf[MBEDTLS_SHA1_BLOCK_SIZE]; /*!< MBEDTLS_SHA1_BLOCK_SIZE buffer to store values so that algorithm is caled once the buffer is filled */
4346
unsigned char sbuf_len; /*!< number of bytes remaining in sbuf to be processed */
4447
HASH_HandleTypeDef hhash_sha1; /*!< ST HAL HASH struct */
4548
}
@@ -99,14 +102,6 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6
99102
}
100103
#endif
101104

102-
#ifdef __cplusplus
103-
extern "C" {
104-
#endif
105-
106-
#ifdef __cplusplus
107-
}
108-
#endif
109-
110105
#endif /* MBEDTLS_SHA1_ALT */
111106

112107
#endif /* sha1_alt.h */

0 commit comments

Comments
 (0)