1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-07 06:42:56 +03:00

Renamed RMD160 to RIPEMD160

This commit is contained in:
Paul Bakker
2014-01-22 13:35:29 +01:00
parent e4d47a655b
commit 61b699ed1b
16 changed files with 307 additions and 307 deletions

View File

@@ -2,7 +2,7 @@
#include <polarssl/md2.h>
#include <polarssl/md4.h>
#include <polarssl/md5.h>
#include <polarssl/rmd160.h>
#include <polarssl/ripemd160.h>
/* END_HEADER */
/* BEGIN_CASE depends_on:POLARSSL_MD2_C */
@@ -65,8 +65,8 @@ void md5_text( char *text_src_string, char *hex_hash_string )
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_RMD160_C */
void rmd160_text( char *text_src_string, char *hex_hash_string )
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C */
void ripemd160_text( char *text_src_string, char *hex_hash_string )
{
unsigned char src_str[100];
unsigned char hash_str[41];
@@ -78,7 +78,7 @@ void rmd160_text( char *text_src_string, char *hex_hash_string )
strcpy( (char *) src_str, text_src_string );
rmd160( src_str, strlen( (char *) src_str ), output );
ripemd160( src_str, strlen( (char *) src_str ), output );
hexify( hash_str, output, sizeof output );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -160,9 +160,9 @@ void md5_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_RMD160_C */
void rmd160_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
char *hex_hash_string )
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C */
void ripemd160_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
char *hex_hash_string )
{
unsigned char src_str[200];
unsigned char key_str[200];
@@ -178,7 +178,7 @@ void rmd160_hmac( int trunc_size, char *hex_key_string, char *hex_src_string,
key_len = unhexify( key_str, hex_key_string );
src_len = unhexify( src_str, hex_src_string );
rmd160_hmac( key_str, key_len, src_str, src_len, output );
ripemd160_hmac( key_str, key_len, src_str, src_len, output );
hexify( hash_str, output, sizeof output );
TEST_ASSERT( strncmp( (char *) hash_str, hex_hash_string, trunc_size * 2 ) == 0 );
@@ -233,8 +233,8 @@ void md5_file( char *filename, char *hex_hash_string )
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_RMD160_C:POLARSSL_FS_IO */
void rmd160_file( char *filename, char *hex_hash_string )
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C:POLARSSL_FS_IO */
void ripemd160_file( char *filename, char *hex_hash_string )
{
unsigned char hash_str[41];
unsigned char output[20];
@@ -242,7 +242,7 @@ void rmd160_file( char *filename, char *hex_hash_string )
memset(hash_str, 0x00, sizeof hash_str );
memset(output, 0x00, sizeof output );
rmd160_file( filename, output);
ripemd160_file( filename, output);
hexify( hash_str, output, sizeof output );
TEST_ASSERT( strcmp( (char *) hash_str, hex_hash_string ) == 0 );
@@ -270,9 +270,9 @@ void md5_selftest()
}
/* END_CASE */
/* BEGIN_CASE depends_on:POLARSSL_RMD160_C:POLARSSL_SELF_TEST */
void rmd160_selftest()
/* BEGIN_CASE depends_on:POLARSSL_RIPEMD160_C:POLARSSL_SELF_TEST */
void ripemd160_selftest()
{
TEST_ASSERT( rmd160_self_test( 0 ) == 0 );
TEST_ASSERT( ripemd160_self_test( 0 ) == 0 );
}
/* END_CASE */