mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Add RIPEMD-160 to the generic MD layer
This commit is contained in:
12
library/md.c
12
library/md.c
@ -55,6 +55,10 @@ static const int supported_digests[] = {
|
||||
POLARSSL_MD_MD5,
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_RMD160_C)
|
||||
POLARSSL_MD_RMD160,
|
||||
#endif
|
||||
|
||||
#if defined(POLARSSL_SHA1_C)
|
||||
POLARSSL_MD_SHA1,
|
||||
#endif
|
||||
@ -95,6 +99,10 @@ const md_info_t *md_info_from_string( const char *md_name )
|
||||
if( !strcasecmp( "MD5", md_name ) )
|
||||
return md_info_from_type( POLARSSL_MD_MD5 );
|
||||
#endif
|
||||
#if defined(POLARSSL_RMD160_C)
|
||||
if( !strcasecmp( "RMD160", md_name ) )
|
||||
return md_info_from_type( POLARSSL_MD_RMD160 );
|
||||
#endif
|
||||
#if defined(POLARSSL_SHA1_C)
|
||||
if( !strcasecmp( "SHA1", md_name ) || !strcasecmp( "SHA", md_name ) )
|
||||
return md_info_from_type( POLARSSL_MD_SHA1 );
|
||||
@ -130,6 +138,10 @@ const md_info_t *md_info_from_type( md_type_t md_type )
|
||||
case POLARSSL_MD_MD5:
|
||||
return &md5_info;
|
||||
#endif
|
||||
#if defined(POLARSSL_RMD160_C)
|
||||
case POLARSSL_MD_RMD160:
|
||||
return &rmd160_info;
|
||||
#endif
|
||||
#if defined(POLARSSL_SHA1_C)
|
||||
case POLARSSL_MD_SHA1:
|
||||
return &sha1_info;
|
||||
|
Reference in New Issue
Block a user