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

📄 haval_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++: haval.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>haval.h</h1><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_HAVAL_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_HAVAL_H</span>00003 <span class="preprocessor"></span>00004 <span class="preprocessor">#include "iterhash.h"</span>00005 00006 NAMESPACE_BEGIN(CryptoPP)00007 00008 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/md.html#HAVAL"&gt;HAVAL&lt;/a&gt;</span><a name="l00009"></a><a class="code" href="class_h_a_v_a_l.html">00009</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_h_a_v_a_l.html">HAVAL</a> : <span class="keyword">public</span> <a class="code" href="class_iterated_hash.html">IteratedHash</a>&lt;word32, LittleEndian, 128&gt;00010 {00011 <span class="keyword">public</span>:00012         <span class="keyword">enum</span> {DIGESTSIZE = 32, HAVAL_VERSION = 1};00013 <span class="comment"></span>00014 <span class="comment">        /// digestSize can be 16, 20, 24, 28, or 32 (Default=32)&lt;br&gt;</span>00015 <span class="comment">        /// pass can be 3, 4 or 5 (Default=3)</span>00016 <span class="comment"></span>        <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_la0">HAVAL</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestSize=DIGESTSIZE, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> passes=3);00017         <span class="keywordtype">void</span> <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_l5a1">TruncatedFinal</a>(byte *hash, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size);<a name="l00018"></a><a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_l5a2">00018</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_l5a2">DigestSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> digestSize;}00019 00020 <span class="keyword">protected</span>:00021         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> wi2[32], wi3[32], wi4[32], wi5[32];00022         <span class="keyword">static</span> <span class="keyword">const</span> word32 mc2[32], mc3[32], mc4[32], mc5[32];00023 00024         <span class="keywordtype">void</span> Init();00025         <span class="keywordtype">void</span> Tailor(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> FPTLEN);00026         <span class="keywordtype">void</span> vTransform(<span class="keyword">const</span> word32 *in);00027 00028         <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestSize, pass;00029 };00030 <span class="comment"></span>00031 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/md.html#HAVAL"&gt;HAVAL&lt;/a&gt; with 3 passes</span><a name="l00032"></a><a class="code" href="class_h_a_v_a_l3.html">00032</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_h_a_v_a_l3.html">HAVAL3</a> : <span class="keyword">public</span> <a class="code" href="class_h_a_v_a_l.html">HAVAL</a>00033 {00034 <span class="keyword">public</span>:00035         <a class="code" href="class_h_a_v_a_l3.html">HAVAL3</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestSize=DIGESTSIZE) : <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_la0">HAVAL</a>(digestSize, 3) {}00036         <span class="keyword">static</span> <span class="keywordtype">void</span> Transform(word32 *buf, <span class="keyword">const</span> word32 *in);00037 };00038 <span class="comment"></span>00039 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/md.html#HAVAL"&gt;HAVAL&lt;/a&gt; with 4 passes</span><a name="l00040"></a><a class="code" href="class_h_a_v_a_l4.html">00040</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_h_a_v_a_l4.html">HAVAL4</a> : <span class="keyword">public</span> <a class="code" href="class_h_a_v_a_l.html">HAVAL</a>00041 {00042 <span class="keyword">public</span>:00043         <a class="code" href="class_h_a_v_a_l4.html">HAVAL4</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestSize=DIGESTSIZE) : <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_la0">HAVAL</a>(digestSize, 4) {}00044         <span class="keyword">static</span> <span class="keywordtype">void</span> Transform(word32 *buf, <span class="keyword">const</span> word32 *in);00045 };00046 <span class="comment"></span>00047 <span class="comment">/// &lt;a href="http://www.weidai.com/scan-mirror/md.html#HAVAL"&gt;HAVAL&lt;/a&gt; with 5 passes</span><a name="l00048"></a><a class="code" href="class_h_a_v_a_l5.html">00048</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_h_a_v_a_l5.html">HAVAL5</a> : <span class="keyword">public</span> <a class="code" href="class_h_a_v_a_l.html">HAVAL</a>00049 {00050 <span class="keyword">public</span>:00051         <a class="code" href="class_h_a_v_a_l5.html">HAVAL5</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestSize=DIGESTSIZE) : <a class="code" href="class_h_a_v_a_l.html#_h_a_v_a_la0">HAVAL</a>(digestSize, 5) {}00052         <span class="keyword">static</span> <span class="keywordtype">void</span> Transform(word32 *buf, <span class="keyword">const</span> word32 *in);00053 };00054 00055 NAMESPACE_END00056 00057 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 8 23:34:16 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 + -