<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>Crypto++: rc5.h Source File</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.3.7 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a></div> <h1>rc5.h</h1><a href="rc5_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="preprocessor">#ifndef CRYPTOPP_RC5_H</span> 00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_RC5_H</span> 00003 <span class="preprocessor"></span><span class="comment"></span> 00004 <span class="comment">/** \file</span> 00005 <span class="comment">*/</span> 00006 00007 <span class="preprocessor">#include "seckey.h"</span> 00008 <span class="preprocessor">#include "secblock.h"</span> 00009 00010 NAMESPACE_BEGIN(CryptoPP) 00011 00012 <span class="comment">//! _</span> <a name="l00013"></a><a class="code" href="struct_r_c5___info.html">00013</a> <span class="comment"></span>struct <a class="code" href="struct_r_c5___info.html">RC5_Info</a> : public <a class="code" href="class_fixed_block_size.html">FixedBlockSize</a><8>, public <a class="code" href="class_variable_key_length.html">VariableKeyLength</a><16, 0, 255>, public <a class="code" href="class_variable_rounds.html">VariableRounds</a><16> 00014 { 00015 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"RC5"</span>;} 00016 <span class="keyword">typedef</span> word32 RC5_WORD; 00017 }; 00018 <span class="comment"></span> <a name="l00019"></a><a class="code" href="class_r_c5.html">00019</a> <span class="comment">/// <a href="http://www.weidai.com/scan-mirror/cs.html#RC5">RC5</a></span> 00020 <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_r_c5.html">RC5</a> : <span class="keyword">public</span> <a class="code" href="struct_r_c5___info.html">RC5_Info</a>, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a> 00021 { 00022 <span class="keyword">class </span>CRYPTOPP_NO_VTABLE Base : <span class="keyword">public</span> BlockCipherImpl<RC5_Info> 00023 { 00024 <span class="keyword">public</span>: 00025 <span class="keywordtype">void</span> UncheckedSetKey(<a class="code" href="cryptlib_8h.html#a11">CipherDir</a> direction, <span class="keyword">const</span> byte *userKey, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rounds); 00026 00027 <span class="keyword">protected</span>: 00028 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> r; <span class="comment">// number of rounds</span> 00029 <a class="code" href="class_sec_block.html">SecBlock<RC5_WORD></a> sTable; <span class="comment">// expanded key table</span> 00030 }; 00031 00032 <span class="keyword">class </span>CRYPTOPP_NO_VTABLE Enc : <span class="keyword">public</span> Base 00033 { 00034 <span class="keyword">public</span>: 00035 <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>; 00036 }; 00037 00038 <span class="keyword">class </span>CRYPTOPP_NO_VTABLE Dec : <span class="keyword">public</span> Base 00039 { 00040 <span class="keyword">public</span>: 00041 <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>; 00042 }; 00043 <a name="l00044"></a><a class="code" href="class_r_c5.html#_r_c5w0">00044</a> <span class="keyword">public</span>: <a name="l00045"></a><a class="code" href="class_r_c5.html#_r_c5w1">00045</a> <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">BlockCipherFinal<ENCRYPTION, Enc></a> <a class="code" href="class_block_cipher_final.html">Encryption</a>; 00046 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">BlockCipherFinal<DECRYPTION, Dec></a> <a class="code" href="class_block_cipher_final.html">Decryption</a>; 00047 }; 00048 00049 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">RC5::Encryption</a> <a class="code" href="class_block_cipher_final.html">RC5Encryption</a>; 00050 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_final.html">RC5::Decryption</a> <a class="code" href="class_block_cipher_final.html">RC5Decryption</a>; 00051 00052 NAMESPACE_END 00053 00054 <span class="preprocessor">#endif</span> </div></pre><hr size="1"><address style="align: right;"><small>Generated on Sun Nov 7 08:23:58 2004 for Crypto++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.7 </small></address> </body> </html>