aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a04943.html
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
committerneodarz <neodarz@neodarz.net>2018-08-11 20:21:34 +0200
commit0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch)
tree2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a04943.html
downloadnevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz
nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip
Initial commit
Diffstat (limited to '')
-rw-r--r--docs/doxygen/nel/a04943.html946
1 files changed, 946 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a04943.html b/docs/doxygen/nel/a04943.html
new file mode 100644
index 00000000..1f31432c
--- /dev/null
+++ b/docs/doxygen/nel/a04943.html
@@ -0,0 +1,946 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+<title>NeL: sha1.cpp File Reference</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.3.6 -->
+<div class="qindex"> <form class="search" action="search.php" method="get">
+<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
+<h1>sha1.cpp File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
+This file implements the Secure Hashing Algorithm 1 as defined in FIPS PUB 180-1 published April 17, 1995.<p>
+The SHA-1, produces a 160-bit message digest for a given data stream. It should take about 2**n steps to find a message with the same digest as a given message and 2**(n/2) to find any two messages with the same digest, when n is the digest size in bits. Therefore, this algorithm can serve as a means of providing a "fingerprint" for a message.<p>
+Portability Issues: SHA-1 is defined in terms of 32-bit "words". This code uses &lt;stdint.h&gt; (included via "sha1.h" to define 32 and 8 bit unsigned integer types. If your C compiler does not support 32 bit unsigned integers, this code is not appropriate.<p>
+Caveats: SHA-1 is designed to work with messages less than 2^64 bits long. Although SHA-1 allows a message digest to be generated for messages of any number of bits less than 2^64, this implementation only works with messages with a length that is a multiple of the size of an 8-bit character.<p>
+<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a04943.html">sha1.cpp</a>,v 1.4 2003/10/20 16:10:17 lecroart Exp </dd></dl>
+
+<p>
+Definition in file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+<code>#include "<a class="el" href="a06444.html">stdmisc.h</a>"</code><br>
+<code>#include &lt;stdio.h&gt;</code><br>
+<code>#include &lt;string.h&gt;</code><br>
+<code>#include &lt;string&gt;</code><br>
+<code>#include &lt;map&gt;</code><br>
+<code>#include &lt;vector&gt;</code><br>
+<code>#include "<a class="el" href="a06367.html">nel/misc/sha1.h</a>"</code><br>
+<code>#include "<a class="el" href="a05709.html">nel/misc/file.h</a>"</code><br>
+<code>#include "<a class="el" href="a06168.html">nel/misc/path.h</a>"</code><br>
+
+<p>
+<a href="a06366.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
+<tr><td></td></tr>
+<tr><td colspan=2><br><h2>Data Structures</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>struct &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03895.html">SHA1Context</a></td></tr>
+
+<tr><td colspan=2><br><h2>Defines</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a1">SHA1CircularShift</a>(bits, word)&nbsp;&nbsp;&nbsp;(((word) &lt;&lt; (bits)) | ((word) &gt;&gt; (32-(bits))))</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>#define&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a0">SHA1HashSize</a>&nbsp;&nbsp;&nbsp;20</td></tr>
+
+<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>typedef short&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a4">int_least16_t</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>typedef <a class="el" href="a03895.html">SHA1Context</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a7">SHA1Context</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a2">uint32_t</a></td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>typedef unsigned char&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a3">uint8_t</a></td></tr>
+
+<tr><td colspan=2><br><h2>Enumerations</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom>{ <a class="el" href="a04943.html#a19a8">shaSuccess</a> = 0,
+<a class="el" href="a04943.html#a19a9">shaNull</a>,
+<a class="el" href="a04943.html#a19a10">shaInputTooLong</a>,
+<a class="el" href="a04943.html#a19a11">shaStateError</a>
+ }</td></tr>
+
+<tr><td colspan=2><br><h2>Functions</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02607.html">CHashKey</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a16">getSHA1</a> (const string &amp;<a class="el" href="a04560.html#a1">filename</a>)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02607.html">CHashKey</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a15">getSHA1</a> (const <a class="el" href="a04558.html#a7">uint8</a> *<a class="el" href="a04223.html#a589">buffer</a>, <a class="el" href="a04558.html#a11">uint32</a> <a class="el" href="a04223.html#a587">size</a>)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a13">SHA1Input</a> (<a class="el" href="a03895.html">SHA1Context</a> *, const <a class="el" href="a04943.html#a3">uint8_t</a> *, unsigned int)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a17">SHA1PadMessage</a> (<a class="el" href="a03895.html">SHA1Context</a> *)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a18">SHA1ProcessMessageBlock</a> (<a class="el" href="a03895.html">SHA1Context</a> *)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a12">SHA1Reset</a> (<a class="el" href="a03895.html">SHA1Context</a> *)</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a14">SHA1Result</a> (<a class="el" href="a03895.html">SHA1Context</a> *, <a class="el" href="a04943.html#a3">uint8_t</a> Message_Digest[20])</td></tr>
+
+<tr><td colspan=2><br><h2>Variables</h2></td></tr>
+<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04943.html#a3">uint8_t</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a6">buffer</a> [<a class="el" href="a04943.html#a5">bufferSize</a>]</td></tr>
+
+<tr><td class="memItemLeft" nowrap align=right valign=top>const int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04943.html#a5">bufferSize</a> = 100000</td></tr>
+
+</table>
+<hr><h2>Define Documentation</h2>
+<a class="anchor" name="a1" doxytag="sha1.cpp::SHA1CircularShift" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define SHA1CircularShift</td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">bits, <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>word&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap>&nbsp;&nbsp;&nbsp;(((word) &lt;&lt; (bits)) | ((word) &gt;&gt; (32-(bits))))
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00235">235</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00430">SHA1ProcessMessageBlock()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="a0" doxytag="sha1.cpp::SHA1HashSize" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> #define SHA1HashSize&nbsp;&nbsp;&nbsp;20
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00106">106</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00299">SHA1Result()</a>. </td>
+ </tr>
+</table>
+<hr><h2>Typedef Documentation</h2>
+<a class="anchor" name="a4" doxytag="sha1.cpp::int_least16_t" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> typedef short <a class="el" href="a04943.html#a4">int_least16_t</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00089">89</a> of file <a class="el" href="a06366.html">sha1.cpp</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="a7" doxytag="sha1.cpp::SHA1Context" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> typedef struct <a class="el" href="a03895.html">SHA1Context</a> <a class="el" href="a03895.html">SHA1Context</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+ </td>
+ </tr>
+</table>
+<a class="anchor" name="a2" doxytag="sha1.cpp::uint32_t" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> typedef unsigned int <a class="el" href="a04943.html#a2">uint32_t</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00087">87</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00430">SHA1ProcessMessageBlock()</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="a3" doxytag="sha1.cpp::uint8_t" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> typedef unsigned char <a class="el" href="a04943.html#a3">uint8_t</a>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00088">88</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00139">getSHA1()</a>. </td>
+ </tr>
+</table>
+<hr><h2>Enumeration Type Documentation</h2>
+<a class="anchor" name="a19" doxytag="sha1.cpp::@1" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> anonymous enum
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+<dl compact><dt><b>Enumeration values: </b></dt><dd>
+<table border=0 cellspacing=2 cellpadding=0>
+<tr><td valign=top><em><a class="anchor" name="a19a8" doxytag="shaSuccess" ></a>shaSuccess</em>&nbsp;</td><td>
+</td></tr>
+<tr><td valign=top><em><a class="anchor" name="a19a9" doxytag="shaNull" ></a>shaNull</em>&nbsp;</td><td>
+</td></tr>
+<tr><td valign=top><em><a class="anchor" name="a19a10" doxytag="shaInputTooLong" ></a>shaInputTooLong</em>&nbsp;</td><td>
+</td></tr>
+<tr><td valign=top><em><a class="anchor" name="a19a11" doxytag="shaStateError" ></a>shaStateError</em>&nbsp;</td><td>
+</td></tr>
+</table>
+</dl>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00098">98</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+<div class="fragment"><pre>00099 {
+00100 <a class="code" href="a04943.html#a19a8">shaSuccess</a> = 0,
+00101 <a class="code" href="a04943.html#a19a9">shaNull</a>, <span class="comment">/* Null pointer parameter */</span>
+00102 <a class="code" href="a04943.html#a19a10">shaInputTooLong</a>, <span class="comment">/* input data too long */</span>
+00103 <a class="code" href="a04943.html#a19a11">shaStateError</a> <span class="comment">/* called Input after Result */</span>
+00104 };
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Function Documentation</h2>
+<a class="anchor" name="a16" doxytag="sha1.cpp::getSHA1" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a02607.html">CHashKey</a> getSHA1 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const string &amp;&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> <em>filename</em> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00170">170</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a06366.html#l00095">bufferSize</a>, <a class="el" href="a05708.html#l00255">NLMISC::CIFile::close()</a>, <a class="el" href="a05708.html#l00349">NLMISC::CIFile::eof()</a>, <a class="el" href="a05709.html#l00119">NLMISC::CIFile::getFileSize()</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05708.html#l00135">NLMISC::CIFile::open()</a>, <a class="el" href="a05708.html#l00355">NLMISC::CIFile::serialBuffer()</a>, <a class="el" href="a05708.html#l00242">NLMISC::CIFile::setCacheFileOnOpen()</a>, <a class="el" href="a06366.html#l00357">SHA1Input()</a>, <a class="el" href="a06366.html#l00257">SHA1Reset()</a>, <a class="el" href="a06366.html#l00299">SHA1Result()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, and <a class="el" href="a06366.html#l00088">uint8_t</a>.
+<p>
+<div class="fragment"><pre>00171 {
+00172 <a class="code" href="a03895.html">SHA1Context</a> sha;
+00173 <span class="keywordtype">int</span> err;
+00174 <a class="code" href="a04943.html#a3">uint8_t</a> Message_Digest[20];
+00175
+00176 <span class="comment">//printf("reading '%s'\n", findData.cFileName);</span>
+00177 <a class="code" href="a02653.html">CIFile</a> ifile;
+00178 ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea20">setCacheFileOnOpen</a>(<span class="keyword">true</span>);
+00179 <span class="keywordflow">if</span> (!ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea12">open</a>(CPath::lookup(filename)))
+00180 {
+00181 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"SHA: Can't open the file '%s'"</span>, <a class="code" href="a05377.html#a2">filename</a>.c_str());
+00182 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00183 }
+00184
+00185 <span class="comment">//FILE *fp = fopen (filename.c_str(), "rb");</span>
+00186 <span class="comment">//if (fp == NULL) return CHashKey();</span>
+00187
+00188 err = <a class="code" href="a04943.html#a12">SHA1Reset</a>(&amp;sha);
+00189 <span class="keywordflow">if</span> (err)
+00190 {
+00191 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"SHA: SHA1Reset Error %d.\n"</span>, err );
+00192 ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea3">close</a> ();
+00193 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00194 }
+00195
+00196 <a class="code" href="a04558.html#a14">sint</a> fs = ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea6">getFileSize</a>();
+00197 <a class="code" href="a04558.html#a14">sint</a> n, read = 0;
+00198 <span class="keywordflow">do</span>
+00199 {
+00200 <span class="comment">//bs = (int)fread (buffer, 1, bufferSize, fp);</span>
+00201 n = <a class="code" href="a04061.html#a0">std::min</a> (bufferSize, fs-read);
+00202 <span class="comment">//nlinfo ("read %d bytes", n);</span>
+00203 ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea15">serialBuffer</a>((<a class="code" href="a04558.html#a7">uint8</a> *)<a class="code" href="a04223.html#a589">buffer</a>, n);
+00204
+00205 err = <a class="code" href="a04943.html#a13">SHA1Input</a>(&amp;sha, <a class="code" href="a04223.html#a589">buffer</a>, n);
+00206 <span class="keywordflow">if</span> (err)
+00207 {
+00208 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"SHA: SHA1Input Error %d.\n"</span>, err);
+00209 ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea3">close</a>();
+00210 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00211 }
+00212 read += n;
+00213 }
+00214 <span class="keywordflow">while</span> (!ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea4">eof</a>());
+00215
+00216 ifile.<a class="code" href="a02653.html#NLMISC_1_1CIFilea3">close</a> ();
+00217
+00218 err = <a class="code" href="a04943.html#a14">SHA1Result</a>(&amp;sha, Message_Digest);
+00219 <span class="keywordflow">if</span> (err)
+00220 {
+00221 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"SHA: SHA1Result Error %d, could not compute message digest.\n"</span>, err );
+00222 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00223 }
+00224
+00225 <a class="code" href="a02607.html">CHashKey</a> hk (Message_Digest);
+00226 <span class="keywordflow">return</span> hk;
+00227 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a15" doxytag="sha1.cpp::getSHA1" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a02607.html">CHashKey</a> getSHA1 </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top">const <a class="el" href="a04558.html#a7">uint8</a> *&nbsp;</td>
+ <td class="mdname" nowrap> <em>buffer</em>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>size</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00139">139</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+<div class="fragment"><pre>00140 {
+00141 <a class="code" href="a03895.html">SHA1Context</a> sha;
+00142 <span class="keywordtype">int</span> err;
+00143 <a class="code" href="a04943.html#a3">uint8_t</a> Message_Digest[20];
+00144
+00145 err = <a class="code" href="a04943.html#a12">SHA1Reset</a>(&amp;sha);
+00146 <span class="keywordflow">if</span> (err)
+00147 {
+00148 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"SHA: SHA1Reset Error %d.\n"</span>, err );
+00149 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00150 }
+00151
+00152 err = <a class="code" href="a04943.html#a13">SHA1Input</a>(&amp;sha, (<span class="keyword">const</span> <a class="code" href="a04943.html#a3">uint8_t</a>*)buffer, size);
+00153 <span class="keywordflow">if</span> (err)
+00154 {
+00155 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"SHA: SHA1Input Error %d.\n"</span>, err);
+00156 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00157 }
+00158
+00159 err = <a class="code" href="a04943.html#a14">SHA1Result</a>(&amp;sha, Message_Digest);
+00160 <span class="keywordflow">if</span> (err)
+00161 {
+00162 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"SHA: SHA1Result Error %d, could not compute message digest.\n"</span>, err );
+00163 <span class="keywordflow">return</span> <a class="code" href="a02607.html">CHashKey</a>();
+00164 }
+00165
+00166 <a class="code" href="a02607.html">CHashKey</a> hk (Message_Digest);
+00167 <span class="keywordflow">return</span> hk;
+00168 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a13" doxytag="sha1.cpp::SHA1Input" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int SHA1Input </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03895.html">SHA1Context</a> *&nbsp;</td>
+ <td class="mdname" nowrap>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>const <a class="el" href="a04943.html#a3">uint8_t</a> *&nbsp;</td>
+ <td class="mdname" nowrap>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap>unsigned&nbsp;</td>
+ <td class="mdname" nowrap> <em>int</em></td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00357">357</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a06366.html#l00123">SHA1Context::Computed</a>, <a class="el" href="a06366.html#l00124">SHA1Context::Corrupted</a>, <a class="el" href="a06366.html#l00117">SHA1Context::Length_High</a>, <a class="el" href="a06366.html#l00116">SHA1Context::Length_Low</a>, <a class="el" href="a06366.html#l00121">SHA1Context::Message_Block</a>, <a class="el" href="a06366.html#l00120">SHA1Context::Message_Block_Index</a>, <a class="el" href="a06366.html#l00430">SHA1ProcessMessageBlock()</a>, <a class="el" href="a04943.html#a19a9">shaNull</a>, <a class="el" href="a04943.html#a19a11">shaStateError</a>, and <a class="el" href="a04943.html#a19a8">shaSuccess</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00139">getSHA1()</a>.
+<p>
+<div class="fragment"><pre>00360 {
+00361 <span class="keywordflow">if</span> (!length)
+00362 {
+00363 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a8">shaSuccess</a>;
+00364 }
+00365
+00366 <span class="keywordflow">if</span> (!context || !message_array)
+00367 {
+00368 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a9">shaNull</a>;
+00369 }
+00370
+00371 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto0">Computed</a>)
+00372 {
+00373 context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a> = <a class="code" href="a04943.html#a19a11">shaStateError</a>;
+00374
+00375 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a11">shaStateError</a>;
+00376 }
+00377
+00378 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a>)
+00379 {
+00380 <span class="keywordflow">return</span> context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a>;
+00381 }
+00382 <span class="keywordflow">while</span>(length-- &amp;&amp; !context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a>)
+00383 {
+00384 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] =
+00385 (*message_array &amp; 0xFF);
+00386
+00387 context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> += 8;
+00388 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> == 0)
+00389 {
+00390 context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a>++;
+00391 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> == 0)
+00392 {
+00393 <span class="comment">/* Message is too long */</span>
+00394 context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a> = 1;
+00395 }
+00396 }
+00397
+00398 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> == 64)
+00399 {
+00400 <a class="code" href="a04943.html#a18">SHA1ProcessMessageBlock</a>(context);
+00401 }
+00402
+00403 message_array++;
+00404 }
+00405
+00406 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a8">shaSuccess</a>;
+00407 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a17" doxytag="sha1.cpp::SHA1PadMessage" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void SHA1PadMessage </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03895.html">SHA1Context</a> *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00541">541</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a06366.html#l00117">SHA1Context::Length_High</a>, <a class="el" href="a06366.html#l00116">SHA1Context::Length_Low</a>, <a class="el" href="a06366.html#l00121">SHA1Context::Message_Block</a>, <a class="el" href="a06366.html#l00120">SHA1Context::Message_Block_Index</a>, and <a class="el" href="a06366.html#l00430">SHA1ProcessMessageBlock()</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00299">SHA1Result()</a>.
+<p>
+<div class="fragment"><pre>00542 {
+00543 <span class="comment">/*</span>
+00544 <span class="comment"> * Check to see if the current message block is too small to hold</span>
+00545 <span class="comment"> * the initial padding bits and length. If so, we will pad the</span>
+00546 <span class="comment"> * block, process it, and then continue padding into a second</span>
+00547 <span class="comment"> * block.</span>
+00548 <span class="comment"> */</span>
+00549 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> &gt; 55)
+00550 {
+00551 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] = 0x80;
+00552 <span class="keywordflow">while</span>(context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> &lt; 64)
+00553 {
+00554 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] = 0;
+00555 }
+00556
+00557 <a class="code" href="a04943.html#a18">SHA1ProcessMessageBlock</a>(context);
+00558
+00559 <span class="keywordflow">while</span>(context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> &lt; 56)
+00560 {
+00561 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] = 0;
+00562 }
+00563 }
+00564 <span class="keywordflow">else</span>
+00565 {
+00566 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] = 0x80;
+00567 <span class="keywordflow">while</span>(context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> &lt; 56)
+00568 {
+00569
+00570 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a>++] = 0;
+00571 }
+00572 }
+00573
+00574 <span class="comment">/*</span>
+00575 <span class="comment"> * Store the message length as the last 8 octets</span>
+00576 <span class="comment"> */</span>
+00577 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[56] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> &gt;&gt; 24;
+00578 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[57] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> &gt;&gt; 16;
+00579 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[58] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> &gt;&gt; 8;
+00580 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[59] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a>;
+00581 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[60] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> &gt;&gt; 24;
+00582 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[61] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> &gt;&gt; 16;
+00583 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[62] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> &gt;&gt; 8;
+00584 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[63] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a>;
+00585
+00586 <a class="code" href="a04943.html#a18">SHA1ProcessMessageBlock</a>(context);
+00587 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a18" doxytag="sha1.cpp::SHA1ProcessMessageBlock" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> void SHA1ProcessMessageBlock </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03895.html">SHA1Context</a> *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00430">430</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a06366.html#l00114">SHA1Context::Intermediate_Hash</a>, <a class="el" href="a06366.html#l00121">SHA1Context::Message_Block</a>, <a class="el" href="a06366.html#l00120">SHA1Context::Message_Block_Index</a>, <a class="el" href="a06366.html#l00235">SHA1CircularShift</a>, <a class="el" href="a05646.html#l00985">t</a>, and <a class="el" href="a06366.html#l00087">uint32_t</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00357">SHA1Input()</a>, and <a class="el" href="a06366.html#l00541">SHA1PadMessage()</a>.
+<p>
+<div class="fragment"><pre>00431 {
+00432 <span class="keyword">const</span> <a class="code" href="a04943.html#a2">uint32_t</a> K[] = { <span class="comment">/* Constants defined in SHA-1 */</span>
+00433 0x5A827999,
+00434 0x6ED9EBA1,
+00435 0x8F1BBCDC,
+00436 0xCA62C1D6
+00437 };
+00438 <span class="keywordtype">int</span> <a class="code" href="a04223.html#a627">t</a>; <span class="comment">/* Loop counter */</span>
+00439 <a class="code" href="a04943.html#a2">uint32_t</a> temp; <span class="comment">/* Temporary word value */</span>
+00440 <a class="code" href="a04943.html#a2">uint32_t</a> W[80]; <span class="comment">/* Word sequence */</span>
+00441 <a class="code" href="a04943.html#a2">uint32_t</a> A, B, C, D, E; <span class="comment">/* Word buffers */</span>
+00442
+00443 <span class="comment">/*</span>
+00444 <span class="comment"> * Initialize the first 16 words in the array W</span>
+00445 <span class="comment"> */</span>
+00446 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 0; <a class="code" href="a04223.html#a627">t</a> &lt; 16; <a class="code" href="a04223.html#a627">t</a>++)
+00447 {
+00448 W[<a class="code" href="a04223.html#a627">t</a>] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[<a class="code" href="a04223.html#a627">t</a> * 4] &lt;&lt; 24;
+00449 W[<a class="code" href="a04223.html#a627">t</a>] |= context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[<a class="code" href="a04223.html#a627">t</a> * 4 + 1] &lt;&lt; 16;
+00450 W[<a class="code" href="a04223.html#a627">t</a>] |= context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[<a class="code" href="a04223.html#a627">t</a> * 4 + 2] &lt;&lt; 8;
+00451 W[<a class="code" href="a04223.html#a627">t</a>] |= context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[<a class="code" href="a04223.html#a627">t</a> * 4 + 3];
+00452 }
+00453
+00454 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 16; <a class="code" href="a04223.html#a627">t</a> &lt; 80; <a class="code" href="a04223.html#a627">t</a>++)
+00455 {
+00456 W[<a class="code" href="a04223.html#a627">t</a>] = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(1,W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+00457 }
+00458
+00459 A = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[0];
+00460 B = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[1];
+00461 C = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[2];
+00462 D = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[3];
+00463 E = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[4];
+00464
+00465 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 0; <a class="code" href="a04223.html#a627">t</a> &lt; 20; <a class="code" href="a04223.html#a627">t</a>++)
+00466 {
+00467 temp = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(5,A) +
+00468 ((B &amp; C) | ((~B) &amp; D)) + E + W[<a class="code" href="a04223.html#a627">t</a>] + K[0];
+00469 E = D;
+00470 D = C;
+00471 C = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(30,B);
+00472
+00473 B = A;
+00474 A = temp;
+00475 }
+00476
+00477 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 20; <a class="code" href="a04223.html#a627">t</a> &lt; 40; <a class="code" href="a04223.html#a627">t</a>++)
+00478 {
+00479 temp = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(5,A) + (B ^ C ^ D) + E + W[<a class="code" href="a04223.html#a627">t</a>] + K[1];
+00480 E = D;
+00481 D = C;
+00482 C = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(30,B);
+00483 B = A;
+00484 A = temp;
+00485 }
+00486
+00487 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 40; <a class="code" href="a04223.html#a627">t</a> &lt; 60; <a class="code" href="a04223.html#a627">t</a>++)
+00488 {
+00489 temp = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(5,A) +
+00490 ((B &amp; C) | (B &amp; D) | (C &amp; D)) + E + W[<a class="code" href="a04223.html#a627">t</a>] + K[2];
+00491 E = D;
+00492 D = C;
+00493 C = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(30,B);
+00494 B = A;
+00495 A = temp;
+00496 }
+00497
+00498 <span class="keywordflow">for</span>(<a class="code" href="a04223.html#a627">t</a> = 60; <a class="code" href="a04223.html#a627">t</a> &lt; 80; <a class="code" href="a04223.html#a627">t</a>++)
+00499 {
+00500 temp = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(5,A) + (B ^ C ^ D) + E + W[<a class="code" href="a04223.html#a627">t</a>] + K[3];
+00501 E = D;
+00502 D = C;
+00503 C = <a class="code" href="a04943.html#a1">SHA1CircularShift</a>(30,B);
+00504 B = A;
+00505 A = temp;
+00506 }
+00507
+00508 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[0] += A;
+00509 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[1] += B;
+00510 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[2] += C;
+00511 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[3] += D;
+00512 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[4] += E;
+00513
+00514 context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> = 0;
+00515 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a12" doxytag="sha1.cpp::SHA1Reset" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int SHA1Reset </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03895.html">SHA1Context</a> *&nbsp;</td>
+ <td class="mdname1" valign="top" nowrap> </td>
+ <td class="md" valign="top">&nbsp;)&nbsp;</td>
+ <td class="md" nowrap></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00257">257</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a06366.html#l00123">SHA1Context::Computed</a>, <a class="el" href="a06366.html#l00124">SHA1Context::Corrupted</a>, <a class="el" href="a06366.html#l00114">SHA1Context::Intermediate_Hash</a>, <a class="el" href="a06366.html#l00117">SHA1Context::Length_High</a>, <a class="el" href="a06366.html#l00116">SHA1Context::Length_Low</a>, <a class="el" href="a06366.html#l00120">SHA1Context::Message_Block_Index</a>, <a class="el" href="a04943.html#a19a9">shaNull</a>, and <a class="el" href="a04943.html#a19a8">shaSuccess</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00139">getSHA1()</a>.
+<p>
+<div class="fragment"><pre>00258 {
+00259 <span class="keywordflow">if</span> (!context)
+00260 {
+00261 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a9">shaNull</a>;
+00262 }
+00263
+00264 context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> = 0;
+00265 context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> = 0;
+00266 context-&gt;<a class="code" href="a03895.html#SHA1Contexto6">Message_Block_Index</a> = 0;
+00267
+00268 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[0] = 0x67452301;
+00269 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[1] = 0xEFCDAB89;
+00270 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[2] = 0x98BADCFE;
+00271 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[3] = 0x10325476;
+00272 context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[4] = 0xC3D2E1F0;
+00273
+00274 context-&gt;<a class="code" href="a03895.html#SHA1Contexto0">Computed</a> = 0;
+00275 context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a> = 0;
+00276
+00277 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a8">shaSuccess</a>;
+00278 }
+</pre></div> </td>
+ </tr>
+</table>
+<a class="anchor" name="a14" doxytag="sha1.cpp::SHA1Result" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> int SHA1Result </td>
+ <td class="md" valign="top">(&nbsp;</td>
+ <td class="md" nowrap valign="top"><a class="el" href="a03895.html">SHA1Context</a> *&nbsp;</td>
+ <td class="mdname" nowrap>, </td>
+ </tr>
+ <tr>
+ <td class="md" nowrap align="right"></td>
+ <td></td>
+ <td class="md" nowrap><a class="el" href="a04943.html#a3">uint8_t</a>&nbsp;</td>
+ <td class="mdname" nowrap> <em>Message_Digest</em>[20]</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td class="md">)&nbsp;</td>
+ <td class="md" colspan="2"></td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00299">299</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+References <a class="el" href="a06366.html#l00123">SHA1Context::Computed</a>, <a class="el" href="a06366.html#l00124">SHA1Context::Corrupted</a>, <a class="el" href="a06366.html#l00114">SHA1Context::Intermediate_Hash</a>, <a class="el" href="a06366.html#l00117">SHA1Context::Length_High</a>, <a class="el" href="a06366.html#l00116">SHA1Context::Length_Low</a>, <a class="el" href="a06366.html#l00121">SHA1Context::Message_Block</a>, <a class="el" href="a06366.html#l00106">SHA1HashSize</a>, <a class="el" href="a06366.html#l00541">SHA1PadMessage()</a>, <a class="el" href="a04943.html#a19a9">shaNull</a>, and <a class="el" href="a04943.html#a19a8">shaSuccess</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00139">getSHA1()</a>.
+<p>
+<div class="fragment"><pre>00301 {
+00302 <span class="keywordtype">int</span> i;
+00303
+00304 <span class="keywordflow">if</span> (!context || !Message_Digest)
+00305 {
+00306 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a9">shaNull</a>;
+00307 }
+00308
+00309 <span class="keywordflow">if</span> (context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a>)
+00310 {
+00311 <span class="keywordflow">return</span> context-&gt;<a class="code" href="a03895.html#SHA1Contexto1">Corrupted</a>;
+00312 }
+00313
+00314 <span class="keywordflow">if</span> (!context-&gt;<a class="code" href="a03895.html#SHA1Contexto0">Computed</a>)
+00315 {
+00316 <a class="code" href="a04943.html#a17">SHA1PadMessage</a>(context);
+00317 <span class="keywordflow">for</span>(i=0; i&lt;64; ++i)
+00318 {
+00319 <span class="comment">/* message may be sensitive, clear it out */</span>
+00320 context-&gt;<a class="code" href="a03895.html#SHA1Contexto5">Message_Block</a>[i] = 0;
+00321 }
+00322 context-&gt;<a class="code" href="a03895.html#SHA1Contexto4">Length_Low</a> = 0; <span class="comment">/* and clear length */</span>
+00323 context-&gt;<a class="code" href="a03895.html#SHA1Contexto3">Length_High</a> = 0;
+00324 context-&gt;<a class="code" href="a03895.html#SHA1Contexto0">Computed</a> = 1;
+00325
+00326 }
+00327
+00328 <span class="keywordflow">for</span>(i = 0; i &lt; <a class="code" href="a04943.html#a0">SHA1HashSize</a>; ++i)
+00329 {
+00330 Message_Digest[i] = context-&gt;<a class="code" href="a03895.html#SHA1Contexto2">Intermediate_Hash</a>[i&gt;&gt;2]
+00331 &gt;&gt; 8 * ( 3 - ( i &amp; 0x03 ) );
+00332 }
+00333
+00334 <span class="keywordflow">return</span> <a class="code" href="a04943.html#a19a8">shaSuccess</a>;
+00335 }
+</pre></div> </td>
+ </tr>
+</table>
+<hr><h2>Variable Documentation</h2>
+<a class="anchor" name="a6" doxytag="sha1.cpp::buffer" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> <a class="el" href="a04943.html#a3">uint8_t</a> <a class="el" href="a04223.html#a589">buffer</a>[<a class="el" href="a04943.html#a5">bufferSize</a>]<code> [static]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00096">96</a> of file <a class="el" href="a06366.html">sha1.cpp</a>. </td>
+ </tr>
+</table>
+<a class="anchor" name="a5" doxytag="sha1.cpp::bufferSize" ></a><p>
+<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
+ <tr>
+ <td class="mdRow">
+ <table cellpadding="0" cellspacing="0" border="0">
+ <tr>
+ <td class="md" nowrap valign="top"> const int <a class="el" href="a04943.html#a5">bufferSize</a> = 100000<code> [static]</code>
+ </table>
+ </td>
+ </tr>
+</table>
+<table cellspacing=5 cellpadding=0 border=0>
+ <tr>
+ <td>
+ &nbsp;
+ </td>
+ <td>
+
+<p>
+
+<p>
+Definition at line <a class="el" href="a06366.html#l00095">95</a> of file <a class="el" href="a06366.html">sha1.cpp</a>.
+<p>
+Referenced by <a class="el" href="a06366.html#l00170">getSHA1()</a>. </td>
+ </tr>
+</table>
+<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:43:17 2004 for NeL by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
+</a>1.3.6 </small></address>
+</body>
+</html>