Remove tabs, fix doxygen comments

pull/4157/head
adustm 2017-05-22 13:32:16 +02:00
parent c2a85fb12a
commit b38eea2caf
2 changed files with 10 additions and 15 deletions

View File

@ -40,7 +40,7 @@ void mbedtls_sha1_free( mbedtls_sha1_context *ctx )
if( ctx == NULL )
return;
/* Force the HASH Periheral Clock Reset */
/* Force the HASH Periheral Clock Reset */
__HAL_RCC_HASH_FORCE_RESET();
/* Release the HASH Periheral Clock Reset */

View File

@ -1,6 +1,8 @@
/*
* sha1_alt.h SHA-1 hash
*******************************************************************************
* \file sha1_alt.h
*
* \brief SHA1 hw acceleration (hash function)
*
* Copyright (C) 2017, STMicroelectronics
* SPDX-License-Identifier: Apache-2.0
*
@ -30,16 +32,17 @@
extern "C" {
#endif
#define MBEDTLS_SHA1_BLOCK_SIZE (64)
#define MBEDTLS_SHA1_BLOCK_SIZE (64) // must be a multiple of 4
/**
* \brief SHA-1 context structure
* \note HAL_HASH_SHA1_Accumulate cannot handle less than 4 bytes, unless it is the last call to the function
* A 64 bytes buffer is used to save values and handle the processing 64 bytes per 64 bytes
* If SHA1_finish is called and sbuf_len>0, the remaining bytes are accumulated before the call to HAL_HASH_SHA1_Finish
* A MBEDTLS_SHA1_BLOCK_SIZE bytes buffer is used to save values and handle the processing
* MBEDTLS_SHA1_BLOCK_SIZE bytes per MBEDTLS_SHA1_BLOCK_SIZE bytes
* If SHA1_finish is called and sbuf_len>0, the remaining bytes are accumulated prior to the call to HAL_HASH_SHA1_Finish
*/
typedef struct
{
unsigned char sbuf[MBEDTLS_SHA1_BLOCK_SIZE]; /*!< 64 buffer to store values so that algorithm is caled once the buffer is filled */
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 */
unsigned char sbuf_len; /*!< number of bytes remaining in sbuf to be processed */
HASH_HandleTypeDef hhash_sha1; /*!< ST HAL HASH struct */
}
@ -99,14 +102,6 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif /* MBEDTLS_SHA1_ALT */
#endif /* sha1_alt.h */