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:
Manuel Pégourié-Gonnard 2015-03-24 12:13:30 +01:00
parent 9325b26b42
commit ca878dbaa5
12 changed files with 117 additions and 100 deletions

View file

@ -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 */