mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Make md_info_t an opaque structure
- more freedom for us to change it in the future - enforces hygiene - performance impact of making accessors no longer inline should really be negligible
This commit is contained in:
24
library/md.c
24
library/md.c
@ -329,4 +329,28 @@ int md_process( md_context_t *ctx, const unsigned char *data )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
unsigned char md_get_size( const md_info_t *md_info )
|
||||
{
|
||||
if( md_info == NULL )
|
||||
return( 0 );
|
||||
|
||||
return md_info->size;
|
||||
}
|
||||
|
||||
md_type_t md_get_type( const md_info_t *md_info )
|
||||
{
|
||||
if( md_info == NULL )
|
||||
return( POLARSSL_MD_NONE );
|
||||
|
||||
return md_info->type;
|
||||
}
|
||||
|
||||
const char *md_get_name( const md_info_t *md_info )
|
||||
{
|
||||
if( md_info == NULL )
|
||||
return( NULL );
|
||||
|
||||
return md_info->name;
|
||||
}
|
||||
|
||||
#endif /* POLARSSL_MD_C */
|
||||
|
Reference in New Issue
Block a user