<!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++: camellia.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">camellia.h</div> </div> </div><!--header--> <div class="contents"> <a href="camellia_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">// camellia.h - originally written and placed in the public domain by Wei Dai</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 camellia.h</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">/// \brief Classes for the Camellia block cipher</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#ifndef CRYPTOPP_CAMELLIA_H</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#define CRYPTOPP_CAMELLIA_H</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> </div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include "<a class="code" href="config_8h.html">config.h</a>"</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="seckey_8h.html">seckey.h</a>"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include "<a class="code" href="secblock_8h.html">secblock.h</a>"</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> </div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> NAMESPACE_BEGIN(<a class="code" href="namespace_crypto_p_p.html">CryptoPP</a>)</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">/// \brief Camellia block cipher information</span></div><div class="line"><a name="l00016"></a><span class="lineno"><a class="line" href="struct_camellia___info.html"> 16</a></span> <span class="comment"></span>struct <a class="code" href="struct_camellia___info.html">Camellia_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="l00017"></a><span class="lineno"> 17</span> {</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  CRYPTOPP_STATIC_CONSTEXPR <span class="keyword">const</span> <span class="keywordtype">char</span>* StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"Camellia"</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> <span class="comment"></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">/// \brief Camellia block cipher</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/// \sa <a href="http://www.cryptopp.com/wiki/Camellia">Camellia</a></span></div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_camellia.html"> 23</a></span> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_camellia.html">Camellia</a> : <span class="keyword">public</span> <a class="code" href="struct_camellia___info.html">Camellia_Info</a>, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> {</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">class </span>CRYPTOPP_NO_VTABLE Base : <span class="keyword">public</span> <a class="code" href="class_block_cipher_impl.html">BlockCipherImpl</a><Camellia_Info></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</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="l00029"></a><span class="lineno"> 29</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="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  CRYPTOPP_ALIGN_DATA(4) <span class="keyword">static</span> <span class="keyword">const</span> byte s1[256];</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">static</span> <span class="keyword">const</span> word32 SP[4][256];</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_rounds;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <a class="code" href="class_sec_block.html">SecBlock<word32></a> m_key;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  };</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</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="l00041"></a><span class="lineno"> 41</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="l00042"></a><span class="lineno"> 42</span> };</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">typedef</span> <a class="code" href="class_block_cipher_final.html">Camellia::Encryption</a> <a class="code" href="class_block_cipher_final.html">CamelliaEncryption</a>;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">Camellia::Decryption</a> <a class="code" href="class_block_cipher_final.html">CamelliaDecryption</a>;</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> NAMESPACE_END</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#endif</span></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< word32 ></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_camellia_html"><div class="ttname"><a href="class_camellia.html">Camellia</a></div><div class="ttdoc">Camellia block cipher. </div><div class="ttdef"><b>Definition:</b> <a href="camellia_8h_source.html#l00023">camellia.h:23</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="struct_camellia___info_html"><div class="ttname"><a href="struct_camellia___info.html">Camellia_Info</a></div><div class="ttdoc">Camellia block cipher information. </div><div class="ttdef"><b>Definition:</b> <a href="camellia_8h_source.html#l00016">camellia.h:16</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:47 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>