Remove unneeded function declarations + include file

Move include platform from sha1_alt.h to sha1_alt.c
pull/4157/head
adustm 2017-04-04 14:33:53 +02:00
parent 996e093b77
commit f26ae03e48
2 changed files with 5 additions and 23 deletions

View File

@ -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
}

View File

@ -22,8 +22,6 @@
#if defined MBEDTLS_SHA1_ALT
#include "mbedtls/platform.h"
#include "mbedtls/config.h"
#include "cmsis.h"
#include <string.h>
@ -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