<!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.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crypto++: aria.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 id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crypto++  <span id="projectnumber">7.0</span> </div> <div id="projectbrief">Free C++ class library of cryptographic schemes</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">aria.h</div> </div> </div><!--header--> <div class="contents"> <a href="aria_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">// aria.h - written and placed in the public domain by Jeffrey Walton</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">/// \file aria.h</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">/// \brief Classes for the ARIA block cipher</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">/// \details The Crypto++ ARIA implementation is based on the 32-bit implementation by Aaram Yun</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">/// from the National Security Research Institute, KOREA. Aaram Yun's implementation is based on</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">/// the 8-bit implementation by Jin Hong. The source files are available in ARIA.zip from the Korea</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">/// Internet & Security Agency website.</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">/// \sa <A HREF="http://tools.ietf.org/html/rfc5794">RFC 5794, A Description of the ARIA Encryption Algorithm</A>,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">/// <A HREF="http://seed.kisa.or.kr/iwt/ko/bbs/EgovReferenceList.do?bbsId=BBSMSTR_000000000002">Korea</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">/// Internet & Security Agency homepage</A></span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#ifndef CRYPTOPP_ARIA_H</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#define CRYPTOPP_ARIA_H</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> </div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="config_8h.html">config.h</a>"</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include "<a class="code" href="seckey_8h.html">seckey.h</a>"</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include "<a class="code" href="secblock_8h.html">secblock.h</a>"</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> NAMESPACE_BEGIN(<a class="code" href="namespace_crypto_p_p.html">CryptoPP</a>)</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/// \brief ARIA block cipher information</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"></span><span class="comment">/// \since Crypto++ 6.0</span></div><div class="line"><a name="l00024"></a><span class="lineno"><a class="line" href="struct_a_r_i_a___info.html"> 24</a></span> <span class="comment"></span>struct <a class="code" href="struct_a_r_i_a___info.html">ARIA_Info</a> : public <a class="code" href="class_fixed_block_size.html">FixedBlockSize</a><16>, public <a class="code" href="class_variable_key_length.html">VariableKeyLength</a><16, 16, 32, 8></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> {</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  CRYPTOPP_STATIC_CONSTEXPR <span class="keyword">const</span> <span class="keywordtype">char</span>* StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"ARIA"</span>;}</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> };</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">/// \brief ARIA block cipher</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">/// \details The Crypto++ ARIA implementation is based on the 32-bit implementation by Aaram Yun</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">/// from the National Security Research Institute, KOREA. Aaram Yun's implementation is based on</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">/// the 8-bit implementation by Jin Hong. The source files are available in ARIA.zip from the Korea</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">/// Internet & Security Agency website.</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment">/// \sa <A HREF="http://tools.ietf.org/html/rfc5794">RFC 5794, A Description of the ARIA Encryption Algorithm</A>,</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">/// <A HREF="http://seed.kisa.or.kr/iwt/ko/bbs/EgovReferenceList.do?bbsId=BBSMSTR_000000000002">Korea</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">/// Internet & Security Agency homepage</A></span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">/// \sa <a href="http://www.cryptopp.com/wiki/ARIA">ARIA</a></span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">/// \since Crypto++ 6.0</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="class_a_r_i_a.html"> 39</a></span> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_a_r_i_a.html">ARIA</a> : <span class="keyword">public</span> <a class="code" href="struct_a_r_i_a___info.html">ARIA_Info</a>, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="class_a_r_i_a_1_1_base.html"> 42</a></span>  <span class="keyword">class </span>CRYPTOPP_NO_VTABLE <a class="code" href="class_a_r_i_a_1_1_base.html">Base</a> : <span class="keyword">public</span> <a class="code" href="class_block_cipher_impl.html">BlockCipherImpl</a><ARIA_Info></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  {</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <a class="code" href="class_a_r_i_a_1_1_base.html">Base</a>() : m_rounds(0) {}</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordtype">void</span> UncheckedSetKey(<span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> keylen, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &params);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordtype">void</span> ProcessAndXorBlock(<span class="keyword">const</span> byte *inBlock, <span class="keyword">const</span> byte *xorBlock, byte *outBlock) <span class="keyword">const</span>;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// Reference implementation allocates a table of 17 round keys.</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">typedef</span> <a class="code" href="class_sec_block.html">SecBlock<byte, AllocatorWithCleanup<byte, true></a> > <a class="code" href="class_sec_block.html">AlignedByteBlock</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keyword">typedef</span> <a class="code" href="class_sec_block.html">SecBlock<word32, AllocatorWithCleanup<word32, true></a> > <a class="code" href="class_sec_block.html">AlignedWordBlock</a>;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="class_sec_block.html">AlignedByteBlock</a> m_rk; <span class="comment">// round keys</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="class_sec_block.html">AlignedWordBlock</a> m_w; <span class="comment">// w0, w1, w2, w3, t and u</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_rounds;</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  };</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">BlockCipherFinal<ENCRYPTION, Base></a> <a class="code" href="class_block_cipher_final.html">Encryption</a>;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">BlockCipherFinal<DECRYPTION, Base></a> <a class="code" href="class_block_cipher_final.html">Decryption</a>;</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> };</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">ARIA::Encryption</a> <a class="code" href="class_block_cipher_final.html">ARIAEncryption</a>;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">ARIA::Decryption</a> <a class="code" href="class_block_cipher_final.html">ARIADecryption</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> NAMESPACE_END</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="class_a_r_i_a_html"><div class="ttname"><a href="class_a_r_i_a.html">ARIA</a></div><div class="ttdoc">ARIA block cipher. </div><div class="ttdef"><b>Definition:</b> <a href="aria_8h_source.html#l00039">aria.h:39</a></div></div> <div class="ttc" id="struct_block_cipher_documentation_html"><div class="ttname"><a href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a></div><div class="ttdoc">Provides Encryption and Decryption typedefs used by derived classes to implement a block cipher...</div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00420">seckey.h:420</a></div></div> <div class="ttc" id="class_sec_block_html"><div class="ttname"><a href="class_sec_block.html">SecBlock</a></div><div class="ttdoc">Secure memory block with allocator and cleanup. </div><div class="ttdef"><b>Definition:</b> <a href="secblock_8h_source.html#l00454">secblock.h:454</a></div></div> <div class="ttc" id="config_8h_html"><div class="ttname"><a href="config_8h.html">config.h</a></div><div class="ttdoc">Library configuration file. </div></div> <div class="ttc" id="secblock_8h_html"><div class="ttname"><a href="secblock_8h.html">secblock.h</a></div><div class="ttdoc">Classes and functions for secure memory allocations. </div></div> <div class="ttc" id="class_fixed_block_size_html"><div class="ttname"><a href="class_fixed_block_size.html">FixedBlockSize</a></div><div class="ttdoc">Inherited by algorithms with fixed block size. </div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00040">seckey.h:40</a></div></div> <div class="ttc" id="seckey_8h_html"><div class="ttname"><a href="seckey_8h.html">seckey.h</a></div><div class="ttdoc">Classes and functions for implementing secret key algorithms. </div></div> <div class="ttc" id="class_block_cipher_final_html"><div class="ttname"><a href="class_block_cipher_final.html">BlockCipherFinal</a></div><div class="ttdoc">Provides class member functions to key a block cipher. </div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00339">seckey.h:339</a></div></div> <div class="ttc" id="class_variable_key_length_html"><div class="ttname"><a href="class_variable_key_length.html">VariableKeyLength</a></div><div class="ttdoc">Inherited by keyed algorithms with variable key length. </div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00188">seckey.h:188</a></div></div> <div class="ttc" id="class_a_r_i_a_1_1_base_html"><div class="ttname"><a href="class_a_r_i_a_1_1_base.html">ARIA::Base</a></div><div class="ttdef"><b>Definition:</b> <a href="aria_8h_source.html#l00042">aria.h:42</a></div></div> <div class="ttc" id="struct_a_r_i_a___info_html"><div class="ttname"><a href="struct_a_r_i_a___info.html">ARIA_Info</a></div><div class="ttdoc">ARIA block cipher information. </div><div class="ttdef"><b>Definition:</b> <a href="aria_8h_source.html#l00024">aria.h:24</a></div></div> <div class="ttc" id="class_block_cipher_impl_html"><div class="ttname"><a href="class_block_cipher_impl.html">BlockCipherImpl</a></div><div class="ttdoc">Provides a base implementation of Algorithm and SimpleKeyingInterface for block ciphers. </div><div class="ttdef"><b>Definition:</b> <a href="seckey_8h_source.html#l00327">seckey.h:327</a></div></div> <div class="ttc" id="namespace_crypto_p_p_html"><div class="ttname"><a href="namespace_crypto_p_p.html">CryptoPP</a></div><div class="ttdoc">Crypto++ library namespace. </div></div> <div class="ttc" id="class_name_value_pairs_html"><div class="ttname"><a href="class_name_value_pairs.html">NameValuePairs</a></div><div class="ttdoc">Interface for retrieving values given their names. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00290">cryptlib.h:290</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:57:45 for Crypto++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>