<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>mbed TLS v2.7.6: md.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">mbed TLS v2.7.6 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',false,false,'search.php','Search'); }); </script> <div id="main-nav"></div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_b4d146e9a6d8dd56ed4afb2480a97fd3.html">mbedtls</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#nested-classes">Data Structures</a> | <a href="#define-members">Macros</a> | <a href="#typedef-members">Typedefs</a> | <a href="#enum-members">Enumerations</a> | <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">md.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>The generic message-digest wrapper. <a href="#details">More...</a></p> <div class="textblock"><code>#include <stddef.h></code><br /> <code>#include "<a class="el" href="config_8h_source.html">config.h</a>"</code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for md.h:</div> <div class="dyncontent"> <div class="center"><img src="md_8h__incl.png" border="0" usemap="#md_8h" alt=""/></div> <map name="md_8h" id="md_8h"> <area shape="rect" id="node3" href="config_8h.html" title="Configuration options (set of defines) " alt="" coords="132,80,235,107"/> <area shape="rect" id="node4" href="check__config_8h.html" title="Consistency checks for configuration options. " alt="" coords="102,155,265,181"/> </map> </div> </div><div class="textblock"><div class="dynheader"> This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="md_8h__dep__incl.png" border="0" usemap="#md_8hdep" alt=""/></div> <map name="md_8hdep" id="md_8hdep"> <area shape="rect" id="node2" href="pk_8h.html" title="Public Key abstraction layer. " alt="" coords="531,155,593,181"/> <area shape="rect" id="node3" href="ssl__ciphersuites_8h.html" title="SSL Ciphersuites for mbed TLS. " alt="" coords="291,229,494,256"/> <area shape="rect" id="node14" href="oid_8h.html" title="Object Identifier (OID) database. " alt="" coords="671,304,743,331"/> <area shape="rect" id="node16" href="rsa_8h.html" title="The RSA public-key cryptosystem. " alt="" coords="598,80,670,107"/> <area shape="rect" id="node17" href="ecdsa_8h.html" title="The Elliptic Curve Digital Signature Algorithm (ECDSA). " alt="" coords="431,80,523,107"/> <area shape="rect" id="node18" href="ecjpake_8h.html" title="Elliptic curve J-PAKE. " alt="" coords="745,80,857,107"/> <area shape="rect" id="node19" href="hmac__drbg_8h.html" title="HMAC_DRBG (NIST SP 800-90A) " alt="" coords="881,80,1013,107"/> <area shape="rect" id="node20" href="pkcs12_8h.html" title="PKCS#12 Personal Information Exchange Syntax. " alt="" coords="1037,80,1140,107"/> <area shape="rect" id="node21" href="pkcs5_8h.html" title="PKCS#5 functions. " alt="" coords="1164,80,1256,107"/> <area shape="rect" id="node11" href="x509_8h.html" title="X.509 generic defines and structures. " alt="" coords="525,229,607,256"/> <area shape="rect" id="node4" href="ssl_8h.html" title="SSL/TLS functions. " alt="" coords="329,453,401,480"/> <area shape="rect" id="node5" href="debug_8h.html" title="Functions for controlling and providing debug output from the library. " alt="" coords="5,528,97,555"/> <area shape="rect" id="node6" href="net__sockets_8h.html" title="Network communication functions. " alt="" coords="122,528,274,555"/> <area shape="rect" id="node8" href="ssl__cache_8h.html" title="SSL session cache implementation. " alt="" coords="299,528,431,555"/> <area shape="rect" id="node9" href="ssl__cookie_8h.html" title="DTLS cookie callbacks implementation. " alt="" coords="455,528,597,555"/> <area shape="rect" id="node10" href="ssl__ticket_8h.html" title="TLS server ticket callbacks implementation. " alt="" coords="621,528,764,555"/> <area shape="rect" id="node7" href="net_8h.html" title="Deprecated header file that includes net_sockets.h. " alt="" coords="162,603,234,629"/> <area shape="rect" id="node12" href="x509__crt_8h.html" title="X.509 certificate parsing and writing. " alt="" coords="303,379,426,405"/> <area shape="rect" id="node13" href="x509__crl_8h.html" title="X.509 certificate revocation list parsing. " alt="" coords="378,304,501,331"/> <area shape="rect" id="node15" href="x509__csr_8h.html" title="X.509 certificate signing request parsing and writing. " alt="" coords="525,304,647,331"/> </map> </div> </div> <p><a href="md_8h_source.html">Go to the source code of this file.</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a> Data Structures</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:a121b228f0512def159e3bd4ced07633b"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a121b228f0512def159e3bd4ced07633b">MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE</a>   -0x5080</td></tr> <tr class="separator:a121b228f0512def159e3bd4ced07633b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aeeb355bf3d3d39a2a6ba50544139b9a7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a>   -0x5100</td></tr> <tr class="separator:aeeb355bf3d3d39a2a6ba50544139b9a7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7e7a4f1a618afbb412ef82ca2e572140"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a7e7a4f1a618afbb412ef82ca2e572140">MBEDTLS_ERR_MD_ALLOC_FAILED</a>   -0x5180</td></tr> <tr class="separator:a7e7a4f1a618afbb412ef82ca2e572140"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aab0a160e4b0efdd4cc8cbe12b4813047"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#aab0a160e4b0efdd4cc8cbe12b4813047">MBEDTLS_ERR_MD_FILE_IO_ERROR</a>   -0x5200</td></tr> <tr class="separator:aab0a160e4b0efdd4cc8cbe12b4813047"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae9f164f43b6ceeff269ceddb404466bf"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ae9f164f43b6ceeff269ceddb404466bf">MBEDTLS_ERR_MD_HW_ACCEL_FAILED</a>   -0x5280</td></tr> <tr class="separator:ae9f164f43b6ceeff269ceddb404466bf"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad3e0e65cb5b289a358b83b5af1fdd41b"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ad3e0e65cb5b289a358b83b5af1fdd41b">MBEDTLS_MD_MAX_SIZE</a>   64 /* longest known is SHA512 */</td></tr> <tr class="separator:ad3e0e65cb5b289a358b83b5af1fdd41b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa9f53b232ef244efb301233d111930dc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a></td></tr> <tr class="separator:aa9f53b232ef244efb301233d111930dc"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> Typedefs</h2></td></tr> <tr class="memitem:a496e73a6f229eba89b4abd9955822adb"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a></td></tr> <tr class="separator:a496e73a6f229eba89b4abd9955822adb"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> Enumerations</h2></td></tr> <tr class="memitem:a219313cb40503ec3e34a857ab98b2296"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> { <br />   <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a564288006d735f75738021342ca5f9d1">MBEDTLS_MD_NONE</a> =0, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296af765a736e226d2832625c3267c8c2472">MBEDTLS_MD_MD2</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a8f31ceaa511350d5da8393a7ce4a5704">MBEDTLS_MD_MD4</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a14fbb8d456ae15f082c2360200cd50bf">MBEDTLS_MD_MD5</a>, <br />   <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a800a5ff57003d84ac73f1aadeaaf00fe">MBEDTLS_MD_SHA1</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a77e7fbd0fa5e31e7e1c9295928568f74">MBEDTLS_MD_SHA224</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a7634aa1a264b0e1a5ec65f4ed77468f8">MBEDTLS_MD_SHA256</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a39dd5c95e28fac45c3f18e55b11329cb">MBEDTLS_MD_SHA384</a>, <br />   <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a0cdbe8272ceee7d63b2bfadd5ed05c26">MBEDTLS_MD_SHA512</a>, <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296a1c358adae154d70c5eb131efcb5d4caf">MBEDTLS_MD_RIPEMD160</a> <br /> }<tr class="memdesc:a219313cb40503ec3e34a857ab98b2296"><td class="mdescLeft"> </td><td class="mdescRight">Enumeration of supported message digests. <a href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">More...</a><br /></td></tr> </td></tr> <tr class="separator:a219313cb40503ec3e34a857ab98b2296"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:a51dc7cc39a5bf5b894cc1616bf798c06"><td class="memItemLeft" align="right" valign="top">const int * </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a51dc7cc39a5bf5b894cc1616bf798c06">mbedtls_md_list</a> (void)</td></tr> <tr class="memdesc:a51dc7cc39a5bf5b894cc1616bf798c06"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the list of digests supported by the generic digest module. <a href="#a51dc7cc39a5bf5b894cc1616bf798c06">More...</a><br /></td></tr> <tr class="separator:a51dc7cc39a5bf5b894cc1616bf798c06"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac4619cce171e558d059baae35da50a2a"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ac4619cce171e558d059baae35da50a2a">mbedtls_md_info_from_string</a> (const char *md_name)</td></tr> <tr class="memdesc:ac4619cce171e558d059baae35da50a2a"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the message-digest information associated with the given digest name. <a href="#ac4619cce171e558d059baae35da50a2a">More...</a><br /></td></tr> <tr class="separator:ac4619cce171e558d059baae35da50a2a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aca53b51e0c8eb0e07c7eb4a3e6acfa0d"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#aca53b51e0c8eb0e07c7eb4a3e6acfa0d">mbedtls_md_info_from_type</a> (<a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> md_type)</td></tr> <tr class="memdesc:aca53b51e0c8eb0e07c7eb4a3e6acfa0d"><td class="mdescLeft"> </td><td class="mdescRight">This function returns the message-digest information associated with the given digest type. <a href="#aca53b51e0c8eb0e07c7eb4a3e6acfa0d">More...</a><br /></td></tr> <tr class="separator:aca53b51e0c8eb0e07c7eb4a3e6acfa0d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad8b02927ca10552e3cbf293fa8c10e24"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ad8b02927ca10552e3cbf293fa8c10e24">mbedtls_md_init</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx)</td></tr> <tr class="memdesc:ad8b02927ca10552e3cbf293fa8c10e24"><td class="mdescLeft"> </td><td class="mdescRight">This function initializes a message-digest context without binding it to a particular message-digest algorithm. <a href="#ad8b02927ca10552e3cbf293fa8c10e24">More...</a><br /></td></tr> <tr class="separator:ad8b02927ca10552e3cbf293fa8c10e24"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af3248ddb6ad05035292fa92ac4af2587"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587">mbedtls_md_free</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx)</td></tr> <tr class="memdesc:af3248ddb6ad05035292fa92ac4af2587"><td class="mdescLeft"> </td><td class="mdescRight">This function clears the internal structure of <code>ctx</code> and frees any embedded internal structure, but does not free <code>ctx</code> itself. <a href="#af3248ddb6ad05035292fa92ac4af2587">More...</a><br /></td></tr> <tr class="separator:af3248ddb6ad05035292fa92ac4af2587"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a40d6e9a8c2ee4d9c24782d4dd6fc7c36"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a40d6e9a8c2ee4d9c24782d4dd6fc7c36">mbedtls_md_init_ctx</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info) <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a></td></tr> <tr class="memdesc:a40d6e9a8c2ee4d9c24782d4dd6fc7c36"><td class="mdescLeft"> </td><td class="mdescRight">This function selects the message digest algorithm to use, and allocates internal structures. <a href="#a40d6e9a8c2ee4d9c24782d4dd6fc7c36">More...</a><br /></td></tr> <tr class="separator:a40d6e9a8c2ee4d9c24782d4dd6fc7c36"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1b858111212997b90bd7d2c71010a7ec"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec">mbedtls_md_setup</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info, int hmac)</td></tr> <tr class="memdesc:a1b858111212997b90bd7d2c71010a7ec"><td class="mdescLeft"> </td><td class="mdescRight">This function selects the message digest algorithm to use, and allocates internal structures. <a href="#a1b858111212997b90bd7d2c71010a7ec">More...</a><br /></td></tr> <tr class="separator:a1b858111212997b90bd7d2c71010a7ec"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a5140622773fa71bbe87ca521e57ff8c2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a5140622773fa71bbe87ca521e57ff8c2">mbedtls_md_clone</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *dst, const <a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *src)</td></tr> <tr class="memdesc:a5140622773fa71bbe87ca521e57ff8c2"><td class="mdescLeft"> </td><td class="mdescRight">This function clones the state of an message-digest context. <a href="#a5140622773fa71bbe87ca521e57ff8c2">More...</a><br /></td></tr> <tr class="separator:a5140622773fa71bbe87ca521e57ff8c2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae20f4ddcf2bbf2e59cafc6fab8c993d6"><td class="memItemLeft" align="right" valign="top">unsigned char </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ae20f4ddcf2bbf2e59cafc6fab8c993d6">mbedtls_md_get_size</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info)</td></tr> <tr class="memdesc:ae20f4ddcf2bbf2e59cafc6fab8c993d6"><td class="mdescLeft"> </td><td class="mdescRight">This function extracts the message-digest size from the message-digest information structure. <a href="#ae20f4ddcf2bbf2e59cafc6fab8c993d6">More...</a><br /></td></tr> <tr class="separator:ae20f4ddcf2bbf2e59cafc6fab8c993d6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7a084e1b71c78daa7071691f60de5131"><td class="memItemLeft" align="right" valign="top"><a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a7a084e1b71c78daa7071691f60de5131">mbedtls_md_get_type</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info)</td></tr> <tr class="memdesc:a7a084e1b71c78daa7071691f60de5131"><td class="mdescLeft"> </td><td class="mdescRight">This function extracts the message-digest type from the message-digest information structure. <a href="#a7a084e1b71c78daa7071691f60de5131">More...</a><br /></td></tr> <tr class="separator:a7a084e1b71c78daa7071691f60de5131"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3ceb9e6b3d4b21612ef5d7532872c6bc"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a3ceb9e6b3d4b21612ef5d7532872c6bc">mbedtls_md_get_name</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info)</td></tr> <tr class="memdesc:a3ceb9e6b3d4b21612ef5d7532872c6bc"><td class="mdescLeft"> </td><td class="mdescRight">This function extracts the message-digest name from the message-digest information structure. <a href="#a3ceb9e6b3d4b21612ef5d7532872c6bc">More...</a><br /></td></tr> <tr class="separator:a3ceb9e6b3d4b21612ef5d7532872c6bc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a24483eff556810e3489ac6abefa328e6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a24483eff556810e3489ac6abefa328e6">mbedtls_md_starts</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx)</td></tr> <tr class="memdesc:a24483eff556810e3489ac6abefa328e6"><td class="mdescLeft"> </td><td class="mdescRight">This function starts a message-digest computation. <a href="#a24483eff556810e3489ac6abefa328e6">More...</a><br /></td></tr> <tr class="separator:a24483eff556810e3489ac6abefa328e6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7e50ce3a8c75b5221d07be657b93ca94"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a7e50ce3a8c75b5221d07be657b93ca94">mbedtls_md_update</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const unsigned char *input, size_t ilen)</td></tr> <tr class="memdesc:a7e50ce3a8c75b5221d07be657b93ca94"><td class="mdescLeft"> </td><td class="mdescRight">This function feeds an input buffer into an ongoing message-digest computation. <a href="#a7e50ce3a8c75b5221d07be657b93ca94">More...</a><br /></td></tr> <tr class="separator:a7e50ce3a8c75b5221d07be657b93ca94"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adf77ab9b0f117367883988ee5f0af1f4"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#adf77ab9b0f117367883988ee5f0af1f4">mbedtls_md_finish</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, unsigned char *output)</td></tr> <tr class="memdesc:adf77ab9b0f117367883988ee5f0af1f4"><td class="mdescLeft"> </td><td class="mdescRight">This function finishes the digest operation, and writes the result to the output buffer. <a href="#adf77ab9b0f117367883988ee5f0af1f4">More...</a><br /></td></tr> <tr class="separator:adf77ab9b0f117367883988ee5f0af1f4"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a36c5d8bda1905e0434708f0ef5912dda"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a36c5d8bda1905e0434708f0ef5912dda">mbedtls_md</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info, const unsigned char *input, size_t ilen, unsigned char *output)</td></tr> <tr class="memdesc:a36c5d8bda1905e0434708f0ef5912dda"><td class="mdescLeft"> </td><td class="mdescRight">This function calculates the message-digest of a buffer, with respect to a configurable message-digest algorithm in a single call. <a href="#a36c5d8bda1905e0434708f0ef5912dda">More...</a><br /></td></tr> <tr class="separator:a36c5d8bda1905e0434708f0ef5912dda"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acab221f8ac78e15ac1dd2eda4f1b2c30"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#acab221f8ac78e15ac1dd2eda4f1b2c30">mbedtls_md_file</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info, const char *path, unsigned char *output)</td></tr> <tr class="memdesc:acab221f8ac78e15ac1dd2eda4f1b2c30"><td class="mdescLeft"> </td><td class="mdescRight">This function calculates the message-digest checksum result of the contents of the provided file. <a href="#acab221f8ac78e15ac1dd2eda4f1b2c30">More...</a><br /></td></tr> <tr class="separator:acab221f8ac78e15ac1dd2eda4f1b2c30"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a8968f8659fc277f013374c1bac8d4d1a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a8968f8659fc277f013374c1bac8d4d1a">mbedtls_md_hmac_starts</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const unsigned char *key, size_t keylen)</td></tr> <tr class="memdesc:a8968f8659fc277f013374c1bac8d4d1a"><td class="mdescLeft"> </td><td class="mdescRight">This function sets the HMAC key and prepares to authenticate a new message. <a href="#a8968f8659fc277f013374c1bac8d4d1a">More...</a><br /></td></tr> <tr class="separator:a8968f8659fc277f013374c1bac8d4d1a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a86cbea1c3bcd558a7e185ff8200a29a6"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a86cbea1c3bcd558a7e185ff8200a29a6">mbedtls_md_hmac_update</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const unsigned char *input, size_t ilen)</td></tr> <tr class="memdesc:a86cbea1c3bcd558a7e185ff8200a29a6"><td class="mdescLeft"> </td><td class="mdescRight">This function feeds an input buffer into an ongoing HMAC computation. <a href="#a86cbea1c3bcd558a7e185ff8200a29a6">More...</a><br /></td></tr> <tr class="separator:a86cbea1c3bcd558a7e185ff8200a29a6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a7aeafef80c89e47ee3033035a6a75a27"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a7aeafef80c89e47ee3033035a6a75a27">mbedtls_md_hmac_finish</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, unsigned char *output)</td></tr> <tr class="memdesc:a7aeafef80c89e47ee3033035a6a75a27"><td class="mdescLeft"> </td><td class="mdescRight">This function finishes the HMAC operation, and writes the result to the output buffer. <a href="#a7aeafef80c89e47ee3033035a6a75a27">More...</a><br /></td></tr> <tr class="separator:a7aeafef80c89e47ee3033035a6a75a27"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3a5c64b5bda0f294e917ccd5a8ca234e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a3a5c64b5bda0f294e917ccd5a8ca234e">mbedtls_md_hmac_reset</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx)</td></tr> <tr class="memdesc:a3a5c64b5bda0f294e917ccd5a8ca234e"><td class="mdescLeft"> </td><td class="mdescRight">This function prepares to authenticate a new message with the same key as the previous HMAC operation. <a href="#a3a5c64b5bda0f294e917ccd5a8ca234e">More...</a><br /></td></tr> <tr class="separator:a3a5c64b5bda0f294e917ccd5a8ca234e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a2eefd37cdf52a1fcc04f8545fe890d10"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#a2eefd37cdf52a1fcc04f8545fe890d10">mbedtls_md_hmac</a> (const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *md_info, const unsigned char *key, size_t keylen, const unsigned char *input, size_t ilen, unsigned char *output)</td></tr> <tr class="memdesc:a2eefd37cdf52a1fcc04f8545fe890d10"><td class="mdescLeft"> </td><td class="mdescRight">This function calculates the full generic HMAC on the input buffer with the provided key. <a href="#a2eefd37cdf52a1fcc04f8545fe890d10">More...</a><br /></td></tr> <tr class="separator:a2eefd37cdf52a1fcc04f8545fe890d10"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ab827b7d1ef7ee631861c7edd33c7b570"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="md_8h.html#ab827b7d1ef7ee631861c7edd33c7b570">mbedtls_md_process</a> (<a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> *ctx, const unsigned char *data)</td></tr> <tr class="separator:ab827b7d1ef7ee631861c7edd33c7b570"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>The generic message-digest wrapper. </p> <dl class="section author"><dt>Author</dt><dd>Adriaan de Jong <a href="#" onclick="location.href='mai'+'lto:'+'dej'+'on'+'g@f'+'ox'+'-it'+'.c'+'om'; return false;">dejon<span style="display: none;">.nosp@m.</span>g@fo<span style="display: none;">.nosp@m.</span>x-it.<span style="display: none;">.nosp@m.</span>com</a> </dd></dl> <p class="definition">Definition in file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div><h2 class="groupheader">Macro Definition Documentation</h2> <a id="aa9f53b232ef244efb301233d111930dc"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa9f53b232ef244efb301233d111930dc">◆ </a></span>MBEDTLS_DEPRECATED</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_DEPRECATED</td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00156">156</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="a7e7a4f1a618afbb412ef82ca2e572140"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7e7a4f1a618afbb412ef82ca2e572140">◆ </a></span>MBEDTLS_ERR_MD_ALLOC_FAILED</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_MD_ALLOC_FAILED   -0x5180</td> </tr> </table> </div><div class="memdoc"> <p>Failed to allocate memory. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00040">40</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="aeeb355bf3d3d39a2a6ba50544139b9a7"></a> <h2 class="memtitle"><span class="permalink"><a href="#aeeb355bf3d3d39a2a6ba50544139b9a7">◆ </a></span>MBEDTLS_ERR_MD_BAD_INPUT_DATA</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_MD_BAD_INPUT_DATA   -0x5100</td> </tr> </table> </div><div class="memdoc"> <p>Bad input parameters to function. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00039">39</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="a121b228f0512def159e3bd4ced07633b"></a> <h2 class="memtitle"><span class="permalink"><a href="#a121b228f0512def159e3bd4ced07633b">◆ </a></span>MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE   -0x5080</td> </tr> </table> </div><div class="memdoc"> <p>The selected feature is not available. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00038">38</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="aab0a160e4b0efdd4cc8cbe12b4813047"></a> <h2 class="memtitle"><span class="permalink"><a href="#aab0a160e4b0efdd4cc8cbe12b4813047">◆ </a></span>MBEDTLS_ERR_MD_FILE_IO_ERROR</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_MD_FILE_IO_ERROR   -0x5200</td> </tr> </table> </div><div class="memdoc"> <p>Opening or reading of file failed. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00041">41</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="ae9f164f43b6ceeff269ceddb404466bf"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae9f164f43b6ceeff269ceddb404466bf">◆ </a></span>MBEDTLS_ERR_MD_HW_ACCEL_FAILED</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_MD_HW_ACCEL_FAILED   -0x5280</td> </tr> </table> </div><div class="memdoc"> <p>MD hardware accelerator failed. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00042">42</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <a id="ad3e0e65cb5b289a358b83b5af1fdd41b"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad3e0e65cb5b289a358b83b5af1fdd41b">◆ </a></span>MBEDTLS_MD_MAX_SIZE</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_MD_MAX_SIZE   64 /* longest known is SHA512 */</td> </tr> </table> </div><div class="memdoc"> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00070">70</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <h2 class="groupheader">Typedef Documentation</h2> <a id="a496e73a6f229eba89b4abd9955822adb"></a> <h2 class="memtitle"><span class="permalink"><a href="#a496e73a6f229eba89b4abd9955822adb">◆ </a></span>mbedtls_md_info_t</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef struct <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a></td> </tr> </table> </div><div class="memdoc"> <p>Opaque struct defined in md_internal.h. </p> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00078">78</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <h2 class="groupheader">Enumeration Type Documentation</h2> <a id="a219313cb40503ec3e34a857ab98b2296"></a> <h2 class="memtitle"><span class="permalink"><a href="#a219313cb40503ec3e34a857ab98b2296">◆ </a></span>mbedtls_md_type_t</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a></td> </tr> </table> </div><div class="memdoc"> <p>Enumeration of supported message digests. </p> <dl class="section warning"><dt>Warning</dt><dd>MD2, MD4, MD5 and SHA-1 are considered weak message digests and their use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a564288006d735f75738021342ca5f9d1"></a>MBEDTLS_MD_NONE </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296af765a736e226d2832625c3267c8c2472"></a>MBEDTLS_MD_MD2 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a8f31ceaa511350d5da8393a7ce4a5704"></a>MBEDTLS_MD_MD4 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a14fbb8d456ae15f082c2360200cd50bf"></a>MBEDTLS_MD_MD5 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a800a5ff57003d84ac73f1aadeaaf00fe"></a>MBEDTLS_MD_SHA1 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a77e7fbd0fa5e31e7e1c9295928568f74"></a>MBEDTLS_MD_SHA224 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a7634aa1a264b0e1a5ec65f4ed77468f8"></a>MBEDTLS_MD_SHA256 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a39dd5c95e28fac45c3f18e55b11329cb"></a>MBEDTLS_MD_SHA384 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a0cdbe8272ceee7d63b2bfadd5ed05c26"></a>MBEDTLS_MD_SHA512 </td><td class="fielddoc"></td></tr> <tr><td class="fieldname"><a id="a219313cb40503ec3e34a857ab98b2296a1c358adae154d70c5eb131efcb5d4caf"></a>MBEDTLS_MD_RIPEMD160 </td><td class="fielddoc"></td></tr> </table> <p class="definition">Definition at line <a class="el" href="md_8h_source.html#l00056">56</a> of file <a class="el" href="md_8h_source.html">md.h</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a id="a36c5d8bda1905e0434708f0ef5912dda"></a> <h2 class="memtitle"><span class="permalink"><a href="#a36c5d8bda1905e0434708f0ef5912dda">◆ </a></span>mbedtls_md()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>input</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>ilen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"><em>output</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function calculates the message-digest of a buffer, with respect to a configurable message-digest algorithm in a single call. </p> <p>The result is calculated as Output = message_digest(input buffer).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use. </td></tr> <tr><td class="paramname">input</td><td>The buffer holding the data. </td></tr> <tr><td class="paramname">ilen</td><td>The length of the input data. </td></tr> <tr><td class="paramname">output</td><td>The generic message-digest checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a5140622773fa71bbe87ca521e57ff8c2"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5140622773fa71bbe87ca521e57ff8c2">◆ </a></span>mbedtls_md_clone()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_clone </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>dst</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>src</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function clones the state of an message-digest context. </p> <dl class="section note"><dt>Note</dt><dd>You must call <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a> on <code>dst</code> before calling this function.</dd> <dd> The two contexts must have the same type, for example, both are SHA-256.</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>This function clones the message-digest state, not the HMAC state.</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">dst</td><td>The destination context. </td></tr> <tr><td class="paramname">src</td><td>The context to be cloned.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> on parameter failure. </dd></dl> </div> </div> <a id="acab221f8ac78e15ac1dd2eda4f1b2c30"></a> <h2 class="memtitle"><span class="permalink"><a href="#acab221f8ac78e15ac1dd2eda4f1b2c30">◆ </a></span>mbedtls_md_file()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_file </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"><em>path</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"><em>output</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function calculates the message-digest checksum result of the contents of the provided file. </p> <p>The result is calculated as Output = message_digest(file contents).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use. </td></tr> <tr><td class="paramname">path</td><td>The input file name. </td></tr> <tr><td class="paramname">output</td><td>The generic message-digest checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aab0a160e4b0efdd4cc8cbe12b4813047">MBEDTLS_ERR_MD_FILE_IO_ERROR</a> if file input failed, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if <code>md_info</code> was NULL. </dd></dl> </div> </div> <a id="adf77ab9b0f117367883988ee5f0af1f4"></a> <h2 class="memtitle"><span class="permalink"><a href="#adf77ab9b0f117367883988ee5f0af1f4">◆ </a></span>mbedtls_md_finish()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_finish </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"><em>output</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function finishes the digest operation, and writes the result to the output buffer. </p> <p>Call this function after a call to <a class="el" href="md_8h.html#a24483eff556810e3489ac6abefa328e6" title="This function starts a message-digest computation. ">mbedtls_md_starts()</a>, followed by any number of calls to <a class="el" href="md_8h.html#a7e50ce3a8c75b5221d07be657b93ca94" title="This function feeds an input buffer into an ongoing message-digest computation. ">mbedtls_md_update()</a>. Afterwards, you may either clear the context with <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a>, or call <a class="el" href="md_8h.html#a24483eff556810e3489ac6abefa328e6" title="This function starts a message-digest computation. ">mbedtls_md_starts()</a> to reuse the context for another digest operation with the same algorithm.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The generic message-digest context. </td></tr> <tr><td class="paramname">output</td><td>The buffer for the generic message-digest checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="af3248ddb6ad05035292fa92ac4af2587"></a> <h2 class="memtitle"><span class="permalink"><a href="#af3248ddb6ad05035292fa92ac4af2587">◆ </a></span>mbedtls_md_free()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mbedtls_md_free </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function clears the internal structure of <code>ctx</code> and frees any embedded internal structure, but does not free <code>ctx</code> itself. </p> <p>If you have called <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a> on <code>ctx</code>, you must call <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a> when you are no longer using the context. Calling this function if you have previously called <a class="el" href="md_8h.html#ad8b02927ca10552e3cbf293fa8c10e24" title="This function initializes a message-digest context without binding it to a particular message-digest ...">mbedtls_md_init()</a> and nothing else is optional. You must not call this function if you have not called <a class="el" href="md_8h.html#ad8b02927ca10552e3cbf293fa8c10e24" title="This function initializes a message-digest context without binding it to a particular message-digest ...">mbedtls_md_init()</a>. </p> </div> </div> <a id="a3ceb9e6b3d4b21612ef5d7532872c6bc"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3ceb9e6b3d4b21612ef5d7532872c6bc">◆ </a></span>mbedtls_md_get_name()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const char* mbedtls_md_get_name </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function extracts the message-digest name from the message-digest information structure. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The name of the message digest. </dd></dl> </div> </div> <a id="ae20f4ddcf2bbf2e59cafc6fab8c993d6"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae20f4ddcf2bbf2e59cafc6fab8c993d6">◆ </a></span>mbedtls_md_get_size()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned char mbedtls_md_get_size </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function extracts the message-digest size from the message-digest information structure. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The size of the message-digest output in Bytes. </dd></dl> </div> </div> <a id="a7a084e1b71c78daa7071691f60de5131"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7a084e1b71c78daa7071691f60de5131">◆ </a></span>mbedtls_md_get_type()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> mbedtls_md_get_type </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function extracts the message-digest type from the message-digest information structure. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The type of the message digest. </dd></dl> </div> </div> <a id="a2eefd37cdf52a1fcc04f8545fe890d10"></a> <h2 class="memtitle"><span class="permalink"><a href="#a2eefd37cdf52a1fcc04f8545fe890d10">◆ </a></span>mbedtls_md_hmac()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_hmac </td> <td>(</td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>keylen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>input</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>ilen</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"><em>output</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function calculates the full generic HMAC on the input buffer with the provided key. </p> <p>The function allocates the context, performs the calculation, and frees the context.</p> <p>The HMAC result is calculated as output = generic HMAC(hmac key, input buffer).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use. </td></tr> <tr><td class="paramname">key</td><td>The HMAC secret key. </td></tr> <tr><td class="paramname">keylen</td><td>The length of the HMAC secret key in Bytes. </td></tr> <tr><td class="paramname">input</td><td>The buffer holding the input data. </td></tr> <tr><td class="paramname">ilen</td><td>The length of the input data. </td></tr> <tr><td class="paramname">output</td><td>The generic HMAC result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a7aeafef80c89e47ee3033035a6a75a27"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7aeafef80c89e47ee3033035a6a75a27">◆ </a></span>mbedtls_md_hmac_finish()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_hmac_finish </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"><em>output</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function finishes the HMAC operation, and writes the result to the output buffer. </p> <p>Call this function after <a class="el" href="md_8h.html#a8968f8659fc277f013374c1bac8d4d1a" title="This function sets the HMAC key and prepares to authenticate a new message. ">mbedtls_md_hmac_starts()</a> and <a class="el" href="md_8h.html#a86cbea1c3bcd558a7e185ff8200a29a6" title="This function feeds an input buffer into an ongoing HMAC computation. ">mbedtls_md_hmac_update()</a> to get the HMAC value. Afterwards you may either call <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a> to clear the context, or call <a class="el" href="md_8h.html#a3a5c64b5bda0f294e917ccd5a8ca234e" title="This function prepares to authenticate a new message with the same key as the previous HMAC operation...">mbedtls_md_hmac_reset()</a> to reuse the context with the same HMAC key.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The message digest context containing an embedded HMAC context. </td></tr> <tr><td class="paramname">output</td><td>The generic HMAC checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a3a5c64b5bda0f294e917ccd5a8ca234e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3a5c64b5bda0f294e917ccd5a8ca234e">◆ </a></span>mbedtls_md_hmac_reset()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_hmac_reset </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function prepares to authenticate a new message with the same key as the previous HMAC operation. </p> <p>You may call this function after <a class="el" href="md_8h.html#a7aeafef80c89e47ee3033035a6a75a27" title="This function finishes the HMAC operation, and writes the result to the output buffer. ">mbedtls_md_hmac_finish()</a>. Afterwards call <a class="el" href="md_8h.html#a86cbea1c3bcd558a7e185ff8200a29a6" title="This function feeds an input buffer into an ongoing HMAC computation. ">mbedtls_md_hmac_update()</a> to pass the new input.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The message digest context containing an embedded HMAC context.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a8968f8659fc277f013374c1bac8d4d1a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a8968f8659fc277f013374c1bac8d4d1a">◆ </a></span>mbedtls_md_hmac_starts()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_hmac_starts </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>keylen</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function sets the HMAC key and prepares to authenticate a new message. </p> <p>Call this function after <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a>, to use the MD context for an HMAC calculation, then call <a class="el" href="md_8h.html#a86cbea1c3bcd558a7e185ff8200a29a6" title="This function feeds an input buffer into an ongoing HMAC computation. ">mbedtls_md_hmac_update()</a> to provide the input data, and <a class="el" href="md_8h.html#a7aeafef80c89e47ee3033035a6a75a27" title="This function finishes the HMAC operation, and writes the result to the output buffer. ">mbedtls_md_hmac_finish()</a> to get the HMAC value.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The message digest context containing an embedded HMAC context. </td></tr> <tr><td class="paramname">key</td><td>The HMAC secret key. </td></tr> <tr><td class="paramname">keylen</td><td>The length of the HMAC key in Bytes.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a86cbea1c3bcd558a7e185ff8200a29a6"></a> <h2 class="memtitle"><span class="permalink"><a href="#a86cbea1c3bcd558a7e185ff8200a29a6">◆ </a></span>mbedtls_md_hmac_update()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_hmac_update </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>input</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>ilen</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function feeds an input buffer into an ongoing HMAC computation. </p> <p>Call <a class="el" href="md_8h.html#a8968f8659fc277f013374c1bac8d4d1a" title="This function sets the HMAC key and prepares to authenticate a new message. ">mbedtls_md_hmac_starts()</a> or <a class="el" href="md_8h.html#a3a5c64b5bda0f294e917ccd5a8ca234e" title="This function prepares to authenticate a new message with the same key as the previous HMAC operation...">mbedtls_md_hmac_reset()</a> before calling this function. You may call this function multiple times to pass the input piecewise. Afterwards, call <a class="el" href="md_8h.html#a7aeafef80c89e47ee3033035a6a75a27" title="This function finishes the HMAC operation, and writes the result to the output buffer. ">mbedtls_md_hmac_finish()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The message digest context containing an embedded HMAC context. </td></tr> <tr><td class="paramname">input</td><td>The buffer holding the input data. </td></tr> <tr><td class="paramname">ilen</td><td>The length of the input data.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="ac4619cce171e558d059baae35da50a2a"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac4619cce171e558d059baae35da50a2a">◆ </a></span>mbedtls_md_info_from_string()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a>* mbedtls_md_info_from_string </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"><em>md_name</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function returns the message-digest information associated with the given digest name. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_name</td><td>The name of the digest to search for.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The message-digest information associated with <code>md_name</code>, or NULL if not found. </dd></dl> </div> </div> <a id="aca53b51e0c8eb0e07c7eb4a3e6acfa0d"></a> <h2 class="memtitle"><span class="permalink"><a href="#aca53b51e0c8eb0e07c7eb4a3e6acfa0d">◆ </a></span>mbedtls_md_info_from_type()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a>* mbedtls_md_info_from_type </td> <td>(</td> <td class="paramtype"><a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> </td> <td class="paramname"><em>md_type</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function returns the message-digest information associated with the given digest type. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">md_type</td><td>The type of digest to search for.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>The message-digest information associated with <code>md_type</code>, or NULL if not found. </dd></dl> </div> </div> <a id="ad8b02927ca10552e3cbf293fa8c10e24"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad8b02927ca10552e3cbf293fa8c10e24">◆ </a></span>mbedtls_md_init()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mbedtls_md_init </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function initializes a message-digest context without binding it to a particular message-digest algorithm. </p> <p>This function should always be called first. It prepares the context for <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a> for binding it to a message-digest algorithm. </p> </div> </div> <a id="a40d6e9a8c2ee4d9c24782d4dd6fc7c36"></a> <h2 class="memtitle"><span class="permalink"><a href="#a40d6e9a8c2ee4d9c24782d4dd6fc7c36">◆ </a></span>mbedtls_md_init_ctx()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_init_ctx </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function selects the message digest algorithm to use, and allocates internal structures. </p> <p>It should be called after <a class="el" href="md_8h.html#ad8b02927ca10552e3cbf293fa8c10e24" title="This function initializes a message-digest context without binding it to a particular message-digest ...">mbedtls_md_init()</a> or <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a>. Makes it necessary to call <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a> later.</p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000008">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a> in 2.0.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The context to set up. </td></tr> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> on parameter failure, <a class="el" href="md_8h.html#a7e7a4f1a618afbb412ef82ca2e572140">MBEDTLS_ERR_MD_ALLOC_FAILED</a> memory allocation failure. </dd></dl> </div> </div> <a id="a51dc7cc39a5bf5b894cc1616bf798c06"></a> <h2 class="memtitle"><span class="permalink"><a href="#a51dc7cc39a5bf5b894cc1616bf798c06">◆ </a></span>mbedtls_md_list()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const int* mbedtls_md_list </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function returns the list of digests supported by the generic digest module. </p> <dl class="section return"><dt>Returns</dt><dd>A statically allocated array of digests. Each element in the returned list is an integer belonging to the message-digest enumeration <a class="el" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296" title="Enumeration of supported message digests. ">mbedtls_md_type_t</a>. The last entry is 0. </dd></dl> </div> </div> <a id="ab827b7d1ef7ee631861c7edd33c7b570"></a> <h2 class="memtitle"><span class="permalink"><a href="#ab827b7d1ef7ee631861c7edd33c7b570">◆ </a></span>mbedtls_md_process()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_process </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> </div> </div> <a id="a1b858111212997b90bd7d2c71010a7ec"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1b858111212997b90bd7d2c71010a7ec">◆ </a></span>mbedtls_md_setup()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_setup </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> * </td> <td class="paramname"><em>md_info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>hmac</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function selects the message digest algorithm to use, and allocates internal structures. </p> <p>It should be called after <a class="el" href="md_8h.html#ad8b02927ca10552e3cbf293fa8c10e24" title="This function initializes a message-digest context without binding it to a particular message-digest ...">mbedtls_md_init()</a> or <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a>. Makes it necessary to call <a class="el" href="md_8h.html#af3248ddb6ad05035292fa92ac4af2587" title="This function clears the internal structure of ctx and frees any embedded internal structure...">mbedtls_md_free()</a> later.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The context to set up. </td></tr> <tr><td class="paramname">md_info</td><td>The information structure of the message-digest algorithm to use. </td></tr> <tr><td class="paramname">hmac</td><td><ul> <li> 0: HMAC is not used. Saves some memory. </li> <li> non-zero: HMAC is used with this context.</li> </ul> </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> on parameter failure, or <a class="el" href="md_8h.html#a7e7a4f1a618afbb412ef82ca2e572140">MBEDTLS_ERR_MD_ALLOC_FAILED</a> on memory allocation failure. </dd></dl> </div> </div> <a id="a24483eff556810e3489ac6abefa328e6"></a> <h2 class="memtitle"><span class="permalink"><a href="#a24483eff556810e3489ac6abefa328e6">◆ </a></span>mbedtls_md_starts()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_starts </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function starts a message-digest computation. </p> <p>You must call this function after setting up the context with <a class="el" href="md_8h.html#a1b858111212997b90bd7d2c71010a7ec" title="This function selects the message digest algorithm to use, and allocates internal structures...">mbedtls_md_setup()</a>, and before passing data with <a class="el" href="md_8h.html#a7e50ce3a8c75b5221d07be657b93ca94" title="This function feeds an input buffer into an ongoing message-digest computation. ">mbedtls_md_update()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The generic message-digest context.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> <a id="a7e50ce3a8c75b5221d07be657b93ca94"></a> <h2 class="memtitle"><span class="permalink"><a href="#a7e50ce3a8c75b5221d07be657b93ca94">◆ </a></span>mbedtls_md_update()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_md_update </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__md__context__t.html">mbedtls_md_context_t</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const unsigned char * </td> <td class="paramname"><em>input</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>ilen</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function feeds an input buffer into an ongoing message-digest computation. </p> <p>You must call <a class="el" href="md_8h.html#a24483eff556810e3489ac6abefa328e6" title="This function starts a message-digest computation. ">mbedtls_md_starts()</a> before calling this function. You may call this function multiple times. Afterwards, call <a class="el" href="md_8h.html#adf77ab9b0f117367883988ee5f0af1f4" title="This function finishes the digest operation, and writes the result to the output buffer. ">mbedtls_md_finish()</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The generic message-digest context. </td></tr> <tr><td class="paramname">input</td><td>The buffer holding the input data. </td></tr> <tr><td class="paramname">ilen</td><td>The length of the input data.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, <a class="el" href="md_8h.html#aeeb355bf3d3d39a2a6ba50544139b9a7">MBEDTLS_ERR_MD_BAD_INPUT_DATA</a> if parameter verification fails. </dd></dl> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Oct 12 2018 20:26:59 for mbed TLS v2.7.6 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>