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

📄 class_block_cipher.html

📁 Crypto++是一个非常强大的密码学库,主要是功能全
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: BlockCipher class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><h1>BlockCipher Class Reference</h1><code>#include &lt;<a class="el" href="cryptlib_8h-source.html">cryptlib.h</a>&gt;</code><p><p>Inheritance diagram for BlockCipher:<p><center><img src="class_block_cipher.png" usemap="#BlockCipher_map" border="0" alt=""></center><map name="BlockCipher_map"><area href="class_block_transformation.html" alt="BlockTransformation" shape="rect" coords="0,112,366,136"><area href="class_simple_keying_interface.html" alt="SimpleKeyingInterface" shape="rect" coords="376,112,742,136"><area href="class_algorithm.html" alt="Algorithm" shape="rect" coords="0,56,366,80"><area href="class_clonable.html" alt="Clonable" shape="rect" coords="0,0,366,24"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Blowfish_Info >" shape="rect" coords="564,280,930,304"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, CAST128_Info >" shape="rect" coords="564,336,930,360"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, CAST256_Info >" shape="rect" coords="564,392,930,416"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_EDE2_Info >" shape="rect" coords="564,448,930,472"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_EDE3_Info >" shape="rect" coords="564,504,930,528"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_Info >" shape="rect" coords="564,560,930,584"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_XEX3_Info >" shape="rect" coords="564,616,930,640"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Diamond2_Info >" shape="rect" coords="564,672,930,696"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Diamond2Lite_Info >" shape="rect" coords="564,728,930,752"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, GOST_Info >" shape="rect" coords="564,784,930,808"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, IDEA_Info >" shape="rect" coords="564,840,930,864"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, LR_Info< T > >" shape="rect" coords="564,896,930,920"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, MARS_Info >" shape="rect" coords="564,952,930,976"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, MDC_Info< T > >" shape="rect" coords="564,1008,930,1032"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC2_Info >" shape="rect" coords="564,1064,930,1088"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC5_Info >" shape="rect" coords="564,1120,930,1144"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC6_Info >" shape="rect" coords="564,1176,930,1200"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Rijndael_Info >" shape="rect" coords="564,1232,930,1256"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Serpent_Info >" shape="rect" coords="564,1288,930,1312"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, SHARK_Info >" shape="rect" coords="564,1344,930,1368"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, SKIPJACK_Info >" shape="rect" coords="564,1400,930,1424"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Square_Info >" shape="rect" coords="564,1456,930,1480"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, TEA_Info >" shape="rect" coords="564,1512,930,1536"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, ThreeWay_Info >" shape="rect" coords="564,1568,930,1592"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Twofish_Info >" shape="rect" coords="564,1624,930,1648"></map><a href="class_block_cipher-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>These objects usually should not be used directly. See <a class="el" href="class_block_transformation.html">BlockTransformation</a> for more details. <p><p>Definition at line <a class="el" href="cryptlib_8h-source.html#l00587">587</a> of file <a class="el" href="cryptlib_8h-source.html">cryptlib.h</a>.<table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Types</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><b>IV_Requirement</b> { <br>&nbsp;&nbsp;<b>STRUCTURED_IV</b> =  0, <b>RANDOM_IV</b>, <b>UNPREDICTABLE_RANDOM_IV</b>, <b>INTERNALLY_GENERATED_IV</b>, <br>&nbsp;&nbsp;<b>NOT_RESYNCHRONIZABLE</b><br> }</td></tr><tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_basea8" doxytag="BlockCipher::ProcessAndXorBlock"></a>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_basea8">ProcessAndXorBlock</a> (const byte *inBlock, const byte *xorBlock, byte *outBlock) const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">encrypt or decrypt inBlock, xor with xorBlock, and write to outBlock <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca9">ProcessBlock</a> (const byte *inBlock, byte *outBlock) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">encrypt or decrypt one block </em> <a href="#_twofish_1_1_enca9"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca10" doxytag="BlockCipher::ProcessBlock"></a>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca10">ProcessBlock</a> (byte *inoutBlock) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">encrypt or decrypt one block in place <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_simple_keying_interface_impl_3_01_s_a_f_e_r_1_1_enc_00_01_s_a_f_e_r___s_k___info_01_4a10" doxytag="BlockCipher::BlockSize"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_simple_keying_interface_impl_3_01_s_a_f_e_r_1_1_enc_00_01_s_a_f_e_r___s_k___info_01_4a10">BlockSize</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">block size of the cipher in bytes <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca11" doxytag="BlockCipher::BlockAlignment"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca11">BlockAlignment</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">block pointers must be divisible by this <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca12" doxytag="BlockCipher::IsPermutation"></a>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca12">IsPermutation</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns true if this is a permutation (i.e. there is an inverse transformation) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca13" doxytag="BlockCipher::IsForwardTransformation"></a>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca13">IsForwardTransformation</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns true if this is an encryption object <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca14" doxytag="BlockCipher::OptimalNumberOfParallelBlocks"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca14">OptimalNumberOfParallelBlocks</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">return number of blocks that can be processed in parallel, for bit-slicing implementations <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_twofish_1_1_enca15" doxytag="BlockCipher::ProcessAndXorMultipleBlocks"></a>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_twofish_1_1_enca15">ProcessAndXorMultipleBlocks</a> (const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, unsigned int numberOfBlocks) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">encrypt or decrypt multiple blocks, for bit-slicing implementations <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_zlib_decompressora17" doxytag="BlockCipher::AlgorithmName"></a>virtual std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_zlib_decompressora17">AlgorithmName</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns name of this algorithm, not universally implemented yet <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_zlib_decompressora18" doxytag="BlockCipher::Clone"></a>virtual <a class="el" href="class_clonable.html">Clonable</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_zlib_decompressora18">Clone</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">this is not implemented by most classes yet <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea21" doxytag="BlockCipher::MinKeyLength"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea21">MinKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns smallest valid key length in bytes */ <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea22" doxytag="BlockCipher::MaxKeyLength"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea22">MaxKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns largest valid key length in bytes */ <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea23" doxytag="BlockCipher::DefaultKeyLength"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea23">DefaultKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns default (recommended) key length in bytes */ <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea24" doxytag="BlockCipher::GetValidKeyLength"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea24">GetValidKeyLength</a> (unsigned int n) const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns the smallest valid key length in bytes that is &gt;= min(n, GetMaxKeyLength()) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea25" doxytag="BlockCipher::IsValidKeyLength"></a>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea25">IsValidKeyLength</a> (unsigned int n) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns whether n is a valid key length <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea26">SetKey</a> (const byte *key, unsigned int length, const <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> &amp;params=<a class="el" href="cryptlib_8h.html#a3">g_nullNameValuePairs</a>)=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">set or reset the key of this object </em> <a href="#_x_m_a_c_c___basea26"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea27" doxytag="BlockCipher::SetKeyWithRounds"></a>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea27">SetKeyWithRounds</a> (const byte *key, unsigned int length, int rounds)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">calls <a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea26">SetKey()</a> with an <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> object that just specifies "Rounds" <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea28" doxytag="BlockCipher::SetKeyWithIV"></a>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea28">SetKeyWithIV</a> (const byte *key, unsigned int length, const byte *iv)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">calls <a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea26">SetKey()</a> with an <a class="el" href="class_name_value_pairs.html">NameValuePairs</a> object that just specifies "IV" <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea29" doxytag="BlockCipher::IVRequirement"></a>virtual IV_Requirement&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea29">IVRequirement</a> () const=0</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns the minimal requirement for secure IVs <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea30">IsResynchronizable</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns whether this object can be resynchronized (i.e. supports initialization vectors) </em> <a href="#_x_m_a_c_c___basea30"></a><em><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea31" doxytag="BlockCipher::CanUseRandomIVs"></a>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea31">CanUseRandomIVs</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns whether this object can use random IVs (in addition to ones returned by GetNextIV) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea32" doxytag="BlockCipher::CanUsePredictableIVs"></a>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea32">CanUsePredictableIVs</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns whether this object can use random but possibly predictable IVs (in addition to ones returned by GetNextIV) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___basea33" doxytag="BlockCipher::CanUseStructuredIVs"></a>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_c___basea33">CanUseStructuredIVs</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns whether this object can use structured IVs, for example a counter (in addition to ones returned by GetNextIV) <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_ca32" doxytag="BlockCipher::IVSize"></a>virtual unsigned int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_ca32">IVSize</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">returns size of IVs used by this object <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_ca33" doxytag="BlockCipher::Resynchronize"></a>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_ca33">Resynchronize</a> (const byte *IV)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">resynchronize with an IV <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_block_cipher.html#_x_m_a_c_ca34">GetNextIV</a> (byte *IV)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">get a secure IV for the next message </em> <a href="#_x_m_a_c_ca34"></a><em><br><br></td></tr><tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___baseb8" doxytag="BlockCipher::ThrowIfInvalidKeyLength"></a>void&nbsp;</td><td class="memItemRight" valign=bottom><b>ThrowIfInvalidKeyLength</b> (const <a class="el" href="class_algorithm.html">Algorithm</a> &amp;algorithm, unsigned int length)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a name="_x_m_a_c_c___baseb9" doxytag="BlockCipher::AssertValidKeyLength"></a>void&nbsp;</td><td class="memItemRight" valign=bottom><b>AssertValidKeyLength</b> (unsigned int length) const</td></tr></table>

⌨️ 快捷键说明

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