1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<title>NETCalcHMAC*</title>
7<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
8</head>
9
10<body>
11
12<h1 align="left">NETCalcHMAC*</h1>
13<h2>Syntax</h2>
14
15<dl>
16  <dd>
17  <PRE><CODE>#include &lt;revolution/net.h&gt;
18
19void NETCalcHMACMD5(void *digest, const void *data, u32 dataLength, const void *key, u32 keyLength);
20void NETCalcHMACSHA1(void *digest, const void *data, u32 dataLength, const void *key, u32 keyLength);
21void NETCalcHMACSHA256(void *digest, const void *data, u32 dataLength, const void *key, u32 keyLength);
22
23</CODE></PRE>
24  </dd>
25</dl><h2>Arguments</h2>
26
27<table border="1" width="100%">
28    <TR>
29<TD width="176"><em><strong><font face="Courier New">digest</font></strong></em></TD>
30<TD width="670">Pointer to the memory location that holds the calculated keyed-hash value.</TD>
31    </TR>
32    <TR>
33<TD width="176"><em><strong><font face="Courier New">data</font></strong></em></TD>
34<TD width="670">Pointer to the input data.</TD>
35    </TR>
36    <TR>
37<TD width="176"><em><strong><font face="Courier New">dataLength</font></strong></em></TD>
38<TD width="670">Size of the input data.</TD>
39    </TR>
40    <TR>
41<TD width="176"><em><strong><font face="Courier New">key</font></strong></em></TD>
42<TD width="670">Pointer to the key.</TD>
43    </TR>
44    <TR>
45<TD width="176"><em><strong><font face="Courier New">keyLength</font></strong></em></TD>
46<TD width="670">The key size.</TD>
47    </TR>
48  </table>
49<h2>Return Values</h2>
50<p>None.</p>
51<H2>Description</H2>
52<P>These functions calculate a hash message authentication code (HMAC) using MD5, SHA-1, or SHA-256.<BR><BR>The length of the hash with a generated key differs depending on the algorithm selected. Pass a memory region with enough capacity to store the hash value to digest argument.<br>For the hash length associated with each algorithm, see the item <a href="hash_overview.html">hash algorithm</a>.</p>
53<p>
54Any size and alignment position can be used for the input data and key. However, if the key is smaller than the hash length, intensity weakens, but even if it is larger than the hash length, it does not contribute too much to intensity strength.<BR><BR>A stack having a size equivalent to the context structure plus about 100 bytes is used for internal processing. Make sure sufficient stack is available when calling. <BR>HMAC is a keyed-hashing algorithm for message authentication. For details, see RFC 2104.
55</P>
56<h2>See Also</h2>
57<P><a href="hash_overview.html">Hash Algorithm</a></P>
58<H2>Revision History</H2>
59<P>
602008/05/07 Added the SHA-256 algorithm. <br>2007/10/31 Changed argument types. <br>2006/09/01 Initial version.<br>
61</P>
62<hr><p>CONFIDENTIAL</p></body>
63</html>
64