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

📄 filters_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00247"></a>00247 <span class="keyword">protected</span>:<a name="l00248"></a>00248         <span class="keyword">virtual</span> <span class="keywordtype">bool</span> IsolatedMessageEnd(<span class="keywordtype">bool</span> blocking) =0;<a name="l00249"></a><a class="code" href="class_filter_with_input_queue.html#94b46e509ab5cb9dbd676c41ea346107">00249</a>         <span class="keywordtype">void</span> <a class="code" href="class_buffered_transformation.html#7bb05ac3b6302e2ab994586d526fa804">IsolatedInitialize</a>(<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;parameters) {m_inQueue.Clear();}<a name="l00250"></a>00250 <a name="l00251"></a><a class="code" href="class_filter_with_input_queue.html#b55f3464c5a802e5504dd39569f5bd7c">00251</a>         <a class="code" href="class_byte_queue.html" title="Byte Queue.">ByteQueue</a> m_inQueue;<a name="l00252"></a>00252 };<a name="l00253"></a>00253 <span class="comment"></span><a name="l00254"></a>00254 <span class="comment">//! Filter Wrapper for StreamTransformation</span><a name="l00255"></a><a class="code" href="class_stream_transformation_filter.html">00255</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL StreamTransformationFilter : <span class="keyword">public</span> FilterWithBufferedInput, <span class="keyword">private</span> <a class="code" href="struct_filter_put_space_helper.html">FilterPutSpaceHelper</a><a name="l00256"></a>00256 {<a name="l00257"></a>00257 <span class="keyword">public</span>:<a name="l00258"></a><a class="code" href="class_stream_transformation_filter.html#0a08a5d90e124cde39850d544cf32e840c4ef146753b51a6a6a9fdd533b341f9">00258</a>         <span class="keyword">enum</span> <a class="code" href="class_stream_transformation_filter.html#0a08a5d90e124cde39850d544cf32e84">BlockPaddingScheme</a> {NO_PADDING, ZEROS_PADDING, PKCS_PADDING, ONE_AND_ZEROS_PADDING, DEFAULT_PADDING};<span class="comment"></span><a name="l00259"></a>00259 <span class="comment">        /*! DEFAULT_PADDING means PKCS_PADDING if c.MandatoryBlockSize() &gt; 1 &amp;&amp; c.MinLastBlockSize() == 0 (e.g. ECB or CBC mode),</span><a name="l00260"></a>00260 <span class="comment">                otherwise NO_PADDING (OFB, CFB, CTR, CBC-CTS modes) */</span><a name="l00261"></a>00261         StreamTransformationFilter(<a class="code" href="class_stream_transformation.html" title="interface for the data processing part of stream ciphers">StreamTransformation</a> &amp;c, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> *attachment = NULL, BlockPaddingScheme padding = DEFAULT_PADDING);<a name="l00262"></a>00262 <a name="l00263"></a>00263         <span class="keywordtype">void</span> FirstPut(<span class="keyword">const</span> byte *inString);<a name="l00264"></a>00264         <span class="keywordtype">void</span> <a class="code" href="class_filter_with_buffered_input.html#0e49fdd45ab18631d9f0c2e5aba3dc0f">NextPutMultiple</a>(<span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00265"></a>00265         <span class="keywordtype">void</span> <a class="code" href="class_filter_with_buffered_input.html#3176a4422a073fa15ed7807f781704b4">NextPutModifiable</a>(byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00266"></a>00266         <span class="keywordtype">void</span> LastPut(<span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00267"></a>00267 <span class="comment">//      byte * CreatePutSpace(size_t &amp;size);</span><a name="l00268"></a>00268 <a name="l00269"></a>00269 <span class="keyword">protected</span>:<a name="l00270"></a>00270         <span class="keyword">static</span> <span class="keywordtype">size_t</span> LastBlockSize(<a class="code" href="class_stream_transformation.html" title="interface for the data processing part of stream ciphers">StreamTransformation</a> &amp;c, BlockPaddingScheme padding);<a name="l00271"></a>00271 <a name="l00272"></a><a class="code" href="class_stream_transformation_filter.html#e29d446f8a75e0d86483e28b4d48021d">00272</a>         <a class="code" href="class_stream_transformation.html" title="interface for the data processing part of stream ciphers">StreamTransformation</a> &amp;m_cipher;<a name="l00273"></a><a class="code" href="class_stream_transformation_filter.html#9af2b2a032d335611f278178593ff843">00273</a>         <a class="code" href="class_stream_transformation_filter.html#0a08a5d90e124cde39850d544cf32e84">BlockPaddingScheme</a> m_padding;<a name="l00274"></a><a class="code" href="class_stream_transformation_filter.html#16ac42cef5fd5dded59626deed2b52b1">00274</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_optimalBufferSize;<a name="l00275"></a>00275 };<a name="l00276"></a>00276 <a name="l00277"></a>00277 <span class="preprocessor">#ifdef CRYPTOPP_MAINTAIN_BACKWARDS_COMPATIBILITY</span><a name="l00278"></a>00278 <span class="preprocessor"></span><span class="keyword">typedef</span> StreamTransformationFilter StreamCipherFilter;<a name="l00279"></a>00279 <span class="preprocessor">#endif</span><a name="l00280"></a>00280 <span class="preprocessor"></span><span class="comment"></span><a name="l00281"></a>00281 <span class="comment">//! Filter Wrapper for HashTransformation</span><a name="l00282"></a><a class="code" href="class_hash_filter.html">00282</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL HashFilter : <span class="keyword">public</span> <a class="code" href="class_bufferless.html" title="_">Bufferless</a>&lt;Filter&gt;, <span class="keyword">private</span> <a class="code" href="struct_filter_put_space_helper.html">FilterPutSpaceHelper</a><a name="l00283"></a>00283 {<a name="l00284"></a>00284 <span class="keyword">public</span>:<a name="l00285"></a><a class="code" href="class_hash_filter.html#9c8bb1cc76809ada1a9264932829a165">00285</a>         HashFilter(<a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;hm, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> *attachment = NULL, <span class="keywordtype">bool</span> putMessage=<span class="keyword">false</span>, <span class="keywordtype">int</span> truncatedDigestSize=-1)<a name="l00286"></a>00286                 : m_hashModule(hm), m_putMessage(putMessage), m_truncatedDigestSize(truncatedDigestSize) {Detach(attachment);}<a name="l00287"></a>00287 <a name="l00288"></a><a class="code" href="class_hash_filter.html#8ddeda93399d4767574798eb555bd5ea">00288</a>         std::string AlgorithmName()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_hashModule.AlgorithmName();}<a name="l00289"></a>00289 <a name="l00290"></a>00290         <span class="keywordtype">void</span> IsolatedInitialize(<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;parameters);<a name="l00291"></a>00291         <span class="keywordtype">size_t</span> Put2(<span class="keyword">const</span> byte *begin, <span class="keywordtype">size_t</span> length, <span class="keywordtype">int</span> messageEnd, <span class="keywordtype">bool</span> blocking);<a name="l00292"></a>00292 <a name="l00293"></a><a class="code" href="class_hash_filter.html#5c2f3a90ced66c835969ce1aa235b63e">00293</a>         byte * CreatePutSpace(<span class="keywordtype">size_t</span> &amp;size) {<span class="keywordflow">return</span> m_hashModule.CreateUpdateSpace(size);}<a name="l00294"></a>00294 <a name="l00295"></a>00295 <span class="keyword">private</span>:<a name="l00296"></a>00296         <a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;m_hashModule;<a name="l00297"></a>00297         <span class="keywordtype">bool</span> m_putMessage;<a name="l00298"></a>00298         <span class="keywordtype">int</span> m_truncatedDigestSize;<a name="l00299"></a>00299         byte *m_space;<a name="l00300"></a>00300         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> m_digestSize;<a name="l00301"></a>00301 };<a name="l00302"></a>00302 <span class="comment"></span><a name="l00303"></a>00303 <span class="comment">//! Filter Wrapper for HashTransformation</span><a name="l00304"></a><a class="code" href="class_hash_verification_filter.html">00304</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL HashVerificationFilter : <span class="keyword">public</span> FilterWithBufferedInput<a name="l00305"></a>00305 {<a name="l00306"></a>00306 <span class="keyword">public</span>:<a name="l00307"></a><a class="code" href="class_hash_verification_filter_1_1_hash_verification_failed.html">00307</a>         <span class="keyword">class </span><a class="code" href="class_hash_verification_filter_1_1_hash_verification_failed.html">HashVerificationFailed</a> : <span class="keyword">public</span> <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a><a name="l00308"></a>00308         {<a name="l00309"></a>00309         <span class="keyword">public</span>:<a name="l00310"></a><a class="code" href="class_hash_verification_filter_1_1_hash_verification_failed.html#20539574e0760659c78753fa34dfedc8">00310</a>                 <a class="code" href="class_hash_verification_filter_1_1_hash_verification_failed.html">HashVerificationFailed</a>()<a name="l00311"></a>00311                         : <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a>(DATA_INTEGRITY_CHECK_FAILED, <span class="stringliteral">"HashVerifier: message hash not valid"</span>) {}<a name="l00312"></a>00312         };<a name="l00313"></a>00313 <a name="l00314"></a><a class="code" href="class_hash_verification_filter.html#4e171785f3f9b00d0a10f4c2afa1cc7056c0daa4f424032c82a53d8dcdf78c55">00314</a>         <span class="keyword">enum</span> <a class="code" href="class_hash_verification_filter.html#4e171785f3f9b00d0a10f4c2afa1cc70">Flags</a> {HASH_AT_BEGIN=1, PUT_MESSAGE=2, PUT_HASH=4, PUT_RESULT=8, THROW_EXCEPTION=16, DEFAULT_FLAGS = HASH_AT_BEGIN | PUT_RESULT};<a name="l00315"></a>00315         HashVerificationFilter(<a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;hm, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> *attachment = NULL, word32 flags = DEFAULT_FLAGS);<a name="l00316"></a>00316 <a name="l00317"></a><a class="code" href="class_hash_verification_filter.html#63841de72c6930234941a89c4989de13">00317</a>         std::string <a class="code" href="class_algorithm.html#4f31510a192d1121856efe8ad0a9b844" title="returns name of this algorithm, not universally implemented yet">AlgorithmName</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_hashModule.AlgorithmName();}<a name="l00318"></a>00318 <a name="l00319"></a><a class="code" href="class_hash_verification_filter.html#2145cdd7d14c8305fa784dc4622f8ad1">00319</a>         <span class="keywordtype">bool</span> GetLastResult()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_verified;}<a name="l00320"></a>00320 <a name="l00321"></a>00321 <span class="keyword">protected</span>:<a name="l00322"></a>00322         <span class="keywordtype">void</span> <a class="code" href="class_filter_with_buffered_input.html#5fba4d91d6349ecf1036c1aeb21d5e96">InitializeDerivedAndReturnNewSizes</a>(<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;parameters, <span class="keywordtype">size_t</span> &amp;firstSize, <span class="keywordtype">size_t</span> &amp;blockSize, <span class="keywordtype">size_t</span> &amp;lastSize);<a name="l00323"></a>00323         <span class="keywordtype">void</span> FirstPut(<span class="keyword">const</span> byte *inString);<a name="l00324"></a>00324         <span class="keywordtype">void</span> <a class="code" href="class_filter_with_buffered_input.html#0e49fdd45ab18631d9f0c2e5aba3dc0f">NextPutMultiple</a>(<span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00325"></a>00325         <span class="keywordtype">void</span> LastPut(<span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00326"></a>00326 <a name="l00327"></a>00327 <span class="keyword">private</span>:<a name="l00328"></a>00328         <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> FirstSize(word32 flags, <a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;hm) {<span class="keywordflow">return</span> flags &amp; HASH_AT_BEGIN ? hm.<a class="code" href="class_hash_transformation.html#41faf8b1293a6c72390cb0c8bd668097" title="size of the hash returned by Final()">DigestSize</a>() : 0;}<a name="l00329"></a>00329         <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> LastSize(word32 flags, <a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;hm) {<span class="keywordflow">return</span> flags &amp; HASH_AT_BEGIN ? 0 : hm.<a class="code" href="class_hash_transformation.html#41faf8b1293a6c72390cb0c8bd668097" title="size of the hash returned by Final()">DigestSize</a>();}<a name="l00330"></a>00330 <a name="l00331"></a>00331         <a class="code" href="class_hash_transformation.html" title="interface for hash functions and data processing part of MACs">HashTransformation</a> &amp;m_hashModule;<a name="l00332"></a>00332         word32 m_flags;<a name="l00333"></a>00333         <a class="code" href="class_sec_block.html" title="a block of memory allocated using A">SecByteBlock</a> m_expectedHash;<a name="l00334"></a>00334         <span class="keywordtype">bool</span> m_verified;<a name="l00335"></a>00335 };

⌨️ 快捷键说明

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