Make hmac_ctx optional
Note from future self: actually md_init_ctx will be re-introduced with the
same signature later, and a new function with the additional argument will be
added.
diff --git a/include/mbedtls/md.h b/include/mbedtls/md.h
index 490845a..3d30bea 100644
--- a/include/mbedtls/md.h
+++ b/include/mbedtls/md.h
@@ -142,12 +142,14 @@
* digest-specific context (ctx->md_ctx) must be NULL. It will
* be allocated, and must be freed using md_free() later.
* \param md_info message digest to use.
+ * \param hmac non-zero if you want to use this context for hmac too,
+ * zero otherwise (saves some memory).
*
* \returns \c 0 on success, \c POLARSSL_ERR_MD_BAD_INPUT_DATA on
* parameter failure, \c POLARSSL_ERR_MD_ALLOC_FAILED if
* allocation of the digest-specific context failed.
*/
-int md_init_ctx( md_context_t *ctx, const md_info_t *md_info );
+int md_init_ctx( md_context_t *ctx, const md_info_t *md_info, int hmac );
/**
* \brief Returns the size of the message digest output.