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 7.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>CRYPTO_RC4FastEncrypt</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">CRYPTO_RC4FastEncrypt <IMG src="../../image/NTR.gif" width="23" height="12" border="0" align="middle"><IMG src="../../image/TWL.gif" width="23" height="12" border="0" align="middle"></h1>
15<h2>Syntax</h2>
16
17<dl>
18  <dd>
19  <pre><CODE>#include &lt;nitro/crypto.h&gt;
20
21void CRYPTO_RC4FastEncrypt(<a href="CRYPTORC4FastContext.html">CRYPTORC4FastContext</a>* context, const void* in, u32 length, void* out);
22</CODE></pre>
23</dd>
24</dl>
25
26<h2>Arguments</h2>
27<TABLE border="1" width="100%" class="arguments">
28  <TBODY>
29    <TR>
30<TH>context</TH>
31<TD><A href="CRYPTO_RC4FastContext.html"><CODE>CRYPTORC4FastContext</CODE></A> structure, whose key has already been configured by the <A href="CRYPTO_RC4FastInit.html"><CODE>CRYPTO_RC4FastInit</CODE></A> function.</TD>
32    </TR>
33    <TR>
34<TH>in</TH>
35<TD>Pointer to the target data to encrypt or decrypt with the RC4 algorithm.</TD>
36    </TR>
37    <TR>
38<TH>length</TH>
39<TD>Length of the data specified by <SPAN class="argument">in</SPAN>.</TD>
40    </TR>
41    <TR>
42<TH>out</TH>
43<TD>Pointer to where the results of the encryption or decryption are stored.</TD>
44    </TR>
45  </TBODY>
46</TABLE>
47
48<h2>Return Values</h2>
49<p>
50None.
51</p>
52
53<H2>Description</H2>
54<P>
55Performs encryption or decryption using the RC4 shared key encryption algorithm.<BR>The same function is used for both encryption and decryption in the RC4 algorithm.<BR>Data stored in <SPAN class="argument">in</SPAN> is processed, and the converted results are written to <SPAN class="argument">out</SPAN>. You can specify the same pointer for <SPAN class="argument">in</SPAN> and <SPAN class="argument">out</SPAN>, thereby overwriting them.
56</P>
57<P>
58The <CODE>CRYPTO_RC4*</CODE> and <CODE>CRYPTO_RC4Fast*</CODE> functions are the same, except that the <CODE>CRYPTO_RC4Fast*</CODE> functions are faster and require more stack memory. <BR>The size of the <CODE>CRYPTORC4Context</CODE> structure used by the <CODE>CRYPTO_RC4*</CODE> functions is 260 bytes. The size of the <CODE>CRYPTORC4FastContext</CODE> structure used by the <CODE>CRYPTO_RC4*</CODE> functions is 1032 bytes.<BR>With regard to speed, the <a href="CRYPTO_RC4FastEncrypt.html"><CODE>CRYPTO_RC4FastEncrypt</CODE></a> function processes data at approximately 1.5 times the normal processing speed when the data is sufficiently large. However, the difference in speed is caused by assigning the same pointer for <SPAN class="argument">in</SPAN> and <SPAN class="argument">out</SPAN>. If different pointers are assigned, there is almost no speed difference between the <a href="CRYPTO_RC4Encrypt.html"><CODE>CRYPTO_RC4Encrypt</CODE></a> and <CODE>CRYPTO_RC4FastEncrypt</CODE> functions.
59</P>
60<P>
61For detailed information on using the RC4 algorithm, see <A href="../overview/about_RC4.html"><B>Overview of Encryption Using RC4 Algorithm</B></A>.
62</P>
63
64<h2>See Also</h2>
65<p><A href="CRYPTO_RC4Fast.html"><CODE>CRYPTO_RC4Fast</CODE></A><br> <A href="CRYPTO_RC4FastInit.html"><CODE>CRYPTO_RC4FastInit</CODE></A></p>
66
67<H2>Revision History</H2>
68<P>
692008/02/25 Initial version.
70</P>
71<hr><p>CONFIDENTIAL</p></body>
72</html>
73