Remove individual mdX_file() and shaX_file()

parent 06d5d613
......@@ -81,9 +81,9 @@ Removals
* Removed mbedtls_ecp_group_read_string(). Only named groups are supported.
* Removed mbedtls_ecp_sub() and mbedtls_ecp_add(), use
mbedtls_ecp_muladd().
* Removed individual mdX_hmac and shaX_hmac functions (use generic
md_hmac functions from md.h)
* Removed mbedtls_timing_msleep(). Use mbedtls_timing_usleep() or a custom
* Removed individual mdX_hmac, shaX_hmac, mdX_file and shaX_file functions
(use generic functions from md.h)
* Removed mbedtls_timing_msleep(). Use mbedtls_net_usleep() or a custom
waiting function.
* Removed the PBKDF2 module (use PKCS5).
* Removed POLARSSL_ERROR_STRERROR_BC (use mbedtls_strerror()).
......
......@@ -65,14 +65,7 @@
* NET 9 0x0042-0x0052 0x0043-0x0043
* ENTROPY 1 0x0058-0x0058
* ASN1 7 0x0060-0x006C
* MD2 1 0x0070-0x0070
* MD4 1 0x0072-0x0072
* MD5 1 0x0074-0x0074
* SHA1 1 0x0076-0x0076
* SHA256 1 0x0078-0x0078
* SHA512 1 0x007A-0x007A
* PBKDF2 1 0x007C-0x007C
* RIPEMD160 1 0x007E-0x007E
* HMAC_DRBG 4 0x0003-0x0009
* CCM 2 0x000D-0x000F
*
......
......@@ -32,8 +32,6 @@
#include <stddef.h>
#define MBEDTLS_ERR_MD2_FILE_IO_ERROR -0x0070 /**< Read/write error in file. */
#if !defined(MBEDTLS_MD2_ALT)
// Regular implementation
//
......@@ -113,16 +111,6 @@ extern "C" {
*/
void mbedtls_md2( const unsigned char *input, size_t ilen, unsigned char output[16] );
/**
* \brief Output = MD2( file contents )
*
* \param path input file name
* \param output MD2 checksum result
*
* \return 0 if successful, or MBEDTLS_ERR_MD2_FILE_IO_ERROR
*/
int mbedtls_md2_file( const char *path, unsigned char output[16] );
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_MD4_FILE_IO_ERROR -0x0072 /**< Read/write error in file. */
#if !defined(MBEDTLS_MD4_ALT)
// Regular implementation
//
......@@ -113,16 +111,6 @@ extern "C" {
*/
void mbedtls_md4( const unsigned char *input, size_t ilen, unsigned char output[16] );
/**
* \brief Output = MD4( file contents )
*
* \param path input file name
* \param output MD4 checksum result
*
* \return 0 if successful, or MBEDTLS_ERR_MD4_FILE_IO_ERROR
*/
int mbedtls_md4_file( const char *path, unsigned char output[16] );
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_MD5_FILE_IO_ERROR -0x0074 /**< Read/write error in file. */
#if !defined(MBEDTLS_MD5_ALT)
// Regular implementation
//
......@@ -116,16 +114,6 @@ extern "C" {
*/
void mbedtls_md5( const unsigned char *input, size_t ilen, unsigned char output[16] );
/**
* \brief Output = MD5( file contents )
*
* \param path input file name
* \param output MD5 checksum result
*
* \return 0 if successful, or MBEDTLS_ERR_MD5_FILE_IO_ERROR
*/
int mbedtls_md5_file( const char *path, unsigned char output[16] );
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR -0x007E /**< Read/write error in file. */
#if !defined(MBEDTLS_RIPEMD160_ALT)
// Regular implementation
//
......@@ -118,18 +116,6 @@ extern "C" {
void mbedtls_ripemd160( const unsigned char *input, size_t ilen,
unsigned char output[20] );
#if defined(MBEDTLS_FS_IO)
/**
* \brief Output = RIPEMD-160( file contents )
*
* \param path input file name
* \param output RIPEMD-160 checksum result
*
* \return 0 if successful, or MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR
*/
int mbedtls_ripemd160_file( const char *path, unsigned char output[20] );
#endif /* MBEDTLS_FS_IO */
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_SHA1_FILE_IO_ERROR -0x0076 /**< Read/write error in file. */
#if !defined(MBEDTLS_SHA1_ALT)
// Regular implementation
//
......@@ -116,16 +114,6 @@ extern "C" {
*/
void mbedtls_sha1( const unsigned char *input, size_t ilen, unsigned char output[20] );
/**
* \brief Output = SHA-1( file contents )
*
* \param path input file name
* \param output SHA-1 checksum result
*
* \return 0 if successful, or MBEDTLS_ERR_SHA1_FILE_IO_ERROR
*/
int mbedtls_sha1_file( const char *path, unsigned char output[20] );
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_SHA256_FILE_IO_ERROR -0x0078 /**< Read/write error in file. */
#if !defined(MBEDTLS_SHA256_ALT)
// Regular implementation
//
......@@ -121,17 +119,6 @@ extern "C" {
void mbedtls_sha256( const unsigned char *input, size_t ilen,
unsigned char output[32], int is224 );
/**
* \brief Output = SHA-256( file contents )
*
* \param path input file name
* \param output SHA-224/256 checksum result
* \param is224 0 = use SHA256, 1 = use SHA224
*
* \return 0 if successful, or MBEDTLS_ERR_SHA256_FILE_IO_ERROR
*/
int mbedtls_sha256_file( const char *path, unsigned char output[32], int is224 );
/**
* \brief Checkup routine
*
......
......@@ -33,8 +33,6 @@
#include <stddef.h>
#include <stdint.h>
#define MBEDTLS_ERR_SHA512_FILE_IO_ERROR -0x007A /**< Read/write error in file. */
#if !defined(MBEDTLS_SHA512_ALT)
// Regular implementation
//
......@@ -118,17 +116,6 @@ extern "C" {
void mbedtls_sha512( const unsigned char *input, size_t ilen,
unsigned char output[64], int is384 );
/**
* \brief Output = SHA-512( file contents )
*
* \param path input file name
* \param output SHA-384/512 checksum result
* \param is384 0 = use SHA512, 1 = use SHA384
*
* \return 0 if successful, or MBEDTLS_ERR_SHA512_FILE_IO_ERROR
*/
int mbedtls_sha512_file( const char *path, unsigned char output[64], int is384 );
/**
* \brief Checkup routine
*
......
......@@ -101,18 +101,6 @@
#include "mbedtls/md.h"
#endif
#if defined(MBEDTLS_MD2_C)
#include "mbedtls/md2.h"
#endif
#if defined(MBEDTLS_MD4_C)
#include "mbedtls/md4.h"
#endif
#if defined(MBEDTLS_MD5_C)
#include "mbedtls/md5.h"
#endif
#if defined(MBEDTLS_NET_C)
#include "mbedtls/net.h"
#endif
......@@ -141,26 +129,10 @@
#include "mbedtls/pkcs5.h"
#endif
#if defined(MBEDTLS_RIPEMD160_C)
#include "mbedtls/ripemd160.h"
#endif
#if defined(MBEDTLS_RSA_C)
#include "mbedtls/rsa.h"
#endif
#if defined(MBEDTLS_SHA1_C)
#include "mbedtls/sha1.h"
#endif
#if defined(MBEDTLS_SHA256_C)
#include "mbedtls/sha256.h"
#endif
#if defined(MBEDTLS_SHA512_C)
#include "mbedtls/sha512.h"
#endif
#if defined(MBEDTLS_SSL_TLS_C)
#include "mbedtls/ssl.h"
#endif
......@@ -293,7 +265,7 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
#if defined(MBEDTLS_PK_C)
if( use_ret == -(MBEDTLS_ERR_PK_ALLOC_FAILED) )
mbedtls_snprintf( buf, buflen, "PK - Memory alloation failed" );
mbedtls_snprintf( buf, buflen, "PK - Memory allocation failed" );
if( use_ret == -(MBEDTLS_ERR_PK_TYPE_MISMATCH) )
mbedtls_snprintf( buf, buflen, "PK - Type mismatch, eg attempt to encrypt with an ECDSA key" );
if( use_ret == -(MBEDTLS_ERR_PK_BAD_INPUT_DATA) )
......@@ -649,21 +621,6 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
mbedtls_snprintf( buf, buflen, "HMAC_DRBG - The entropy source failed" );
#endif /* MBEDTLS_HMAC_DRBG_C */
#if defined(MBEDTLS_MD2_C)
if( use_ret == -(MBEDTLS_ERR_MD2_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "MD2 - Read/write error in file" );
#endif /* MBEDTLS_MD2_C */
#if defined(MBEDTLS_MD4_C)
if( use_ret == -(MBEDTLS_ERR_MD4_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "MD4 - Read/write error in file" );
#endif /* MBEDTLS_MD4_C */
#if defined(MBEDTLS_MD5_C)
if( use_ret == -(MBEDTLS_ERR_MD5_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "MD5 - Read/write error in file" );
#endif /* MBEDTLS_MD5_C */
#if defined(MBEDTLS_NET_C)
if( use_ret == -(MBEDTLS_ERR_NET_SOCKET_FAILED) )
mbedtls_snprintf( buf, buflen, "NET - Failed to open a socket" );
......@@ -699,26 +656,6 @@ void mbedtls_strerror( int ret, char *buf, size_t buflen )
mbedtls_snprintf( buf, buflen, "PADLOCK - Input data should be aligned" );
#endif /* MBEDTLS_PADLOCK_C */
#if defined(MBEDTLS_RIPEMD160_C)
if( use_ret == -(MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "RIPEMD160 - Read/write error in file" );
#endif /* MBEDTLS_RIPEMD160_C */
#if defined(MBEDTLS_SHA1_C)
if( use_ret == -(MBEDTLS_ERR_SHA1_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "SHA1 - Read/write error in file" );
#endif /* MBEDTLS_SHA1_C */
#if defined(MBEDTLS_SHA256_C)
if( use_ret == -(MBEDTLS_ERR_SHA256_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "SHA256 - Read/write error in file" );
#endif /* MBEDTLS_SHA256_C */
#if defined(MBEDTLS_SHA512_C)
if( use_ret == -(MBEDTLS_ERR_SHA512_FILE_IO_ERROR) )
mbedtls_snprintf( buf, buflen, "SHA512 - Read/write error in file" );
#endif /* MBEDTLS_SHA512_C */
#if defined(MBEDTLS_THREADING_C)
if( use_ret == -(MBEDTLS_ERR_THREADING_FEATURE_UNAVAILABLE) )
mbedtls_snprintf( buf, buflen, "THREADING - The selected feature is not available" );
......
......@@ -38,10 +38,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -213,40 +209,6 @@ void mbedtls_md2( const unsigned char *input, size_t ilen, unsigned char output[
mbedtls_md2_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = MD2( file contents )
*/
int mbedtls_md2_file( const char *path, unsigned char output[16] )
{
FILE *f;
size_t n;
mbedtls_md2_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
mbedtls_md2_init( &ctx );
mbedtls_md2_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_md2_update( &ctx, buf, n );
mbedtls_md2_finish( &ctx, output );
mbedtls_md2_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_MD2_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
......
......@@ -38,10 +38,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -309,40 +305,6 @@ void mbedtls_md4( const unsigned char *input, size_t ilen, unsigned char output[
mbedtls_md4_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = MD4( file contents )
*/
int mbedtls_md4_file( const char *path, unsigned char output[16] )
{
FILE *f;
size_t n;
mbedtls_md4_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_MD4_FILE_IO_ERROR );
mbedtls_md4_init( &ctx );
mbedtls_md4_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_md4_update( &ctx, buf, n );
mbedtls_md4_finish( &ctx, output );
mbedtls_md4_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_MD4_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
......
......@@ -37,10 +37,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -326,40 +322,6 @@ void mbedtls_md5( const unsigned char *input, size_t ilen, unsigned char output[
mbedtls_md5_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = MD5( file contents )
*/
int mbedtls_md5_file( const char *path, unsigned char output[16] )
{
FILE *f;
size_t n;
mbedtls_md5_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_MD5_FILE_IO_ERROR );
mbedtls_md5_init( &ctx );
mbedtls_md5_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_md5_update( &ctx, buf, n );
mbedtls_md5_finish( &ctx, output );
mbedtls_md5_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_MD5_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
* RFC 1321 test vectors
......
......@@ -38,10 +38,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -384,40 +380,6 @@ void mbedtls_ripemd160( const unsigned char *input, size_t ilen,
mbedtls_ripemd160_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = RIPEMD-160( file contents )
*/
int mbedtls_ripemd160_file( const char *path, unsigned char output[20] )
{
FILE *f;
size_t n;
mbedtls_ripemd160_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR );
mbedtls_ripemd160_init( &ctx );
mbedtls_ripemd160_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_ripemd160_update( &ctx, buf, n );
mbedtls_ripemd160_finish( &ctx, output );
mbedtls_ripemd160_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_RIPEMD160_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
* Test vectors from the RIPEMD-160 paper and
......
......@@ -37,10 +37,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -359,40 +355,6 @@ void mbedtls_sha1( const unsigned char *input, size_t ilen, unsigned char output
mbedtls_sha1_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = SHA-1( file contents )
*/
int mbedtls_sha1_file( const char *path, unsigned char output[20] )
{
FILE *f;
size_t n;
mbedtls_sha1_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_SHA1_FILE_IO_ERROR );
mbedtls_sha1_init( &ctx );
mbedtls_sha1_starts( &ctx );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_sha1_update( &ctx, buf, n );
mbedtls_sha1_finish( &ctx, output );
mbedtls_sha1_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_SHA1_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
* FIPS-180-1 test vectors
......
......@@ -37,10 +37,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -331,40 +327,6 @@ void mbedtls_sha256( const unsigned char *input, size_t ilen,
mbedtls_sha256_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = SHA-256( file contents )
*/
int mbedtls_sha256_file( const char *path, unsigned char output[32], int is224 )
{
FILE *f;
size_t n;
mbedtls_sha256_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_SHA256_FILE_IO_ERROR );
mbedtls_sha256_init( &ctx );
mbedtls_sha256_starts( &ctx, is224 );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_sha256_update( &ctx, buf, n );
mbedtls_sha256_finish( &ctx, output );
mbedtls_sha256_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_SHA256_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
* FIPS-180-2 test vectors
......
......@@ -43,10 +43,6 @@
#include <string.h>
#if defined(MBEDTLS_FS_IO)
#include <stdio.h>
#endif
#if defined(MBEDTLS_SELF_TEST)
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
......@@ -366,40 +362,6 @@ void mbedtls_sha512( const unsigned char *input, size_t ilen,
mbedtls_sha512_free( &ctx );
}
#if defined(MBEDTLS_FS_IO)
/*
* output = SHA-512( file contents )
*/
int mbedtls_sha512_file( const char *path, unsigned char output[64], int is384 )
{
FILE *f;
size_t n;
mbedtls_sha512_context ctx;
unsigned char buf[1024];
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_SHA512_FILE_IO_ERROR );
mbedtls_sha512_init( &ctx );
mbedtls_sha512_starts( &ctx, is384 );
while( ( n = fread( buf, 1, sizeof( buf ), f ) ) > 0 )
mbedtls_sha512_update( &ctx, buf, n );
mbedtls_sha512_finish( &ctx, output );
mbedtls_sha512_free( &ctx );
if( ferror( f ) != 0 )
{
fclose( f );
return( MBEDTLS_ERR_SHA512_FILE_IO_ERROR );
}
fclose( f );
return( 0 );
}
#endif /* MBEDTLS_FS_IO */
#if defined(MBEDTLS_SELF_TEST)
/*
......
......@@ -85,57 +85,6 @@ ripemd160_text:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789":
mbedtls_ripemd160 Test vector from paper #8
ripemd160_text:"12345678901234567890123456789012345678901234567890123456789012345678901234567890":"9b752e45573d4b39f4dbd3323cab82bf63326bfb"
MD2 Hash file #1
mbedtls_md2_file:"data_files/hash_file_1":"b593c098712d2e21628c8986695451a8"
MD2 Hash file #2
mbedtls_md2_file:"data_files/hash_file_2":"3c027b7409909a4c4b26bbab69ad9f4f"
MD2 Hash file #3
mbedtls_md2_file:"data_files/hash_file_3":"6bb43eb285e81f414083a94cdbe2989d"
MD2 Hash file #4
mbedtls_md2_file:"data_files/hash_file_4":"8350e5a3e24c153df2275c9f80692773"
MD4 Hash file #1
mbedtls_md4_file:"data_files/hash_file_1":"8d19772c176bd27153b9486715e2c0b9"
MD4 Hash file #2
mbedtls_md4_file:"data_files/hash_file_2":"f2ac53b8542882a5a0007c6f84b4d9fd"
MD4 Hash file #3
mbedtls_md4_file:"data_files/hash_file_3":"195c15158e2d07881d9a654095ce4a42"
MD4 Hash file #4
mbedtls_md4_file:"data_files/hash_file_4":"31d6cfe0d16ae931b73c59d7e0c089c0"
MD5 Hash file #1
mbedtls_md5_file:"data_files/hash_file_1":"52bcdc983c9ed64fc148a759b3c7a415"
MD5 Hash file #2
mbedtls_md5_file:"data_files/hash_file_2":"d17d466f15891df10542207ae78277f0"
MD5 Hash file #3
mbedtls_md5_file:"data_files/hash_file_3":"d945bcc6200ea95d061a2a818167d920"
MD5 Hash file #4
mbedtls_md5_file:"data_files/hash_file_4":"d41d8cd98f00b204e9800998ecf8427e"
RIPEMD160 Hash file #0 (from paper)
mbedtls_ripemd160_file:"data_files/hash_file_5":"52783243c1697bdbe16d37f97f68f08325dc1528"
RIPEMD160 Hash file #1
mbedtls_ripemd160_file:"data_files/hash_file_1":"82f1d072f0ec0c2b353703a7b575a04c113af1a6"
RIPEMD160 Hash file #2
mbedtls_ripemd160_file:"data_files/hash_file_2":"996fbc8b79206ba7393ebcd246584069b1c08f0f"
RIPEMD160 Hash file #3
mbedtls_ripemd160_file:"data_files/hash_file_3":"8653b46d65998fa8c8846efa17937e742533ae48"
RIPEMD160 Hash file #4
mbedtls_ripemd160_file:"data_files/hash_file_4":"9c1185a5c5e9fc54612808977ee8f548b2258d31"
MD2 Selftest
md2_selftest:
......
......@@ -85,70 +85,6 @@ void ripemd160_text( char *text_src_string, char *hex_hash_string )
}
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_MD2_C:MBEDTLS_FS_IO */
void mbedtls_md2_file( char *filename, char *hex_hash_string )
{
unsigned char hash_str[33];
unsigned char output[16];
memset( hash_str, 0x00, sizeof hash_str );
memset( output, 0x00, sizeof output );
mbedtls_md2_file( filename, output);
hexify( hash_str, output, sizeof output );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
}
/* END_CASE */