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

📄 vmac_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>Crypto++: vmac.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.2 --><div class="tabs">  <ul>    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>    <li><a href="namespaces.html"><span>Namespaces</span></a></li>    <li><a href="classes.html"><span>Classes</span></a></li>    <li class="current"><a href="files.html"><span>Files</span></a></li>  </ul></div><div class="tabs">  <ul>    <li><a href="files.html"><span>File&nbsp;List</span></a></li>    <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>  </ul></div><h1>vmac.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_VMAC_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_VMAC_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><a name="l00004"></a>00004 <span class="preprocessor">#include "iterhash.h"</span><a name="l00005"></a>00005 <span class="preprocessor">#include "seckey.h"</span><a name="l00006"></a>00006 <a name="l00007"></a>00007 NAMESPACE_BEGIN(CryptoPP)<a name="l00008"></a>00008 <a name="l00009"></a>00009 <span class="preprocessor">#define CRYPTOPP_BLOCK_1(n, t, s) t* m_##n() {return (t *)(m_aggregate+0);}     size_t SS1() {return       sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00010"></a>00010 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_2(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS1());} size_t SS2() {return SS1()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_3(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS2());} size_t SS3() {return SS2()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_4(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS3());} size_t SS4() {return SS3()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_5(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS4());} size_t SS5() {return SS4()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00014"></a>00014 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_6(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS5());} size_t SS6() {return SS5()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_7(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS6());} size_t SS7() {return SS6()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCK_8(n, t, s) t* m_##n() {return (t *)(m_aggregate+SS7());} size_t SS8() {return SS7()+sizeof(t)*(s);} size_t m_##n##Size() {return (s);}</span><a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_BLOCKS_END(i) size_t SST() {return SS##i();} void AllocateBlocks() {m_aggregate.New(SST());} AlignedSecByteBlock m_aggregate;</span><a name="l00018"></a>00018 <span class="preprocessor"></span><span class="comment"></span><a name="l00019"></a>00019 <span class="comment">/// .</span><a name="l00020"></a><a class="code" href="class_v_m_a_c___base.html">00020</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_v_m_a_c___base.html" title=".">VMAC_Base</a> : <span class="keyword">public</span> <a class="code" href="class_iterated_hash_base.html" title="_">IteratedHashBase</a>&lt;word64, MessageAuthenticationCode&gt;<a name="l00021"></a>00021 {<a name="l00022"></a>00022 <span class="keyword">public</span>:<a name="l00023"></a><a class="code" href="class_v_m_a_c___base.html#7841e62a2fb45594c971117a647f1c81">00023</a>         std::string <a class="code" href="class_v_m_a_c___base.html#7841e62a2fb45594c971117a647f1c81" title="returns name of this algorithm, not universally implemented yet">AlgorithmName</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> std::string(<span class="stringliteral">"VMAC("</span>) + <a class="code" href="class_v_m_a_c___base.html#7cfa67884a99f789c41d93bf08698a7f">GetCipher</a>().<a class="code" href="class_algorithm.html#4f31510a192d1121856efe8ad0a9b844" title="returns name of this algorithm, not universally implemented yet">AlgorithmName</a>() + <span class="stringliteral">")-"</span> + IntToString(<a class="code" href="class_v_m_a_c___base.html#de8dd31d4ca07f9668afc1ab9eb3ea55" title="size of the hash returned by Final()">DigestSize</a>()*8);}<a name="l00024"></a><a class="code" href="class_v_m_a_c___base.html#866c80e36ce0279f10329f261221249b">00024</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_v_m_a_c___base.html#866c80e36ce0279f10329f261221249b" title="returns size of IVs used by this object">IVSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_v_m_a_c___base.html#7cfa67884a99f789c41d93bf08698a7f">GetCipher</a>().<a class="code" href="class_block_transformation.html#4936bef4368804cf5cadab9eb6eb37e4" title="block size of the cipher in bytes">BlockSize</a>();}<a name="l00025"></a>00025         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#8ed277053f73f827953325aab5247cc7" title="resynchronize with an IV">Resynchronize</a>(<span class="keyword">const</span> byte *IV);<a name="l00026"></a>00026         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#bd5685ab3eaf6ec272f7e062c3194c6c" title="get a secure IV for the next message">GetNextIV</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, byte *IV);<a name="l00027"></a><a class="code" href="class_v_m_a_c___base.html#de8dd31d4ca07f9668afc1ab9eb3ea55">00027</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_v_m_a_c___base.html#de8dd31d4ca07f9668afc1ab9eb3ea55" title="size of the hash returned by Final()">DigestSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_v_m_a_c___base.html#1da3fa5eb3c7e7346a4d2f4ff16c881b">m_is128</a> ? 16 : 8;};<a name="l00028"></a>00028         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#af0954326492fcc6059ac4f1903f5f09">UncheckedSetKey</a>(<span class="keyword">const</span> byte *userKey, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> keylength, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &amp;params);<a name="l00029"></a>00029         <span class="keywordtype">void</span> <a class="code" href="class_v_m_a_c___base.html#3affbeda9ead9b9b1e93064acc44c858" title="truncated version of Final()">TruncatedFinal</a>(byte *mac, <span class="keywordtype">size_t</span> size);<a name="l00030"></a><a class="code" href="class_v_m_a_c___base.html#3787b7950bd0eefb4f4accafd969430a">00030</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_v_m_a_c___base.html#3787b7950bd0eefb4f4accafd969430a" title="block size of underlying compression function, or 0 if not block based">BlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_v_m_a_c___base.html#59b7e6dadc750dd324db269c8a5f59b9">m_L1KeyLength</a>;}<a name="l00031"></a><a class="code" href="class_v_m_a_c___base.html#e5db4b2e69eb36364c2e0bc6435bdac0">00031</a>         <a class="code" href="cryptlib_8h.html#aeb92d42f5a6e27b8ba19f18d69d142b">ByteOrder</a> <a class="code" href="class_v_m_a_c___base.html#e5db4b2e69eb36364c2e0bc6435bdac0">GetByteOrder</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="cryptlib_8h.html#aeb92d42f5a6e27b8ba19f18d69d142bccd5b3585bd07d6bdae383aa8271b9d2">LITTLE_ENDIAN_ORDER</a>;}

⌨️ 快捷键说明

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