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>C Specification</h2> 14 15<dl> 16 <dd> 17<PRE><CODE>#include <revolution/net.h> 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); 21 22</CODE></PRE> 23 </dd> 24</dl><h2>Arguments</h2> 25 26<table border="1" width="100%"> 27 <TR> 28<TD width="176"><em><strong><font face="Courier New">digest</font></strong></em></TD> 29<TD width="670">Pointer to the memory location that holds the calculated keyed-hash value.</TD> 30 </TR> 31 <TR> 32<TD width="176"><em><strong><font face="Courier New">data</font></strong></em></TD> 33<TD width="670">Pointer to the input data.</TD> 34 </TR> 35 <TR> 36<TD width="176"><em><strong><font face="Courier New">dataLength</font></strong></em></TD> 37<TD width="670">Size of the input data.</TD> 38 </TR> 39 <TR> 40<TD width="176"><em><strong><font face="Courier New">key</font></strong></em></TD> 41<TD width="670">Pointer to the key.</TD> 42 </TR> 43 <TR> 44<TD width="176"><em><strong><font face="Courier New">keyLength</font></strong></em></TD> 45<TD width="670">The key size.</TD> 46 </TR> 47 </table> 48<h2>Return Values</h2> 49<p>None.</p> 50<H2>Description</H2> 51<P>This function calculates a hash message authentication code (HMAC) using MD5 or SHA-1. 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> 52<p> 53Any 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. 54</P> 55<h2>See Also</h2> 56<P><a href="hash_overview.html">Hash algorithm</a></P> 57<H2>Revision History</H2> 58<P> 592007/10/31 Changed argument types. 60<br> 2006/09/01 Initial version.<br></P> 61<hr><p>CONFIDENTIAL</p></body> 62</html> 63