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

📄 shark_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++: shark.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>shark.h</h1><a href="shark_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_SHARK_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_SHARK_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 "config.h"</span>00008 00009 <span class="preprocessor">#ifdef WORD64_AVAILABLE</span>00010 <span class="preprocessor"></span>00011 <span class="preprocessor">#include "seckey.h"</span>00012 <span class="preprocessor">#include "secblock.h"</span>00013 00014 NAMESPACE_BEGIN(CryptoPP)00015 00016 <span class="keyword">struct </span>SHARK_Info : <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, 1, 16&gt;, <span class="keyword">public</span> <a class="code" href="class_variable_rounds.html">VariableRounds</a>&lt;6, 2&gt;00017 {00018         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"SHARK-E"</span>;}00019 };00020 <span class="comment"></span>00021 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/cs.html#SHARK-E"&gt;SHARK-E&lt;/a&gt;</span><a name="l00022"></a><a class="code" href="class_s_h_a_r_k.html">00022</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_s_h_a_r_k.html">SHARK</a> : <span class="keyword">public</span> SHARK_Info, <span class="keyword">public</span> <a class="code" href="struct_block_cipher_documentation.html">BlockCipherDocumentation</a>00023 {00024         <span class="keyword">class </span>Base : <span class="keyword">public</span> BlockCipherBaseTemplate&lt;SHARK_Info&gt;00025         {00026         <span class="keyword">public</span>:00027                 <span class="keywordtype">void</span> UncheckedSetKey(<a class="code" href="cryptlib_8h.html#a11">CipherDir</a> dir, <span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> rounds);00028 00029         <span class="keyword">protected</span>:00030                 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_rounds;00031                 <a class="code" href="class_sec_block.html">SecBlock&lt;word64&gt;</a> m_roundKeys;00032         };00033 00034         <span class="keyword">class </span>Enc : <span class="keyword">public</span> Base00035         {00036         <span class="keyword">public</span>:00037                 <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>;00038 00039                 <span class="comment">// used by Base to do key setup</span>00040                 <span class="keywordtype">void</span> InitForKeySetup();00041 00042         <span class="keyword">private</span>:00043                 <span class="keyword">static</span> <span class="keyword">const</span> byte sbox[256];00044                 <span class="keyword">static</span> <span class="keyword">const</span> word64 cbox[8][256];00045         };00046 00047         <span class="keyword">class </span>Dec : <span class="keyword">public</span> Base00048         {00049         <span class="keyword">public</span>:00050                 <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>;00051 00052         <span class="keyword">private</span>:00053                 <span class="keyword">static</span> <span class="keyword">const</span> byte sbox[256];00054                 <span class="keyword">static</span> <span class="keyword">const</span> word64 cbox[8][256];00055         };00056 00057 <span class="keyword">public</span>:<a name="l00058"></a><a class="code" href="class_s_h_a_r_k.html#_s_h_a_r_kw0">00058</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="l00059"></a><a class="code" href="class_s_h_a_r_k.html#_s_h_a_r_kw1">00059</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>;00060 };00061 00062 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">SHARK::Encryption</a> <a class="code" href="class_block_cipher_template.html">SHARKEncryption</a>;00063 <span class="keyword">typedef</span> <a class="code" href="class_block_cipher_template.html">SHARK::Decryption</a> <a class="code" href="class_block_cipher_template.html">SHARKDecryption</a>;00064 00065 NAMESPACE_END00066 00067 <span class="preprocessor">#endif</span>00068 <span class="preprocessor"></span><span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 8 23:34:25 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 + -