diff --git a/features/mbedtls/targets/TARGET_STM/sha1_alt.c b/features/mbedtls/targets/TARGET_STM/sha1_alt.c index a5b61c135f..8cc38a8054 100644 --- a/features/mbedtls/targets/TARGET_STM/sha1_alt.c +++ b/features/mbedtls/targets/TARGET_STM/sha1_alt.c @@ -18,8 +18,8 @@ * */ #include "mbedtls/sha1.h" - #if defined(MBEDTLS_SHA1_ALT) +#include "mbedtls/platform.h" /* Implementation that should never be optimized out by the compiler */ static void mbedtls_zeroize( void *v, size_t n ) { @@ -40,7 +40,7 @@ void mbedtls_sha1_free( mbedtls_sha1_context *ctx ) { if( ctx == NULL ) return; - + /* Force the HASH Periheral Clock Reset */ __HAL_RCC_HASH_FORCE_RESET(); @@ -66,7 +66,7 @@ void mbedtls_sha1_starts( mbedtls_sha1_context *ctx ) // error found to be returned return; } - + /* HASH Configuration */ ctx->hhash_sha1.Init.DataType = HASH_DATATYPE_8B; 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, ctx->flag=0; } } - } + } } /* @@ -140,7 +140,7 @@ void mbedtls_sha1_finish( mbedtls_sha1_context *ctx, unsigned char output[20] ) } __HAL_HASH_START_DIGEST(); - + if (HAL_HASH_SHA1_Finish(&ctx->hhash_sha1, output, 10)){ // error code to be returned } diff --git a/features/mbedtls/targets/TARGET_STM/sha1_alt.h b/features/mbedtls/targets/TARGET_STM/sha1_alt.h index 4f04002ebe..37fa83b770 100644 --- a/features/mbedtls/targets/TARGET_STM/sha1_alt.h +++ b/features/mbedtls/targets/TARGET_STM/sha1_alt.h @@ -22,8 +22,6 @@ #if defined MBEDTLS_SHA1_ALT -#include "mbedtls/platform.h" -#include "mbedtls/config.h" #include "cmsis.h" #include @@ -107,22 +105,6 @@ void mbedtls_sha1_process( mbedtls_sha1_context *ctx, const unsigned char data[6 extern "C" { #endif -/** - * \brief Output = SHA-1( input buffer ) - * - * \param input buffer holding the data - * \param ilen length of the input data - * \param output SHA-1 checksum result - */ -void mbedtls_sha1( const unsigned char *input, size_t ilen, unsigned char output[20] ); - -/** - * \brief Checkup routine - * - * \return 0 if successful, or 1 if the test failed - */ -int mbedtls_sha1_self_test( int verbose ); - #ifdef __cplusplus } #endif