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

📄 modes_8h-source.html

📁 著名的密码库Crypto++的文档 C++语言的杰作。程序员必备。
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="l00272"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html#dca35551dece6668f53e28b8f7ff2681">00272</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, <span class="keyword">const</span> byte *iv)<a name="l00273"></a>00273         {<a name="l00274"></a>00274                 this-&gt;<a class="code" href="class_cipher_mode_base.html#b6c63ae5b5521b462912b1bb2d766989">m_cipher</a> = &amp;this-&gt;m_object;<a name="l00275"></a>00275                 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, MakeParameters(<a class="code" href="namespace_name.html#9b6839240a8bdf1f5bcbebf1866f4733" title="const byte *">Name::IV</a>(), iv));<a name="l00276"></a>00276         }<a name="l00277"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html#1bcfa067b69be65ab13014015b21dfa0">00277</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, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize)<a name="l00278"></a>00278         {<a name="l00279"></a>00279                 this-&gt;<a class="code" href="class_cipher_mode_base.html#b6c63ae5b5521b462912b1bb2d766989">m_cipher</a> = &amp;this-&gt;m_object;<a name="l00280"></a>00280                 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, MakeParameters(<a class="code" href="namespace_name.html#9b6839240a8bdf1f5bcbebf1866f4733" title="const byte *">Name::IV</a>(), iv)(<a class="code" href="namespace_name.html#62c578a9a83ca83029cd1ce38431989d" title="int">Name::FeedbackSize</a>(), feedbackSize));<a name="l00281"></a>00281         }<a name="l00282"></a>00282 <a name="l00283"></a><a class="code" href="class_cipher_mode_final_template___cipher_holder.html#9cf5a3de7d56cb2072b0553807d8075b">00283</a>         <span class="keyword">static</span> std::string CRYPTOPP_API StaticAlgorithmName()<a name="l00284"></a>00284                 {<span class="keywordflow">return</span> CIPHER::StaticAlgorithmName() + <span class="stringliteral">"/"</span> + BASE::StaticAlgorithmName();}<a name="l00285"></a>00285 };<a name="l00286"></a>00286 <span class="comment"></span><a name="l00287"></a>00287 <span class="comment">//! _</span><a name="l00288"></a>00288 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> BASE&gt;<a name="l00289"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html">00289</a> <span class="keyword">class </span><a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a> : <span class="keyword">public</span> BASE<a name="l00290"></a>00290 {<a name="l00291"></a>00291 <span class="keyword">public</span>:<a name="l00292"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html#4a35c15c4213c22322256c9ea5656df2">00292</a>         <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>() {}<a name="l00293"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html#b183bb3665c750c4555c3d9c8ef9f914">00293</a>         <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher)<a name="l00294"></a>00294                 {SetCipher(cipher);}<a name="l00295"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html#ce2b0390490ab02a18e28d26b1852416">00295</a>         <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize = 0)<a name="l00296"></a>00296                 {SetCipherWithIV(cipher, iv, feedbackSize);}<a name="l00297"></a>00297 <a name="l00298"></a>00298         <span class="keywordtype">void</span> SetCipher(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher);<a name="l00299"></a>00299         <span class="keywordtype">void</span> SetCipherWithIV(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize = 0);<a name="l00300"></a>00300 };<a name="l00301"></a>00301 <a name="l00302"></a>00302 <span class="keyword">template</span> &lt;<span class="keyword">class</span> BASE&gt;<a name="l00303"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html#64bdbfe5f9de1bc729582e6a1e25ec41">00303</a> <span class="keywordtype">void</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html#64bdbfe5f9de1bc729582e6a1e25ec41">CipherModeFinalTemplate_ExternalCipher&lt;BASE&gt;::SetCipher</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher)<a name="l00304"></a>00304 {<a name="l00305"></a>00305         this-&gt;ThrowIfResynchronizable();<a name="l00306"></a>00306         this-&gt;m_cipher = &amp;cipher;<a name="l00307"></a>00307         this-&gt;ResizeBuffers();<a name="l00308"></a>00308 }<a name="l00309"></a>00309 <a name="l00310"></a>00310 <span class="keyword">template</span> &lt;<span class="keyword">class</span> BASE&gt;<a name="l00311"></a><a class="code" href="class_cipher_mode_final_template___external_cipher.html#d117280e0508907c34bdae84e7816fe6">00311</a> <span class="keywordtype">void</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html#d117280e0508907c34bdae84e7816fe6">CipherModeFinalTemplate_ExternalCipher&lt;BASE&gt;::SetCipherWithIV</a>(<a class="code" href="class_block_cipher.html" title="interface for one direction (encryption or decryption) of a block cipher">BlockCipher</a> &amp;cipher, <span class="keyword">const</span> byte *iv, <span class="keywordtype">int</span> feedbackSize)<a name="l00312"></a>00312 {<a name="l00313"></a>00313         this-&gt;ThrowIfInvalidIV(iv);<a name="l00314"></a>00314         this-&gt;m_cipher = &amp;cipher;<a name="l00315"></a>00315         this-&gt;ResizeBuffers();<a name="l00316"></a>00316         this-&gt;SetFeedbackSize(feedbackSize);<a name="l00317"></a>00317         <span class="keywordflow">if</span> (this-&gt;IsResynchronizable())<a name="l00318"></a>00318                 this-&gt;Resynchronize(iv);<a name="l00319"></a>00319 }<a name="l00320"></a>00320 <a name="l00321"></a>00321 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___cipher_template.html">CFB_CipherTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt;;<a name="l00322"></a>00322 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___encryption_template.html">CFB_EncryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt;;<a name="l00323"></a>00323 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_c_f_b___decryption_template.html">CFB_DecryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt;;<a name="l00324"></a>00324 <span class="comment"></span><a name="l00325"></a>00325 <span class="comment">//! CFB mode</span><a name="l00326"></a>00326 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> CIPHER&gt;<a name="l00327"></a><a class="code" href="struct_c_f_b___mode.html">00327</a> <span class="keyword">struct </span><a class="code" href="struct_c_f_b___mode.html" title="CFB mode.">CFB_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher mode documentation. See NIST SP 800-38A for definitions of these modes.">CipherModeDocumentation</a><a name="l00328"></a>00328 {<a name="l00329"></a><a class="code" href="struct_c_f_b___mode.html#4a74a3c2de19570ba002d634feed6e89">00329</a>         <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder&lt;CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder&lt;Empty, CFB_EncryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt; &gt; &gt; <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">Encryption</a>;<a name="l00330"></a><a class="code" href="struct_c_f_b___mode.html#5d18795dd56bf1330ce02c0415b37353">00330</a>         <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder&lt;CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder&lt;Empty, CFB_DecryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt; &gt; &gt; <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">Decryption</a>;<a name="l00331"></a>00331 };<a name="l00332"></a>00332 <span class="comment"></span><a name="l00333"></a>00333 <span class="comment">//! CFB mode, external cipher</span><a name="l00334"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html">00334</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_c_f_b___mode___external_cipher.html" title="CFB mode, external cipher.">CFB_Mode_ExternalCipher</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher mode documentation. See NIST SP 800-38A for definitions of these modes.">CipherModeDocumentation</a><a name="l00335"></a>00335 {<a name="l00336"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html#7813692f6a4c0af1ef2eeeccf0c0d1aa">00336</a>         <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher&lt;ConcretePolicyHolder&lt;Empty, CFB_EncryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt; &gt; &gt; <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">Encryption</a>;<a name="l00337"></a><a class="code" href="struct_c_f_b___mode___external_cipher.html#3eaabeb1e794d26b41ddaba2423fa85e">00337</a>         <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">CipherModeFinalTemplate_ExternalCipher&lt;ConcretePolicyHolder&lt;Empty, CFB_DecryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt; &gt; &gt; <a class="code" href="class_cipher_mode_final_template___external_cipher.html" title="_">Decryption</a>;<a name="l00338"></a>00338 };<a name="l00339"></a>00339 <span class="comment"></span><a name="l00340"></a>00340 <span class="comment">//! CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A</span><a name="l00341"></a>00341 <span class="comment"></span><span class="keyword">template</span> &lt;<span class="keyword">class</span> CIPHER&gt;<a name="l00342"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode.html">00342</a> <span class="keyword">struct </span><a class="code" href="struct_c_f_b___f_i_p_s___mode.html" title="CFB mode FIPS variant, requiring full block plaintext according to FIPS 800-38A.">CFB_FIPS_Mode</a> : <span class="keyword">public</span> <a class="code" href="struct_cipher_mode_documentation.html" title="Cipher mode documentation. See NIST SP 800-38A for definitions of these modes.">CipherModeDocumentation</a><a name="l00343"></a>00343 {<a name="l00344"></a><a class="code" href="struct_c_f_b___f_i_p_s___mode.html#bc5d8acb64d528f1a5c5ad71f0f5165f">00344</a>         <span class="keyword">typedef</span> <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_">CipherModeFinalTemplate_CipherHolder&lt;CPP_TYPENAME CIPHER::Encryption, ConcretePolicyHolder&lt;Empty, CFB_RequireFullDataBlocks&lt;CFB_EncryptionTemplate&lt;AbstractPolicyHolder&lt;CFB_CipherAbstractPolicy, CFB_ModePolicy&gt;</a> &gt; &gt; &gt; &gt; <a class="code" href="class_cipher_mode_final_template___cipher_holder.html" title="_"

⌨️ 快捷键说明

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