1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>MATH_CalcSHA1</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">MATH_CalcSHA1<img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></H1> 15<H2>Syntax</H2> 16 17<dl> 18 <dd> 19 <PRE><CODE>#include <nitro/math/dgt.h> 20 21static inline void MATH_CalcSHA1( void* digest, const void* data, u32 dataLength ); 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 SHA-1 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 </table> 40<h2>Return Values</h2> 41<p>None.</p> 42<H2>Description</H2> 43<P>This function calculates SHA-1. The length of the generated SHA-1 value is 160 bits, or <nobr><code>MATH_SHA1_DIGEST_SIZE (= 20)</code></nobr> bytes. Use the "digest" argument to pass an area that can store a value of this size. Any size and alignment position can be used for the input data.<BR> This is a utility function that successively calls the <CODE><A href="MATH_SHA1Init.html">MATH_SHA1Init</A></CODE>, <CODE><A href="MATH_SHA1Update.html">MATH_SHA1Update</A></CODE>, and <CODE><A href="MATH_SHA1GetHash.html">MATH_SHA1GetHash</A></CODE> functions. Internally, the <a href="MATHSHA1Context.html"><code>MATHSHA1Context</code></a> structure is allocated to the stack, so make sure that you have sufficient stack when calling the function. SHA-1 is an algorithm to find the message digest value. For details, see RFC (Request For Comments) 3174, which is published by IETF (The Internet Engineering Task Force). 44</P> 45<h2>See Also</h2> 46<P><CODE></CODE></P> 47<H2>Revision History</H2> 48<P> 492005/04/12 Initial version. 50</P> 51<hr><p>CONFIDENTIAL</p></body> 52</html> 53