aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a04944.html
blob: cbc39c84ce3ce412c2f3e75547689fb3dc0f1adf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!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.h 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.h File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
This is the header file for code which implements the Secure Hashing Algorithm 1 as defined in FIPS PUB 180-1 published April 17, 1995.<p>
Many of the variable names in this code, especially the single character names, were used because those were the names used in the publication.<p>
<dl compact><dt><b>Id</b></dt><dd><a class="el" href="a04944.html">sha1.h</a>,v 1.4 2003/10/20 16:10:17 lecroart Exp </dd></dl>

<p>
Definition in file <a class="el" href="a06367.html">sha1.h</a>.
<p>
<code>#include &lt;string&gt;</code><br>
<code>#include "<a class="el" href="a05587.html">nel/misc/common.h</a>"</code><br>
<code>#include "<a class="el" href="a06462.html">nel/misc/stream.h</a>"</code><br>

<p>
<a href="a06367.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="a02607.html">CHashKey</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="a04944.html#a2">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><a class="el" href="a02607.html">CHashKey</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04944.html#a1">getSHA1</a> (const std::string &amp;<a class="el" href="a04560.html#a1">filename</a>)</td></tr>

<tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a04944.html#a0">operator&lt;</a> (const struct <a class="el" href="a02607.html">CHashKey</a> &amp;a, const struct <a class="el" href="a02607.html">CHashKey</a> &amp;b)</td></tr>

</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a2" doxytag="sha1.h::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>
References <a class="el" href="a05646.html#l00649">buffer</a>, <a class="el" href="a05622.html#l00135">nlwarning</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="a05646.html#l00645">size</a>, <a class="el" href="a05981.html#l00100">uint32</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>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="a1" doxytag="sha1.h::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 std::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>
    </td>
  </tr>
</table>
<a class="anchor" name="a0" doxytag="sha1.h::operator<" ></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"> bool operator&lt; </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const struct <a class="el" href="a02607.html">CHashKey</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>a</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const struct <a class="el" href="a02607.html">CHashKey</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>b</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline]</code></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="a06367.html#l00112">112</a> of file <a class="el" href="a06367.html">sha1.h</a>.
<p>
References <a class="el" href="a06367.html#l00109">CHashKey::HashKeyString</a>.
<p>
Referenced by <a class="el" href="a05805.html#l00090">NLAIAGENT::CAgentNumber::operator&lt;()</a>.
<p>
<div class="fragment"><pre>00113 {
00114         <span class="keywordflow">return</span> a.<a class="code" href="a02607.html#CHashKeyo0">HashKeyString</a>&lt;b.<a class="code" href="a02607.html#CHashKeyo0">HashKeyString</a>;
00115 }
</pre></div>    </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>