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>NETAESCreate</title> 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9</head> 10 11<body> 12 13<h1 align="left">NETAESCreate</h1> 14<h2>C Specification</h2> 15 16<dl> 17 <dd> 18<PRE><CODE>#include <revolution/net.h> 19 20BOOL NETAESCreate( <A href="NETAESContext.html">NETAESContext</A> *context, const void *key, u32 keylen, const void *iv ); 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">key</font></strong></em></TD> 32<TD width="670">Key to use for AES encryption.</TD> 33 </TR> 34 <TR> 35<TD width="176"><em><strong><font face="Courier New">keylen</font></strong></em></TD> 36<TD width="670">Length (in bytes) of the key. Choose between key lengths of 16 bytes (128 bits), 24 bytes (192 bits), and 32 bytes (256 bits).</TD> 37 </TR> 38 <TR> 39<TD width="176"><em><strong><font face="Courier New">iv</font></strong></em></TD> 40<TD width="670">The 16-byte initial vector to use for AES encryption.<br>The NET library only supports CBC mode for AES encryption.</TD> 41 </TR> 42 </table> 43<h2>Return Values</h2> 44<p>Returns TRUE if the AES encryption context has been generated correctly. Otherwise, returns FALSE.</p> 45<H2>Description</H2> 46<p>This function generates an AES encryption context. Make sure that this function is called before using <A href="NETAESEncrypt.html"><CODE>NETAESEncrypt</CODE></A> and <A href="NETAESDecrypt.html"><CODE>NETAESDecrypt</CODE></A>.<BR>You must also call <A href="NETAESDelete.html"><CODE>NETAESDelete</CODE></A> to release the context after using these functions. 47</p> 48<h2>Note</h2> 49<ul> 50<li>To bolster the robustness of the encryption, the initial vector should be a random byte string, and a different value should be used for each set of plain text being encrypted.</li> 51<li>The initial vector used at the time of decryption must be the same as the initial vector that is specified by this function at the time of encryption.</li> 52</ul> 53<h2>See Also</h2> 54<P> 55<A href="NETAESEncrypt.html">NETAESEncrypt</A> <A href="NETAESDecrypt.html">NETAESDecrypt</A> <A href="NETAESDelete.html">NETAESDelete</A> 56</P> 57<H2>Revision History</H2> 58<P> 592006/10/27 Added arguments and explanations for the expanded specifications.<br>2006/10/12 Initial version.<br> 60</P> 61<hr><p>CONFIDENTIAL</p></body> 62</html> 63