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

📄 vmac_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keyword">protected</span>:<a name="l00034"></a>00034         <span class="keyword">virtual</span> <a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp; AccessCipher() =0;<a name="l00035"></a>00035         <span class="keyword">virtual</span> <span class="keywordtype">int</span> DefaultDigestSize() <span class="keyword">const</span> =0;<a name="l00036"></a><a class="code" href="class_v_m_a_c___base.html#7cfa67884a99f789c41d93bf08698a7f">00036</a>         <span class="keyword">const</span> <a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp; <a class="code" href="class_v_m_a_c___base.html#7cfa67884a99f789c41d93bf08698a7f">GetCipher</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">const_cast&lt;</span><a class="code" href="class_v_m_a_c___base.html" title=".">VMAC_Base</a> *<span class="keyword">&gt;</span>(<span class="keyword">this</span>)-&gt;AccessCipher();}<a name="l00037"></a>00037         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#fc475d6a455618658c07049b39df582a">HashEndianCorrectedBlock</a>(<span class="keyword">const</span> word64 *data);<a name="l00038"></a>00038         <span class="keywordtype">size_t</span> <a class="code" href="class_v_m_a_c___base.html#96ba11b27cf4af3b267c0aed35d9f0e4">HashMultipleBlocks</a>(<span class="keyword">const</span> word64 *input, <span class="keywordtype">size_t</span> length);<a name="l00039"></a><a class="code" href="class_v_m_a_c___base.html#48cd85f58172521a0a89d9a559c819d6">00039</a>         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#48cd85f58172521a0a89d9a559c819d6">Init</a>() {}<a name="l00040"></a><a class="code" href="class_v_m_a_c___base.html#373a706d63c989ddd2136dc0b535f483">00040</a>         word64* <a class="code" href="class_v_m_a_c___base.html#373a706d63c989ddd2136dc0b535f483">StateBuf</a>() {<span class="keywordflow">return</span> NULL;}<a name="l00041"></a><a class="code" href="class_v_m_a_c___base.html#0222829e9d634f7b59765dff0b02eebf">00041</a>         word64* <a class="code" href="class_v_m_a_c___base.html#0222829e9d634f7b59765dff0b02eebf">DataBuf</a>() {<span class="keywordflow">return</span> (word64 *)<a class="code" href="class_v_m_a_c___base.html#d3418eac61519aec8f052040558fca32">m_data</a>();}<a name="l00042"></a>00042 <a name="l00043"></a>00043         <span class="keywordtype">void</span> VHASH_Update_SSE2(<span class="keyword">const</span> word64 *data, <span class="keywordtype">size_t</span> blocksRemainingInWord64, <span class="keywordtype">int</span> tagPart);<a name="l00044"></a>00044 <span class="preprocessor">#if !(defined(_MSC_VER) &amp;&amp; _MSC_VER &lt; 1300)             // can't use function template here with VC6</span><a name="l00045"></a>00045 <span class="preprocessor"></span>        <span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> T_128BitTag&gt;<a name="l00046"></a>00046 <span class="preprocessor">#endif</span><a name="l00047"></a>00047 <span class="preprocessor"></span>        <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#ee86826a7402cba3406a279c8973e454">VHASH_Update_Template</a>(<span class="keyword">const</span> word64 *data, <span class="keywordtype">size_t</span> blockRemainingInWord128);<a name="l00048"></a>00048         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#93787d81c3829e86a146f1b83604c16b">VHASH_Update</a>(<span class="keyword">const</span> word64 *data, <span class="keywordtype">size_t</span> blocksRemainingInWord128);<a name="l00049"></a>00049 <a name="l00050"></a><a class="code" href="class_v_m_a_c___base.html#4402ea236fc3f38e16952f0176a4e814">00050</a>         CRYPTOPP_BLOCK_1(polyState, word64, 4*(<a class="code" href="class_v_m_a_c___base.html#1da3fa5eb3c7e7346a4d2f4ff16c881b">m_is128</a>+1))<a name="l00051"></a><a class="code" href="class_v_m_a_c___base.html#26b4a9d15712a40dd9f0d1be6641cc04">00051</a>         CRYPTOPP_BLOCK_2(nhKey, word64, <a class="code" href="class_v_m_a_c___base.html#59b7e6dadc750dd324db269c8a5f59b9">m_L1KeyLength</a>/sizeof(word64) + 2*<a class="code" href="class_v_m_a_c___base.html#1da3fa5eb3c7e7346a4d2f4ff16c881b">m_is128</a>)<a name="l00052"></a><a class="code" href="class_v_m_a_c___base.html#0b7600f411b97d32cdf9c8056b274951">00052</a>         CRYPTOPP_BLOCK_3(data, byte, <a class="code" href="class_v_m_a_c___base.html#59b7e6dadc750dd324db269c8a5f59b9">m_L1KeyLength</a>)<a name="l00053"></a><a class="code" href="class_v_m_a_c___base.html#c2e620b097e9c837c0dad047846ebf62">00053</a>         CRYPTOPP_BLOCK_4(l3Key, word64, 2*(<a class="code" href="class_v_m_a_c___base.html#1da3fa5eb3c7e7346a4d2f4ff16c881b">m_is128</a>+1))<a name="l00054"></a><a class="code" href="class_v_m_a_c___base.html#867c79b2ee59338b6b19d4bcc266c10f">00054</a>         CRYPTOPP_BLOCK_5(nonce, byte, <a class="code" href="class_v_m_a_c___base.html#866c80e36ce0279f10329f261221249b" title="returns size of IVs used by this object">IVSize</a>())<a name="l00055"></a><a class="code" href="class_v_m_a_c___base.html#e1beb23690d49797b0992865426fe62b">00055</a>         CRYPTOPP_BLOCK_6(pad, byte, <a class="code" href="class_v_m_a_c___base.html#866c80e36ce0279f10329f261221249b" title="returns size of IVs used by this object">IVSize</a>())<a name="l00056"></a><a class="code" href="class_v_m_a_c___base.html#a7b56598051282b6062c032f55575f2b">00056</a>         CRYPTOPP_BLOCKS_END(6)<a name="l00057"></a>00057 <a name="l00058"></a><a class="code" href="class_v_m_a_c___base.html#02596234f2eb210428573f3062244a0d">00058</a>         <span class="keywordtype">bool</span> <a class="code" href="class_v_m_a_c___base.html#1da3fa5eb3c7e7346a4d2f4ff16c881b">m_is128</a>, <a class="code" href="class_v_m_a_c___base.html#02596234f2eb210428573f3062244a0d">m_padCached</a>, <a class="code" href="class_v_m_a_c___base.html#cee066bf89503f32699aba376c874fce">m_isFirstBlock</a>;<a name="l00059"></a><a class="code" href="class_v_m_a_c___base.html#59b7e6dadc750dd324db269c8a5f59b9">00059</a>         <span class="keywordtype">int</span> <a class="code" href="class_v_m_a_c___base.html#59b7e6dadc750dd324db269c8a5f59b9">m_L1KeyLength</a>;<a name="l00060"></a>00060 };<a name="l00061"></a>00061 <span class="comment"></span><a name="l00062"></a>00062 <span class="comment">/// &lt;a href="http://www.cryptolounge.org/wiki/VMAC"&gt;VMAC&lt;/a&gt;</span><a name="l00063"></a>00063 <span class="comment"></span>template &lt;class T_BlockCipher, <span class="keywordtype">int</span> T_DigestBitSize = 128&gt;<a name="l00064"></a><a class="code" href="class_v_m_a_c.html">00064</a> class <a class="code" href="class_v_m_a_c.html" title="VMAC">VMAC</a> : public <a class="code" href="class_simple_keying_interface_impl.html" title="_">SimpleKeyingInterfaceImpl</a>&lt;<a class="code" href="class_v_m_a_c___base.html" title=".">VMAC_Base</a>, <a class="code" href="class_same_key_length_as.html" title="support query of key length that's the same as another class">SameKeyLengthAs</a>&lt;T_BlockCipher, <a class="code" href="class_simple_keying_interface.html" title="keying interface for crypto algorithms that take byte strings as keys">SimpleKeyingInterface</a>::<a class="code" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6e1cc32e69fe4f385e54d9d482a2ab5a56">UNIQUE_IV</a>, T_BlockCipher::BLOCKSIZE&gt; &gt;<a name="l00065"></a>00065 {<a name="l00066"></a>00066 <span class="keyword">public</span>:<a name="l00067"></a><a class="code" href="class_v_m_a_c.html#3872b1b69989ed1d77f4e3495adef232">00067</a>         <span class="keyword">static</span> std::string StaticAlgorithmName() {<span class="keywordflow">return</span> std::string(<span class="stringliteral">"VMAC("</span>) + T_BlockCipher::StaticAlgorithmName() + <span class="stringliteral">")-"</span> + IntToString(T_DigestBitSize);}<a name="l00068"></a>00068 <a name="l00069"></a>00069 <span class="keyword">private</span>:<a name="l00070"></a>00070         <a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp; AccessCipher() {<span class="keywordflow">return</span> m_cipher;}<a name="l00071"></a>00071         <span class="keywordtype">int</span> DefaultDigestSize()<span class="keyword"> const </span>{<span class="keywordflow">return</span> T_DigestBitSize/8;}<a name="l00072"></a>00072         <span class="keyword">typename</span> T_BlockCipher::Encryption m_cipher;<a name="l00073"></a>00073 };<a name="l00074"></a>00074 <a name="l00075"></a>00075 NAMESPACE_END<a name="l00076"></a>00076 <a name="l00077"></a>00077 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:25 2007 for Crypto++ by&nbsp;<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>

⌨️ 快捷键说明

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