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 http-equiv="Content-Style-Type" content="text/css">
7<title>NETAESEncrypt</title>
8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css">
9</head>
10
11<body>
12
13<h1 align="left">NETAESEncrypt</h1>
14<h2>C Specification</h2>
15
16<dl>
17  <dd>
18<PRE><CODE>#include &lt;revolution/net.h&gt;
19
20BOOL NETAESEncrypt( <A href="NETAESContext.html">NETAESContext</A> *context, void *dst, const void *src, u32 len );
21</CODE></PRE>
22  </dd>
23</dl><h2>Arguments</h2>
24
25<table border="1" width="100%">
26    <TR>
27<TD width="176"><em><strong><font face="Courier New">context</font></strong></em></TD>
28<TD width="670">Pointer to the AES encryption context structure.</TD>
29    </TR>
30    <TR>
31<TD width="176"><em><strong><font face="Courier New">dst</font></strong></em></TD>
32<TD width="670">Buffer where encrypted text is stored.<br>The start address of the cache must be aligned at a 32-byte boundary.</TD>
33    </TR>
34    <TR>
35<TD width="176"><em><strong><font face="Courier New">src</font></strong></em></TD>
36<TD width="670">The plain text data from which the encrypted text is generated.<br>The start address of the cache must be aligned at a 32-byte boundary.<br><font color="red">The same address as the storage location (dst) cannot be specified.</font></TD>
37    </TR>
38    <TR>
39<TD width="176"><em><strong><font face="Courier New">len</font></strong></em></TD>
40<TD width="670">The length of the plain text.<br>Because block encryption is used, encrypted text must be aligned at a 16-byte boundary.</TD>
41    </TR>
42  </table>
43<h2>Return Values</h2>
44<p>Returns TRUE if the encryption process succeeds. Otherwise, returns FALSE.</p>
45<H2>Description</H2>
46<p>This function encrypts plain text, using the AES encryption context. AES encryption context must be generated first by calling the <CODE><A href="NETAESCreate.html">NETAESCreate</A></CODE> function. <br><br>The encryption process always outputs encrypted text that is the same length as the plain text that was input. The overall content of encrypted text is the same, whether the plain text is all encrypted at once or whether it is divided into appropriate sizes and encrypted sequentially. Blocks are in units of 16 bytes, so any data smaller than a single block cannot be encrypted. If you round up the size during the encryption process to handle data of fewer than 16 bytes, such as text termination fractions, you will must skip this added data when decrypting.</p>
47<h2>See Also</h2>
48<P>
49<A href="NETAESCreate.html"><CODE>NETAESCreate</CODE></A>, <A href="NETAESDecrypt.html"><CODE>NETAESDecrypt</CODE></A>, <A href="NETAESDelete.html"><CODE>NETAESDelete</CODE></A>
50</P>
51<H2>Revision History</H2>
52<P>
532006/10/27 Revised descriptions.<br>2006/10/12 Initial version.<BR>
54</P>
55<hr><p>CONFIDENTIAL</p></body>
56</html>
57