<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>BeeCrypt: include/beecrypt/aes.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">BeeCrypt  <span id="projectnumber">4.2.1</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_7519372152c32ce484a8cde0fb6b8cd0.html">beecrypt</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">aes.h</div> </div> </div><!--header--> <div class="contents"> <a href="aes_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div> <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2002, 2003 Bob Deblier</span></div> <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div> <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * This library is free software; you can redistribute it and/or</span></div> <div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * modify it under the terms of the GNU Lesser General Public</span></div> <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * License as published by the Free Software Foundation; either</span></div> <div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * version 2.1 of the License, or (at your option) any later version.</span></div> <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div> <div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * This library is distributed in the hope that it will be useful,</span></div> <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div> <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span></div> <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * Lesser General Public License for more details.</span></div> <div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div> <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * You should have received a copy of the GNU Lesser General Public</span></div> <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * License along with this library; if not, write to the Free Software</span></div> <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span></div> <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> *</span></div> <div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> */</span></div> <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div> <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#ifndef _AES_H</span></div> <div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor"></span><span class="preprocessor">#define _AES_H</span></div> <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor"></span></div> <div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="beecrypt_8h.html">beecrypt/beecrypt.h</a>"</span></div> <div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="aesopt_8h.html">beecrypt/aesopt.h</a>"</span></div> <div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div> <div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#ifdef __cplusplus</span></div> <div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="structaesParam.html"> 36</a></span> <span class="preprocessor"></span><span class="keyword">struct </span><a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a> <a class="code" href="structaesParam.html">aesParam</a></div> <div class="line"><a name="l00037"></a><span class="lineno"> 37</span> #else</div> <div class="line"><a name="l00038"></a><span class="lineno"> 38</span> struct _aesParam</div> <div class="line"><a name="l00039"></a><span class="lineno"> 39</span> #endif</div> <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div> <div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structaesParam.html#a1235a533a7e8574baf51c3e31e4bf69b"> 44</a></span>  uint32_t k[64];</div> <div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structaesParam.html#a50ba4b303eb2b91cef41cfc9eb055c7f"> 48</a></span>  uint32_t <a class="code" href="structaesParam.html#a50ba4b303eb2b91cef41cfc9eb055c7f">nr</a>;</div> <div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structaesParam.html#a0c5da5c65c0bdee48c89149217a458ce"> 52</a></span>  uint32_t fdback[4];</div> <div class="line"><a name="l00053"></a><span class="lineno"> 53</span> };</div> <div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div> <div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#ifndef __cplusplus</span></div> <div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>_aesParam <a class="code" href="structaesParam.html">aesParam</a>;</div> <div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="preprocessor">#endif</span></div> <div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor"></span></div> <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="preprocessor">#ifdef __cplusplus</span></div> <div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div> <div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="preprocessor">#endif</span></div> <div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor"></span></div> <div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">extern</span> <span class="keyword">const</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a> <a class="code" href="structblockCipher.html">blockCipher</a> <a class="code" href="aes_8h.html#aa60b0eb68ff417f08ef26ac0eacf021f">aes</a>;</div> <div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div> <div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">int</span> <a class="code" href="aes_8h.html#a643aa89c715a711cc441a5a4a7397ea6">aesSetup</a> (<a class="code" href="structaesParam.html">aesParam</a>* ap, <span class="keyword">const</span> <a class="code" href="api_8h.html#ab8ef12fab634c171394422d0ee8baf94">byte</a>* key, <span class="keywordtype">size_t</span> keybits, <a class="code" href="group__BC__m.html#gace10d4c0b0409d35c6a703d6445fc558">cipherOperation</a> op);</div> <div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div> <div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="keywordtype">int</span> <a class="code" href="aes_8h.html#a778e5ab1749733a37bbca97a43838305">aesSetIV</a> (<a class="code" href="structaesParam.html">aesParam</a>* ap, <span class="keyword">const</span> <a class="code" href="api_8h.html#ab8ef12fab634c171394422d0ee8baf94">byte</a>* iv);</div> <div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div> <div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="keywordtype">int</span> <a class="code" href="aes_8h.html#abaadaaf3f01f1fde6237ccc08e3677e5">aesSetCTR</a> (<a class="code" href="structaesParam.html">aesParam</a>* ap, <span class="keyword">const</span> <a class="code" href="api_8h.html#ab8ef12fab634c171394422d0ee8baf94">byte</a>* nivz, <span class="keywordtype">size_t</span> counter);</div> <div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div> <div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="keywordtype">int</span> <a class="code" href="aes_8h.html#a7a169238993aa7999831c40ae78d941a">aesEncrypt</a> (<a class="code" href="structaesParam.html">aesParam</a>* ap, uint32_t* dst, <span class="keyword">const</span> uint32_t* src);</div> <div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div> <div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="keywordtype">int</span> <a class="code" href="aes_8h.html#a35fce1a4e2f1df8de178ebc667bcedbf">aesDecrypt</a> (<a class="code" href="structaesParam.html">aesParam</a>* ap, uint32_t* dst, <span class="keyword">const</span> uint32_t* src);</div> <div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div> <div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <a class="code" href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div> <div class="line"><a name="l00125"></a><span class="lineno"> 125</span> uint32_t* <a class="code" href="aes_8h.html#ae0b5b285473012afa45a9044048a1f1a">aesFeedback</a>(<a class="code" href="structaesParam.html">aesParam</a>* ap);</div> <div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div> <div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="preprocessor">#ifdef __cplusplus</span></div> <div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="preprocessor"></span>}</div> <div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="preprocessor">#endif</span></div> <div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="preprocessor"></span></div> <div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="preprocessor">#endif</span></div> <div class="ttc" id="aes_8h_html_aa60b0eb68ff417f08ef26ac0eacf021f"><div class="ttname"><a href="aes_8h.html#aa60b0eb68ff417f08ef26ac0eacf021f">aes</a></div><div class="ttdeci">const blockCipher aes</div><div class="ttdoc">Holds the full API description of the AES algorithm. </div></div> <div class="ttc" id="structaesParam_html_a50ba4b303eb2b91cef41cfc9eb055c7f"><div class="ttname"><a href="structaesParam.html#a50ba4b303eb2b91cef41cfc9eb055c7f">aesParam::nr</a></div><div class="ttdeci">uint32_t nr</div><div class="ttdoc">Number of rounds to be used in encryption/decryption. </div><div class="ttdef"><b>Definition:</b> aes.h:48</div></div> <div class="ttc" id="structblockCipher_html"><div class="ttname"><a href="structblockCipher.html">blockCipher</a></div><div class="ttdoc">Holds information and pointers to code specific to each cipher. </div><div class="ttdef"><b>Definition:</b> beecrypt.h:644</div></div> <div class="ttc" id="aesopt_8h_html"><div class="ttname"><a href="aesopt_8h.html">aesopt.h</a></div><div class="ttdoc">AES block cipher, assembler-optimized routines, headers. </div></div> <div class="ttc" id="aes_8h_html_ae0b5b285473012afa45a9044048a1f1a"><div class="ttname"><a href="aes_8h.html#ae0b5b285473012afa45a9044048a1f1a">aesFeedback</a></div><div class="ttdeci">uint32_t * aesFeedback(aesParam *ap)</div></div> <div class="ttc" id="beecrypt_8h_html"><div class="ttname"><a href="beecrypt_8h.html">beecrypt.h</a></div><div class="ttdoc">BeeCrypt API, headers. </div></div> <div class="ttc" id="aes_8h_html_abaadaaf3f01f1fde6237ccc08e3677e5"><div class="ttname"><a href="aes_8h.html#abaadaaf3f01f1fde6237ccc08e3677e5">aesSetCTR</a></div><div class="ttdeci">int aesSetCTR(aesParam *ap, const byte *nivz, size_t counter)</div><div class="ttdoc">This function sets the CTR mode counter. </div></div> <div class="ttc" id="api_8h_html_ab8ef12fab634c171394422d0ee8baf94"><div class="ttname"><a href="api_8h.html#ab8ef12fab634c171394422d0ee8baf94">byte</a></div><div class="ttdeci">uint8_t byte</div><div class="ttdef"><b>Definition:</b> api.h:72</div></div> <div class="ttc" id="api_8h_html_a4f699d64328623c51b22f3b3f1ff4150"><div class="ttname"><a href="api_8h.html#a4f699d64328623c51b22f3b3f1ff4150">BEECRYPTAPI</a></div><div class="ttdeci">#define BEECRYPTAPI</div><div class="ttdef"><b>Definition:</b> api.h:52</div></div> <div class="ttc" id="aes_8h_html_a643aa89c715a711cc441a5a4a7397ea6"><div class="ttname"><a href="aes_8h.html#a643aa89c715a711cc441a5a4a7397ea6">aesSetup</a></div><div class="ttdeci">int aesSetup(aesParam *ap, const byte *key, size_t keybits, cipherOperation op)</div><div class="ttdoc">This function performs the cipher&#39;s key expansion. </div></div> <div class="ttc" id="aes_8h_html_a778e5ab1749733a37bbca97a43838305"><div class="ttname"><a href="aes_8h.html#a778e5ab1749733a37bbca97a43838305">aesSetIV</a></div><div class="ttdeci">int aesSetIV(aesParam *ap, const byte *iv)</div><div class="ttdoc">This function sets the Initialization Vector. </div></div> <div class="ttc" id="aes_8h_html_a7a169238993aa7999831c40ae78d941a"><div class="ttname"><a href="aes_8h.html#a7a169238993aa7999831c40ae78d941a">aesEncrypt</a></div><div class="ttdeci">int aesEncrypt(aesParam *ap, uint32_t *dst, const uint32_t *src)</div><div class="ttdoc">This function performs the raw AES encryption; it encrypts one block of 128 bits. ...</div></div> <div class="ttc" id="group__BC__m_html_gace10d4c0b0409d35c6a703d6445fc558"><div class="ttname"><a href="group__BC__m.html#gace10d4c0b0409d35c6a703d6445fc558">cipherOperation</a></div><div class="ttdeci">cipherOperation</div><div class="ttdoc">Specifies whether to perform encryption or decryption. </div><div class="ttdef"><b>Definition:</b> beecrypt.h:556</div></div> <div class="ttc" id="aes_8h_html_a35fce1a4e2f1df8de178ebc667bcedbf"><div class="ttname"><a href="aes_8h.html#a35fce1a4e2f1df8de178ebc667bcedbf">aesDecrypt</a></div><div class="ttdeci">int aesDecrypt(aesParam *ap, uint32_t *dst, const uint32_t *src)</div><div class="ttdoc">This function performs the raw AES decryption; it decrypts one block of 128 bits. ...</div></div> <div class="ttc" id="structaesParam_html"><div class="ttname"><a href="structaesParam.html">aesParam</a></div><div class="ttdoc">Holds all the parameters necessary for the AES cipher. </div><div class="ttdef"><b>Definition:</b> aes.h:36</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Sep 27 2013 02:36:25 for BeeCrypt by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>