<!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.0: sha1.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.0 </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="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">sha1.h File Reference</div> </div> </div><!--header--> <div class="contents"> <p>The SHA-1 cryptographic hash function. <a href="#details">More...</a></p> <div class="textblock"><code>#include "<a class="el" href="config_8h_source.html">config.h</a>"</code><br /> <code>#include <stddef.h></code><br /> <code>#include <stdint.h></code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for sha1.h:</div> <div class="dyncontent"> <div class="center"><img src="sha1_8h__incl.png" border="0" usemap="#sha1_8h" alt=""/></div> <map name="sha1_8h" id="sha1_8h"> <area shape="rect" id="node2" href="config_8h.html" title="Configuration options (set of defines) " alt="" coords="35,80,138,107"/> <area shape="rect" id="node3" href="check__config_8h.html" title="Consistency checks for configuration options. " alt="" coords="5,155,168,181"/> </map> </div> </div> <p><a href="sha1_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__sha1__context.html">mbedtls_sha1_context</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">The SHA-1 context structure. <a href="structmbedtls__sha1__context.html#details">More...</a><br /></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:a5078e9a2c14d207930e6782d1cbc9181"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a5078e9a2c14d207930e6782d1cbc9181">MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED</a>   -0x0035</td></tr> <tr class="separator:a5078e9a2c14d207930e6782d1cbc9181"><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="sha1_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a></td></tr> <tr class="separator:aa9f53b232ef244efb301233d111930dc"><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="sha1_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="func-members"></a> Functions</h2></td></tr> <tr class="memitem:af0cc8deb8dd30a095c6023c498418d24"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#af0cc8deb8dd30a095c6023c498418d24">mbedtls_sha1_init</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx)</td></tr> <tr class="memdesc:af0cc8deb8dd30a095c6023c498418d24"><td class="mdescLeft"> </td><td class="mdescRight">This function initializes a SHA-1 context. <a href="#af0cc8deb8dd30a095c6023c498418d24">More...</a><br /></td></tr> <tr class="separator:af0cc8deb8dd30a095c6023c498418d24"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a126091a4e884966454dca38c97770a24"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a126091a4e884966454dca38c97770a24">mbedtls_sha1_free</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx)</td></tr> <tr class="memdesc:a126091a4e884966454dca38c97770a24"><td class="mdescLeft"> </td><td class="mdescRight">This function clears a SHA-1 context. <a href="#a126091a4e884966454dca38c97770a24">More...</a><br /></td></tr> <tr class="separator:a126091a4e884966454dca38c97770a24"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1d06f1cd6dc5b2849d08749eef1975f8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a1d06f1cd6dc5b2849d08749eef1975f8">mbedtls_sha1_clone</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *dst, const <a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *src)</td></tr> <tr class="memdesc:a1d06f1cd6dc5b2849d08749eef1975f8"><td class="mdescLeft"> </td><td class="mdescRight">This function clones the state of a SHA-1 context. <a href="#a1d06f1cd6dc5b2849d08749eef1975f8">More...</a><br /></td></tr> <tr class="separator:a1d06f1cd6dc5b2849d08749eef1975f8"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a75b1992ad93e9b796686c442dcd5893e"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a75b1992ad93e9b796686c442dcd5893e">mbedtls_sha1_starts_ret</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx)</td></tr> <tr class="memdesc:a75b1992ad93e9b796686c442dcd5893e"><td class="mdescLeft"> </td><td class="mdescRight">This function starts a SHA-1 checksum calculation. <a href="#a75b1992ad93e9b796686c442dcd5893e">More...</a><br /></td></tr> <tr class="separator:a75b1992ad93e9b796686c442dcd5893e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a460e674d51e2cd2d4f7ab520371d8307"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a460e674d51e2cd2d4f7ab520371d8307">mbedtls_sha1_update_ret</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, const unsigned char *input, size_t ilen)</td></tr> <tr class="memdesc:a460e674d51e2cd2d4f7ab520371d8307"><td class="mdescLeft"> </td><td class="mdescRight">This function feeds an input buffer into an ongoing SHA-1 checksum calculation. <a href="#a460e674d51e2cd2d4f7ab520371d8307">More...</a><br /></td></tr> <tr class="separator:a460e674d51e2cd2d4f7ab520371d8307"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad5386f33f3a04ca416fe89e0e8d5039d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#ad5386f33f3a04ca416fe89e0e8d5039d">mbedtls_sha1_finish_ret</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, unsigned char output[20])</td></tr> <tr class="memdesc:ad5386f33f3a04ca416fe89e0e8d5039d"><td class="mdescLeft"> </td><td class="mdescRight">This function finishes the SHA-1 operation, and writes the result to the output buffer. <a href="#ad5386f33f3a04ca416fe89e0e8d5039d">More...</a><br /></td></tr> <tr class="separator:ad5386f33f3a04ca416fe89e0e8d5039d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a691c38288ec5d507269f95f7eed2c1e0"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a691c38288ec5d507269f95f7eed2c1e0">mbedtls_internal_sha1_process</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, const unsigned char data[64])</td></tr> <tr class="memdesc:a691c38288ec5d507269f95f7eed2c1e0"><td class="mdescLeft"> </td><td class="mdescRight">SHA-1 process data block (internal use only) <a href="#a691c38288ec5d507269f95f7eed2c1e0">More...</a><br /></td></tr> <tr class="separator:a691c38288ec5d507269f95f7eed2c1e0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa3c6499a23520e06ffc3ea969d1569cf"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#aa3c6499a23520e06ffc3ea969d1569cf">mbedtls_sha1_starts</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx)</td></tr> <tr class="memdesc:aa3c6499a23520e06ffc3ea969d1569cf"><td class="mdescLeft"> </td><td class="mdescRight">SHA-1 context setup. <a href="#aa3c6499a23520e06ffc3ea969d1569cf">More...</a><br /></td></tr> <tr class="separator:aa3c6499a23520e06ffc3ea969d1569cf"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a968a7b85cef241a754d9ff7d0aab20b6"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a968a7b85cef241a754d9ff7d0aab20b6">mbedtls_sha1_update</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, const unsigned char *input, size_t ilen)</td></tr> <tr class="memdesc:a968a7b85cef241a754d9ff7d0aab20b6"><td class="mdescLeft"> </td><td class="mdescRight">SHA-1 process buffer. <a href="#a968a7b85cef241a754d9ff7d0aab20b6">More...</a><br /></td></tr> <tr class="separator:a968a7b85cef241a754d9ff7d0aab20b6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a90f8f00e0d29946ad5ee1a490009211e"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a90f8f00e0d29946ad5ee1a490009211e">mbedtls_sha1_finish</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, unsigned char output[20])</td></tr> <tr class="memdesc:a90f8f00e0d29946ad5ee1a490009211e"><td class="mdescLeft"> </td><td class="mdescRight">SHA-1 final digest. <a href="#a90f8f00e0d29946ad5ee1a490009211e">More...</a><br /></td></tr> <tr class="separator:a90f8f00e0d29946ad5ee1a490009211e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a31026409c719bcfadc553a5e4ec6e76a"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a31026409c719bcfadc553a5e4ec6e76a">mbedtls_sha1_process</a> (<a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> *ctx, const unsigned char data[64])</td></tr> <tr class="memdesc:a31026409c719bcfadc553a5e4ec6e76a"><td class="mdescLeft"> </td><td class="mdescRight">SHA-1 process data block (internal use only) <a href="#a31026409c719bcfadc553a5e4ec6e76a">More...</a><br /></td></tr> <tr class="separator:a31026409c719bcfadc553a5e4ec6e76a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a332d382923412f8960b8558118fdfa90"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a332d382923412f8960b8558118fdfa90">mbedtls_sha1_ret</a> (const unsigned char *input, size_t ilen, unsigned char output[20])</td></tr> <tr class="memdesc:a332d382923412f8960b8558118fdfa90"><td class="mdescLeft"> </td><td class="mdescRight">This function calculates the SHA-1 checksum of a buffer. <a href="#a332d382923412f8960b8558118fdfa90">More...</a><br /></td></tr> <tr class="separator:a332d382923412f8960b8558118fdfa90"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a332ca8a99178df92ae76bc42cbed409c"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a332ca8a99178df92ae76bc42cbed409c">mbedtls_sha1</a> (const unsigned char *input, size_t ilen, unsigned char output[20])</td></tr> <tr class="memdesc:a332ca8a99178df92ae76bc42cbed409c"><td class="mdescLeft"> </td><td class="mdescRight">Output = SHA-1( input buffer ) <a href="#a332ca8a99178df92ae76bc42cbed409c">More...</a><br /></td></tr> <tr class="separator:a332ca8a99178df92ae76bc42cbed409c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3666efb450a6bbe9588d6b835dc566cf"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="sha1_8h.html#a3666efb450a6bbe9588d6b835dc566cf">mbedtls_sha1_self_test</a> (int verbose)</td></tr> <tr class="memdesc:a3666efb450a6bbe9588d6b835dc566cf"><td class="mdescLeft"> </td><td class="mdescRight">The SHA-1 checkup routine. <a href="#a3666efb450a6bbe9588d6b835dc566cf">More...</a><br /></td></tr> <tr class="separator:a3666efb450a6bbe9588d6b835dc566cf"><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 SHA-1 cryptographic hash function. </p> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition in file <a class="el" href="sha1_8h_source.html">sha1.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 <span class="overload">[1/2]</span></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="sha1_8h_source.html#l00304">304</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> </div> </div> <a id="aa9f53b232ef244efb301233d111930dc"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa9f53b232ef244efb301233d111930dc">◆ </a></span>MBEDTLS_DEPRECATED <span class="overload">[2/2]</span></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="sha1_8h_source.html#l00304">304</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> </div> </div> <a id="a5078e9a2c14d207930e6782d1cbc9181"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5078e9a2c14d207930e6782d1cbc9181">◆ </a></span>MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define MBEDTLS_ERR_SHA1_HW_ACCEL_FAILED   -0x0035</td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 hardware accelerator failed </p> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00040">40</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a id="a691c38288ec5d507269f95f7eed2c1e0"></a> <h2 class="memtitle"><span class="permalink"><a href="#a691c38288ec5d507269f95f7eed2c1e0">◆ </a></span>mbedtls_internal_sha1_process()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_internal_sha1_process </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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>[64] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 process data block (internal use only) </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>SHA-1 context </td></tr> <tr><td class="paramname">data</td><td>The data block being processed.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> if successful</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00254">mbedtls_sha1_process()</a>.</p> </div> </div> <a id="a332ca8a99178df92ae76bc42cbed409c"></a> <h2 class="memtitle"><span class="permalink"><a href="#a332ca8a99178df92ae76bc42cbed409c">◆ </a></span>mbedtls_sha1()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void mbedtls_sha1 </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>[20] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Output = SHA-1( input buffer ) </p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000045">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="sha1_8h.html#a332d382923412f8960b8558118fdfa90" title="This function calculates the SHA-1 checksum of a buffer. ">mbedtls_sha1_ret()</a> in 2.7.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <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 SHA-1 checksum result.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00320">320</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> <p class="reference">References <a class="el" href="sha1_8h.html#a332d382923412f8960b8558118fdfa90">mbedtls_sha1_ret()</a>, and <a class="el" href="sha1_8h.html#a3666efb450a6bbe9588d6b835dc566cf">mbedtls_sha1_self_test()</a>.</p> </div> </div> <a id="a1d06f1cd6dc5b2849d08749eef1975f8"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1d06f1cd6dc5b2849d08749eef1975f8">◆ </a></span>mbedtls_sha1_clone()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mbedtls_sha1_clone </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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__sha1__context.html">mbedtls_sha1_context</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 a SHA-1 context. </p> <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 clone.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> </div> </div> <a id="a90f8f00e0d29946ad5ee1a490009211e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a90f8f00e0d29946ad5ee1a490009211e">◆ </a></span>mbedtls_sha1_finish()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void mbedtls_sha1_finish </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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>[20] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 final digest. </p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000043">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="sha1_8h.html#ad5386f33f3a04ca416fe89e0e8d5039d" title="This function finishes the SHA-1 operation, and writes the result to the output buffer. ">mbedtls_sha1_finish_ret()</a> in 2.7.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context. </td></tr> <tr><td class="paramname">output</td><td>The SHA-1 checksum result.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00234">234</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> <p class="reference">References <a class="el" href="sha1_8h.html#ad5386f33f3a04ca416fe89e0e8d5039d">mbedtls_sha1_finish_ret()</a>.</p> </div> </div> <a id="ad5386f33f3a04ca416fe89e0e8d5039d"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad5386f33f3a04ca416fe89e0e8d5039d">◆ </a></span>mbedtls_sha1_finish_ret()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_sha1_finish_ret </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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>[20] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function finishes the SHA-1 operation, and writes the result to the output buffer. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context. </td></tr> <tr><td class="paramname">output</td><td>The SHA-1 checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> if successful</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00234">mbedtls_sha1_finish()</a>.</p> </div> </div> <a id="a126091a4e884966454dca38c97770a24"></a> <h2 class="memtitle"><span class="permalink"><a href="#a126091a4e884966454dca38c97770a24">◆ </a></span>mbedtls_sha1_free()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mbedtls_sha1_free </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function clears a SHA-1 context. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context to clear.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> </div> </div> <a id="af0cc8deb8dd30a095c6023c498418d24"></a> <h2 class="memtitle"><span class="permalink"><a href="#af0cc8deb8dd30a095c6023c498418d24">◆ </a></span>mbedtls_sha1_init()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void mbedtls_sha1_init </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function initializes a SHA-1 context. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context to initialize.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> </div> </div> <a id="a31026409c719bcfadc553a5e4ec6e76a"></a> <h2 class="memtitle"><span class="permalink"><a href="#a31026409c719bcfadc553a5e4ec6e76a">◆ </a></span>mbedtls_sha1_process()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void mbedtls_sha1_process </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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>[64] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 process data block (internal use only) </p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000044">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="sha1_8h.html#a691c38288ec5d507269f95f7eed2c1e0" title="SHA-1 process data block (internal use only) ">mbedtls_internal_sha1_process()</a> in 2.7.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context. </td></tr> <tr><td class="paramname">data</td><td>The data block being processed.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00254">254</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> <p class="reference">References <a class="el" href="sha1_8h.html#a691c38288ec5d507269f95f7eed2c1e0">mbedtls_internal_sha1_process()</a>, and <a class="el" href="sha1_8h.html#a332d382923412f8960b8558118fdfa90">mbedtls_sha1_ret()</a>.</p> </div> </div> <a id="a332d382923412f8960b8558118fdfa90"></a> <h2 class="memtitle"><span class="permalink"><a href="#a332d382923412f8960b8558118fdfa90">◆ </a></span>mbedtls_sha1_ret()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_sha1_ret </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>[20] </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>This function calculates the SHA-1 checksum of a buffer. </p> <p>The function allocates the context, performs the calculation, and frees the context.</p> <p>The SHA-1 result is calculated as output = SHA-1(input buffer).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <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 SHA-1 checksum result.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> if successful</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00320">mbedtls_sha1()</a>, and <a class="el" href="sha1_8h_source.html#l00254">mbedtls_sha1_process()</a>.</p> </div> </div> <a id="a3666efb450a6bbe9588d6b835dc566cf"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3666efb450a6bbe9588d6b835dc566cf">◆ </a></span>mbedtls_sha1_self_test()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_sha1_self_test </td> <td>(</td> <td class="paramtype">int </td> <td class="paramname"><em>verbose</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>The SHA-1 checkup routine. </p> <dl class="section return"><dt>Returns</dt><dd><code>0</code> on success, or <code>1</code> on failure.</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00320">mbedtls_sha1()</a>.</p> </div> </div> <a id="aa3c6499a23520e06ffc3ea969d1569cf"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa3c6499a23520e06ffc3ea969d1569cf">◆ </a></span>mbedtls_sha1_starts()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void mbedtls_sha1_starts </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 context setup. </p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000041">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="sha1_8h.html#a75b1992ad93e9b796686c442dcd5893e" title="This function starts a SHA-1 checksum calculation. ">mbedtls_sha1_starts_ret()</a> in 2.7.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 context to be initialized.</td></tr> </table> </dd> </dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00193">193</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> <p class="reference">References <a class="el" href="sha1_8h.html#a75b1992ad93e9b796686c442dcd5893e">mbedtls_sha1_starts_ret()</a>.</p> </div> </div> <a id="a75b1992ad93e9b796686c442dcd5893e"></a> <h2 class="memtitle"><span class="permalink"><a href="#a75b1992ad93e9b796686c442dcd5893e">◆ </a></span>mbedtls_sha1_starts_ret()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_sha1_starts_ret </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</a> * </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>This function starts a SHA-1 checksum calculation. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The context to initialize.</td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd><code>0</code> if successful</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00193">mbedtls_sha1_starts()</a>.</p> </div> </div> <a id="a968a7b85cef241a754d9ff7d0aab20b6"></a> <h2 class="memtitle"><span class="permalink"><a href="#a968a7b85cef241a754d9ff7d0aab20b6">◆ </a></span>mbedtls_sha1_update()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">static <a class="el" href="ssl_8h.html#aa9f53b232ef244efb301233d111930dc">MBEDTLS_DEPRECATED</a> void mbedtls_sha1_update </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>SHA-1 process buffer. </p> <dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000042">Deprecated:</a></b></dt><dd>Superseded by <a class="el" href="sha1_8h.html#a460e674d51e2cd2d4f7ab520371d8307" title="This function feeds an input buffer into an ongoing SHA-1 checksum calculation. ">mbedtls_sha1_update_ret()</a> in 2.7.0</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 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 warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="definition">Definition at line <a class="el" href="sha1_8h_source.html#l00213">213</a> of file <a class="el" href="sha1_8h_source.html">sha1.h</a>.</p> <p class="reference">References <a class="el" href="sha1_8h.html#a460e674d51e2cd2d4f7ab520371d8307">mbedtls_sha1_update_ret()</a>.</p> </div> </div> <a id="a460e674d51e2cd2d4f7ab520371d8307"></a> <h2 class="memtitle"><span class="permalink"><a href="#a460e674d51e2cd2d4f7ab520371d8307">◆ </a></span>mbedtls_sha1_update_ret()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int mbedtls_sha1_update_ret </td> <td>(</td> <td class="paramtype"><a class="el" href="structmbedtls__sha1__context.html">mbedtls_sha1_context</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 SHA-1 checksum calculation. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">ctx</td><td>The SHA-1 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> if successful</dd></dl> <dl class="section warning"><dt>Warning</dt><dd>SHA-1 is considered a weak message digest and its use constitutes a security risk. We recommend considering stronger message digests instead. </dd></dl> <p class="reference">Referenced by <a class="el" href="sha1_8h_source.html#l00213">mbedtls_sha1_update()</a>.</p> </div> </div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Wed Mar 7 2018 08:44:45 for mbed TLS v2.7.0 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>