Skip to content

Commit 1d62cf9

Browse files
committed
Remove unneeded function declarations + include file
Move include platform from sha1_alt.h to sha1_alt.c
1 parent a552bb6 commit 1d62cf9

File tree

2 files changed

+5
-23
lines changed

2 files changed

+5
-23
lines changed

features/mbedtls/targets/TARGET_STM/sha1_alt.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
*
1919
*/
2020
#include "mbedtls/sha1.h"
21-
2221
#if defined(MBEDTLS_SHA1_ALT)
22+
#include "mbedtls/platform.h"
2323

2424
/* Implementation that should never be optimized out by the compiler */
2525
static void mbedtls_zeroize( void *v, size_t n ) {
@@ -40,7 +40,7 @@ void mbedtls_sha1_free( mbedtls_sha1_context *ctx )
4040
{
4141
if( ctx == NULL )
4242
return;
43-
43+
4444
/* Force the HASH Periheral Clock Reset */
4545
__HAL_RCC_HASH_FORCE_RESET();
4646

@@ -66,7 +66,7 @@ void mbedtls_sha1_starts( mbedtls_sha1_context *ctx )
6666
// error found to be returned
6767
return;
6868
}
69-
69+
7070
/* HASH Configuration */
7171
ctx->hhash_sha1.Init.DataType = HASH_DATATYPE_8B;
7272
if (HAL_HASH_Init(&ctx->hhash_sha1) == HAL_ERROR) {
@@ -126,7 +126,7 @@ void mbedtls_sha1_update( mbedtls_sha1_context *ctx, const unsigned char *input,
126126
ctx->flag=0;
127127
}
128128
}
129-
}
129+
}
130130
}
131131

132132
/*
@@ -140,7 +140,7 @@ void mbedtls_sha1_finish( mbedtls_sha1_context *ctx, unsigned char output[20] )
140140
}
141141

142142
__HAL_HASH_START_DIGEST();
143-
143+
144144
if (HAL_HASH_SHA1_Finish(&ctx->hhash_sha1, output, 10)){
145145
// error code to be returned
146146
}

features/mbedtls/targets/TARGET_STM/sha1_alt.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
#if defined MBEDTLS_SHA1_ALT
2424

25-
#include "mbedtls/platform.h"
26-
#include "mbedtls/config.h"
2725

2826
#include "cmsis.h"
2927
#include <string.h>
@@ -107,22 +105,6 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6
107105
extern "C" {
108106
#endif
109107

110-
/**
111-
* \brief Output = SHA-1( input buffer )
112-
*
113-
* \param input buffer holding the data
114-
* \param ilen length of the input data
115-
* \param output SHA-1 checksum result
116-
*/
117-
void mbedtls_sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
118-
119-
/**
120-
* \brief Checkup routine
121-
*
122-
* \return 0 if successful, or 1 if the test failed
123-
*/
124-
int mbedtls_sha1_self_test( int verbose );
125-
126108
#ifdef __cplusplus
127109
}
128110
#endif

0 commit comments

Comments
 (0)