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

📄 modes_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00199"></a>00199                 {<a class="code" href="class_cipher_mode_base.html#b6c63ae5b5521b462912b1bb2d766989">m_cipher</a>-&gt;<a class="code" href="class_block_transformation.html#9efa0ea24795a19d15c9aa0d7f134562" title="encrypt or decrypt multiple blocks, for bit-slicing implementations">ProcessAndXorMultipleBlocks</a>(inString, NULL, outString, numberOfBlocks);}<a name="l00200"></a><a class="code" href="class_e_c_b___one_way.html#c89be446e7123317c4a4c4ecb4effd9c">00200</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"ECB"</span>;}<a name="l00201"></a>00201 };<a name="l00202"></a>00202 <a name="l00203"></a><a class="code" href="class_c_b_c___mode_base.html">00203</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_ModeBase : <span class="keyword">public</span> BlockOrientedCipherModeBase<a name="l00204"></a>00204 {<a name="l00205"></a>00205 <span class="keyword">public</span>:<a name="l00206"></a><a class="code" href="class_c_b_c___mode_base.html#3e792aeeb087bde5258a676c3b157acf">00206</a>         <a class="code" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6e">IV_Requirement</a> <a class="code" href="class_cipher_mode_base.html#a46eb377a83a479ee66ea044f845bf50" title="returns the minimal requirement for secure IVs">IVRequirement</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6eceff3ad4b12bcb6d7b61a5bd543a815c">UNPREDICTABLE_RANDOM_IV</a>;}<a name="l00207"></a><a class="code" href="class_c_b_c___mode_base.html#5afa761a6188f939aace9443096236a6">00207</a>         <span class="keywordtype">bool</span> RequireAlignedInput()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">false</span>;}<a name="l00208"></a><a class="code" href="class_c_b_c___mode_base.html#43530a8977b63abdf11d35f971b29f30">00208</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_stream_transformation.html#0b7c5bc41b9b5f6443ee32d65ebc044c" title="returns the minimum size of the last block, 0 indicating the last block is not special...">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 0;}<a name="l00209"></a><a class="code" href="class_c_b_c___mode_base.html#e06f236a38713453dc9360ea46b2bedc">00209</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CBC"</span>;}<a name="l00210"></a>00210 };<a name="l00211"></a>00211 <a name="l00212"></a><a class="code" href="class_c_b_c___encryption.html">00212</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Encryption : <span class="keyword">public</span> CBC_ModeBase<a name="l00213"></a>00213 {<a name="l00214"></a>00214 <span class="keyword">public</span>:<a name="l00215"></a>00215         <span class="keywordtype">void</span> ProcessBlocks(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> numberOfBlocks);<a name="l00216"></a>00216 };<a name="l00217"></a>00217 <a name="l00218"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html">00218</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Encryption : <span class="keyword">public</span> CBC_Encryption<a name="l00219"></a>00219 {<a name="l00220"></a>00220 <span class="keyword">public</span>:<a name="l00221"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#447be2f4df793a07257b18137344279c">00221</a>         <span class="keywordtype">void</span> SetStolenIV(byte *iv) {m_stolenIV = iv;}<a name="l00222"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#6f5fb8fb6c49bcaa75c923c38bd0ccbd">00222</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_stream_transformation.html#0b7c5bc41b9b5f6443ee32d65ebc044c" title="returns the minimum size of the last block, 0 indicating the last block is not special...">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_cipher_mode_base.html#6d0a5b8deef965aa690441541c5a7aa7">BlockSize</a>()+1;}<a name="l00223"></a>00223         <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#0668b78edaea082f87bf3e878c4c02f7" title="for ciphers where the last block of data is special, encrypt or decrypt the last...">ProcessLastBlock</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00224"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#1125169217e877c502ed7aa5f88cd437">00224</a>         <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> * CRYPTOPP_API StaticAlgorithmName() {<span class="keywordflow">return</span> <span class="stringliteral">"CBC/CTS"</span>;}<a name="l00225"></a>00225 <a name="l00226"></a>00226 <span class="keyword">protected</span>:<a name="l00227"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#e4bbc33978a096b417810ae266d5ed01">00227</a>         <span class="keywordtype">void</span> UncheckedSetKey(<span class="keyword">const</span> byte *key, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length, <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="l00228"></a>00228         {<a name="l00229"></a>00229                 <a class="code" href="class_block_oriented_cipher_mode_base.html#1d095f1ee08abb9f03f0ed16a32c6b04">CBC_Encryption::UncheckedSetKey</a>(key, length, params);<a name="l00230"></a>00230                 m_stolenIV = params.<a class="code" href="class_name_value_pairs.html#943b2009297783f1c35bae46efc3b5f7" title="get a named value, returns the default if the name doesn't exist">GetValueWithDefault</a>(<a class="code" href="namespace_name.html#a102d92107376dd3fafe1788b2c42b13" title="byte *">Name::StolenIV</a>(), (byte *)NULL);<a name="l00231"></a>00231         }<a name="l00232"></a>00232 <a name="l00233"></a><a class="code" href="class_c_b_c___c_t_s___encryption.html#1e5e3194957afd90092b1f49257374d3">00233</a>         byte *m_stolenIV;<a name="l00234"></a>00234 };<a name="l00235"></a>00235 <a name="l00236"></a><a class="code" href="class_c_b_c___decryption.html">00236</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_Decryption : <span class="keyword">public</span> CBC_ModeBase<a name="l00237"></a>00237 {<a name="l00238"></a>00238 <span class="keyword">public</span>:<a name="l00239"></a>00239         <span class="keywordtype">void</span> ProcessBlocks(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> numberOfBlocks);<a name="l00240"></a>00240         <a name="l00241"></a>00241 <span class="keyword">protected</span>:<a name="l00242"></a><a class="code" href="class_c_b_c___decryption.html#90b463493ef297c3cae73b709b6980df">00242</a>         <span class="keywordtype">void</span> <a class="code" href="class_cipher_mode_base.html#8c864c16ce0eb014699c0a61adcc6836">ResizeBuffers</a>()<a name="l00243"></a>00243         {<a name="l00244"></a>00244                 <a class="code" href="class_block_oriented_cipher_mode_base.html#4e567f03f82e6108065a1316de50e1cf">BlockOrientedCipherModeBase::ResizeBuffers</a>();<a name="l00245"></a>00245                 m_temp.New(<a class="code" href="class_cipher_mode_base.html#6d0a5b8deef965aa690441541c5a7aa7">BlockSize</a>());<a name="l00246"></a>00246         }<a name="l00247"></a><a class="code" href="class_c_b_c___decryption.html#e26eb3eb2b8fed3c1ffad582a37a48da">00247</a>         <a class="code" href="class_sec_block.html" title="a block of memory allocated using A">SecByteBlock</a> m_temp;<a name="l00248"></a>00248 };<a name="l00249"></a>00249 <a name="l00250"></a><a class="code" href="class_c_b_c___c_t_s___decryption.html">00250</a> <span class="keyword">class </span>CRYPTOPP_DLL CRYPTOPP_NO_VTABLE CBC_CTS_Decryption : <span class="keyword">public</span> CBC_Decryption<a name="l00251"></a>00251 {<a name="l00252"></a>00252 <span class="keyword">public</span>:<a name="l00253"></a><a class="code" href="class_c_b_c___c_t_s___decryption.html#f00303e9a4d770c22b5f5a7553f51c3f">00253</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_stream_transformation.html#0b7c5bc41b9b5f6443ee32d65ebc044c" title="returns the minimum size of the last block, 0 indicating the last block is not special...">MinLastBlockSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="class_cipher_mode_base.html#6d0a5b8deef965aa690441541c5a7aa7">BlockSize</a>()+1;}<a name="l00254"></a>00254         <span class="keywordtype">void</span> <a class="code" href="class_stream_transformation.html#0668b78edaea082f87bf3e878c4c02f7" title="for ciphers where the last block of data is special, encrypt or decrypt the last...">ProcessLastBlock</a>(byte *outString, <span class="keyword">const</span> byte *inString, <span class="keywordtype">size_t</span> length);<a name="l00255"></a>00255 };<a name="l00256"></a>00256 <span class="comment"></span><a name="l00257"></a>00257 <span class="comment">//! _</span><a name="l00258"></a>00258 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> CIPHER, <span class="keyword">class</span> BASE&gt;<a name="l00259"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html">00259</a> <span class="keyword">class </span><a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a> : <span class="keyword">protected</span> <a class="code" href="class_object_holder.html">ObjectHolder</a>&lt;CIPHER&gt;, <span class="keyword">public</span> <a class="code" href="class_algorithm_impl.html" title="_">AlgorithmImpl</a>&lt;BASE, CipherModeFinalTemplate_CipherHolder&lt;CIPHER, BASE&gt; &gt;<a name="l00260"></a>00260 {<a name="l00261"></a>00261 <span class="keyword">public</span>:<a name="l00262"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html#bcf55eed14bb7773a319678ae8bae74a">00262</a>         <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>()<a name="l00263"></a>00263         {<a name="l00264"></a>00264                 this-&gt;<a class="code" href="class_cipher_mode_base.html#b6c63ae5b5521b462912b1bb2d766989">m_cipher</a> = &amp;this-&gt;m_object;<a name="l00265"></a>00265                 this-&gt;<a class="code" href="class_cipher_mode_base.html#8c864c16ce0eb014699c0a61adcc6836">ResizeBuffers</a>();<a name="l00266"></a>00266         }<a name="l00267"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html#d36933370beefddbe77cebde2773f459">00267</a>         <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder</a>(<span class="keyword">const</span> byte *key, <span class="keywordtype">size_t</span> length)<a name="l00268"></a>00268         {<a name="l00269"></a>00269                 this-&gt;<a class="code" href="class_cipher_mode_base.html#b6c63ae5b5521b462912b1bb2d766989">m_cipher</a> = &amp;this-&gt;m_object;<a name="l00270"></a>00270                 this-&gt;<a class="code" href="class_simple_keying_interface.html#df3c29b3ef3af74788a58c7c49887fd7" title="set or reset the key of this object">SetKey</a>(key, length);<a name="l00271"></a>00271         }

⌨️ 快捷键说明

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