⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cast_8h-source.html

📁 Crypto++是一个非常强大的密码学库,主要是功能全
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: cast.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><h1>cast.h</h1><a href="cast_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_CAST_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_CAST_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="keyword">class </span>CAST00013 {00014 <span class="keyword">protected</span>:00015         <span class="keyword">static</span> <span class="keyword">const</span> word32 S[8][256];00016 };00017 <span class="comment"></span>00018 <span class="comment">//! .</span><a name="l00019"></a><a class="code" href="struct_c_a_s_t128___info.html">00019</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_a_s_t128___info.html">CAST128_Info</a> : <span class="keyword">public</span> <a class="code" href="class_fixed_block_size.html">FixedBlockSize</a>&lt;8&gt;, <span class="keyword">public</span> <a class="code" href="class_variable_key_length.html">VariableKeyLength</a>&lt;16, 5, 16&gt;00020 {00021         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CAST-128"</span>;}00022 };00023 <span class="comment"></span>00024 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/cs.html#CAST-128"&gt;CAST-128&lt;/a&gt;</span><a name="l00025"></a><a class="code" href="class_c_a_s_t128.html">00025</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_c_a_s_t128.html">CAST128</a> : <span class="keyword">public</span> <a class="code" href="struct_c_a_s_t128___info.html">CAST128_Info</a>, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a>00026 {00027         <span class="keyword">class </span>Base : <span class="keyword">public</span> CAST, <span class="keyword">public</span> BlockCipherBaseTemplate&lt;CAST128_Info&gt;00028         {00029         <span class="keyword">public</span>:00030                 <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);00031 00032         <span class="keyword">protected</span>:00033                 <span class="keywordtype">bool</span> reduced;00034                 FixedSizeSecBlock&lt;word32, 32&gt; K;00035         };00036 00037         <span class="keyword">class </span>Enc : <span class="keyword">public</span> Base00038         {00039         <span class="keyword">public</span>:00040                 <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>;00041         };00042 00043         <span class="keyword">class </span>Dec : <span class="keyword">public</span> Base00044         {00045         <span class="keyword">public</span>:00046                 <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>;00047         };00048 00049 <span class="keyword">public</span>:<a name="l00050"></a><a class="code" href="class_c_a_s_t128.html#_c_a_s_t128w0">00050</a>         <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">BlockCipherTemplate&lt;ENCRYPTION, Enc&gt;</a> <a class="code" href="class_block_cipher_template.html">Encryption</a>;<a name="l00051"></a><a class="code" href="class_c_a_s_t128.html#_c_a_s_t128w1">00051</a>         <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">BlockCipherTemplate&lt;DECRYPTION, Dec&gt;</a> <a class="code" href="class_block_cipher_template.html">Decryption</a>;00052 };00053 <span class="comment"></span>00054 <span class="comment">//! .</span><a name="l00055"></a><a class="code" href="struct_c_a_s_t256___info.html">00055</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_a_s_t256___info.html">CAST256_Info</a> : <span class="keyword">public</span> <a class="code" href="class_fixed_block_size.html">FixedBlockSize</a>&lt;16&gt;, <span class="keyword">public</span> <a class="code" href="class_variable_key_length.html">VariableKeyLength</a>&lt;16, 16, 32&gt;00056 {00057         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CAST-256"</span>;}00058 };00059 <span class="comment"></span>00060 <span class="comment">//! &lt;a href="http://www.weidai.com/scan-mirror/cs.html#CAST-256"&gt;CAST-256&lt;/a&gt;</span><a name="l00061"></a><a class="code" href="class_c_a_s_t256.html">00061</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_c_a_s_t256.html">CAST256</a> : <span class="keyword">public</span> <a class="code" href="struct_c_a_s_t256___info.html">CAST256_Info</a>, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a>00062 {00063         <span class="keyword">class </span>Base : <span class="keyword">public</span> CAST, <span class="keyword">public</span> BlockCipherBaseTemplate&lt;CAST256_Info&gt;00064         {00065         <span class="keyword">public</span>:00066                 <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 = 8);00067                 <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>;00068 00069         <span class="keyword">protected</span>:00070                 <span class="keyword">static</span> <span class="keyword">const</span> word32 t_m[8][24];00071                 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> t_r[8][24];00072 00073                 <span class="keyword">static</span> <span class="keywordtype">void</span> Omega(<span class="keywordtype">int</span> i, word32 kappa[8]);00074 00075                 FixedSizeSecBlock&lt;word32, 8*12&gt; K;00076         };00077 00078 <span class="keyword">public</span>:<a name="l00079"></a><a class="code" href="class_c_a_s_t256.html#_c_a_s_t256w0">00079</a>         <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">BlockCipherTemplate&lt;ENCRYPTION, Base&gt;</a> <a class="code" href="class_block_cipher_template.html">Encryption</a>;<a name="l00080"></a><a class="code" href="class_c_a_s_t256.html#_c_a_s_t256w1">00080</a>         <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">BlockCipherTemplate&lt;DECRYPTION, Base&gt;</a> <a class="code" href="class_block_cipher_template.html">Decryption</a>;00081 };00082 00083 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">CAST128::Encryption</a> <a class="code" href="class_block_cipher_template.html">CAST128Encryption</a>;00084 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">CAST128::Decryption</a> <a class="code" href="class_block_cipher_template.html">CAST128Decryption</a>;00085 00086 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">CAST256::Encryption</a> <a class="code" href="class_block_cipher_template.html">CAST256Encryption</a>;00087 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">CAST256::Decryption</a> <a class="code" href="class_block_cipher_template.html">CAST256Decryption</a>;00088 00089 NAMESPACE_END00090 00091 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 8 23:34:10 2003 for Crypto++ by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.2 </small></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -