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 name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>SVC_RandomSHA1</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">SVC_RandomSHA1 <IMG src="../image/BPT.gif" align="middle"><IMG src="../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <twl/os/common/systemCall.h></CODE></PRE> 16 <PRE><CODE>int SVC_Random( void* dest_ptr, 17 unsigned int dest_len, 18 const void* src_ptr, 19 unsigned int src_len );</CODE></PRE> 20</DL> 21<H2>Arguments</H2> 22<TABLE border="1"> 23 <TBODY> 24 <TR> 25 <TD><B><I>dest_ptr</I></B></TD> 26 <TD>Pointer to the output data.</TD> 27 </TR> 28 <TR> 29 <TD><B><I>dest_len</I></B></TD> 30 <TD>Length of the output data.</TD> 31 </TR> 32 <TR> 33 <TD><B><I>src_ptr</I></B></TD> 34 <TD>Pointer to the input data.</TD> 35 </TR> 36 <TR> 37 <TD><B><I>src_len</I></B></TD> 38 <TD>Length of the input data.</TD> 39 </TR> 40 </TBODY> 41</TABLE> 42<H2>Return Values</H2> 43<P>Returns TRUE if the operation completed normally, or if <CODE>dest_ptr</CODE> is NULL. Returns FALSE otherwise.</P> 44<H2>Description</H2> 45<P>Gets a random number using SHA-1.</P> 46<P>In practice, the SHA-1 process is used to churn the input data arrays provided in <B><I>src_ptr</I></B> and <B><I>src_len</I></B>, and the result is stored the output data areas <B><I>dest_ptr</I></B> and <B><I>dest_len</I></B>. As a result, the same result can be achieved if the same data is provided as input.</P> 47<P>Because SHA-1 is used, the input has a precision of 64 bytes, and the output has a precision of 20 bytes. The fact that the output has a precision of 20 bytes essentially means that when some data array is output, if the leading 20 bytes of that output is the same as that of the output of a separate operation, the rest of the data will be the same as well.</P> 48<H2>See Also</H2> 49<P><CODE><A href="SVC_CalcSHA1.html">SVC_CalcSHA1</A><BR></CODE></P> 50<H2>Revision History</H2> 51<P>2007/10/19 Initial version.</P> 52<hr><p>CONFIDENTIAL</p></body> 53</HTML>