Add function to get md info from md context

Signed-off-by: Max Fillinger <max@max-fillinger.net>
This commit is contained in:
Max Fillinger 2021-12-28 16:32:00 +01:00
parent d65aeb3734
commit 0bb38336a5
3 changed files with 30 additions and 0 deletions

View file

@ -227,6 +227,15 @@ const mbedtls_md_info_t *mbedtls_md_info_from_type( mbedtls_md_type_t md_type )
}
}
const mbedtls_md_info_t *mbedtls_md_info_from_ctx(
const mbedtls_md_context_t *ctx )
{
if( ctx == NULL )
return NULL;
return( ctx->MBEDTLS_PRIVATE(md_info) );
}
void mbedtls_md_init( mbedtls_md_context_t *ctx )
{
memset( ctx, 0, sizeof( mbedtls_md_context_t ) );