Add function to get md info from md context
Signed-off-by: Max Fillinger <max@max-fillinger.net>
diff --git a/library/md.c b/library/md.c
index a228789..f2c1a90 100644
--- a/library/md.c
+++ b/library/md.c
@@ -227,6 +227,15 @@
}
}
+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 ) );