📄 class_block_cipher.html
字号:
<!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++: BlockCipher Class Reference</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 Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="classes.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul></div><h1>BlockCipher Class Reference</h1><!-- doxytag: class="BlockCipher" --><!-- doxytag: inherits="BlockTransformation,SimpleKeyingInterface" --><code>#include <<a class="el" href="cryptlib_8h-source.html">cryptlib.h</a>></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,322,136"><area href="class_simple_keying_interface.html" alt="SimpleKeyingInterface" shape="rect" coords="332,112,654,136"><area href="class_algorithm.html" alt="Algorithm" shape="rect" coords="0,56,322,80"><area href="class_clonable.html" alt="Clonable" shape="rect" coords="0,0,322,24"><area href="class_s_a_f_e_r_1_1_base.html" alt="SAFER::Base" shape="rect" coords="498,224,820,248"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, BTEA_Info >" shape="rect" coords="498,280,820,304"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Blowfish_Info >" shape="rect" coords="498,336,820,360"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Camellia_Info >" shape="rect" coords="498,392,820,416"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, CAST128_Info >" shape="rect" coords="498,448,820,472"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, CAST256_Info >" shape="rect" coords="498,504,820,528"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, DES_EDE2_Info >" shape="rect" coords="498,560,820,584"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, DES_EDE3_Info >" shape="rect" coords="498,616,820,640"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, DES_Info >" shape="rect" coords="498,672,820,696"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, DES_XEX3_Info >" shape="rect" coords="498,728,820,752"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, GOST_Info >" shape="rect" coords="498,784,820,808"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, IDEA_Info >" shape="rect" coords="498,840,820,864"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, LR_Info< T > >" shape="rect" coords="498,896,820,920"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, MARS_Info >" shape="rect" coords="498,952,820,976"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, MDC_Info< T > >" shape="rect" coords="498,1008,820,1032"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, RC2_Info >" shape="rect" coords="498,1064,820,1088"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, RC5_Info >" shape="rect" coords="498,1120,820,1144"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, RC6_Info >" shape="rect" coords="498,1176,820,1200"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Rijndael_Info >" shape="rect" coords="498,1232,820,1256"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Serpent_Info >" shape="rect" coords="498,1288,820,1312"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, SHACAL2_Info >" shape="rect" coords="498,1344,820,1368"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, SHARK_Info >" shape="rect" coords="498,1400,820,1424"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, SKIPJACK_Info >" shape="rect" coords="498,1456,820,1480"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Square_Info >" shape="rect" coords="498,1512,820,1536"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, TEA_Info >" shape="rect" coords="498,1568,820,1592"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, ThreeWay_Info >" shape="rect" coords="498,1624,820,1648"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, Twofish_Info >" shape="rect" coords="498,1680,820,1704"><area href="class_two_bases.html" alt="TwoBases< BlockCipher, XTEA_Info >" shape="rect" coords="498,1736,820,1760"></map><a href="class_block_cipher-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>interface for one direction (encryption or decryption) of a block cipher <p><dl class="note" compact><dt><b>Note:</b></dt><dd>These objects usually should not be used directly. See <a class="el" href="class_block_transformation.html" title="interface for the data processing part of block ciphers">BlockTransformation</a> for more details. </dd></dl><p><p>Definition at line <a class="el" href="cryptlib_8h-source.html#l00606">606</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 </td><td class="memItemRight" valign="bottom"><a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6e">IV_Requirement</a> { <br> <a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6e1cc32e69fe4f385e54d9d482a2ab5a56">UNIQUE_IV</a> = 0, <a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6e4520c4379ee3a1aed95a36e2235ba338">RANDOM_IV</a>, <a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6eceff3ad4b12bcb6d7b61a5bd543a815c">UNPREDICTABLE_RANDOM_IV</a>, <a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6eb659bf6d2c470c50c14bfbab5b2d45ab">INTERNALLY_GENERATED_IV</a>, <br> <a class="el" href="class_simple_keying_interface.html#88201c180fbfaa9fef2715252546ad6ec1d24de3dedd05c28516f452d3ace417">NOT_RESYNCHRONIZABLE</a><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 class="anchor" name="1904cf145e4c5c650dd7aff32f54e153"></a><!-- doxytag: member="BlockCipher::ProcessAndXorBlock" ref="1904cf145e4c5c650dd7aff32f54e153" args="(const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0" -->virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#1904cf145e4c5c650dd7aff32f54e153">ProcessAndXorBlock</a> (const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt or decrypt inBlock, xor with xorBlock, and write to outBlock <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#2fefb3f4c6c6297c0c91fcbba9e4f4f3">ProcessBlock</a> (const byte *inBlock, byte *outBlock) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt or decrypt one block <a href="#2fefb3f4c6c6297c0c91fcbba9e4f4f3"></a><br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="12cc1846de571557be0f82471e8904bf"></a><!-- doxytag: member="BlockCipher::ProcessBlock" ref="12cc1846de571557be0f82471e8904bf" args="(byte *inoutBlock) const " -->void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#12cc1846de571557be0f82471e8904bf">ProcessBlock</a> (byte *inoutBlock) const </td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt or decrypt one block in place <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4936bef4368804cf5cadab9eb6eb37e4"></a><!-- doxytag: member="BlockCipher::BlockSize" ref="4936bef4368804cf5cadab9eb6eb37e4" args="() const=0" -->virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#4936bef4368804cf5cadab9eb6eb37e4">BlockSize</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">block size of the cipher in bytes <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="f2da7e22f6b6ddda72bc7db2aceaa67a"></a><!-- doxytag: member="BlockCipher::BlockAlignment" ref="f2da7e22f6b6ddda72bc7db2aceaa67a" args="() const" -->virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#f2da7e22f6b6ddda72bc7db2aceaa67a">BlockAlignment</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">block pointers must be divisible by this <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4118be8bfaf6772a9a8e03dd450614b"></a><!-- doxytag: member="BlockCipher::IsPermutation" ref="a4118be8bfaf6772a9a8e03dd450614b" args="() const" -->virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a4118be8bfaf6772a9a8e03dd450614b">IsPermutation</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns true if this is a permutation (i.e. there is an inverse transformation) <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="924da616b7ba966704fb67e2b852fd2e"></a><!-- doxytag: member="BlockCipher::IsForwardTransformation" ref="924da616b7ba966704fb67e2b852fd2e" args="() const=0" -->virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#924da616b7ba966704fb67e2b852fd2e">IsForwardTransformation</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns true if this is an encryption object <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9ee1da34a4c957d4be87d2b0469806b0"></a><!-- doxytag: member="BlockCipher::OptimalNumberOfParallelBlocks" ref="9ee1da34a4c957d4be87d2b0469806b0" args="() const" -->virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#9ee1da34a4c957d4be87d2b0469806b0">OptimalNumberOfParallelBlocks</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">return number of blocks that can be processed in parallel, for bit-slicing implementations <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="9efa0ea24795a19d15c9aa0d7f134562"></a><!-- doxytag: member="BlockCipher::ProcessAndXorMultipleBlocks" ref="9efa0ea24795a19d15c9aa0d7f134562" args="(const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t numberOfBlocks) const" -->virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#9efa0ea24795a19d15c9aa0d7f134562">ProcessAndXorMultipleBlocks</a> (const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t numberOfBlocks) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">encrypt or decrypt multiple blocks, for bit-slicing implementations <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="91b351e01288f31eccb3b42bc096c2ba"></a><!-- doxytag: member="BlockCipher::GetCipherDirection" ref="91b351e01288f31eccb3b42bc096c2ba" args="() const" --><a class="el" href="cryptlib_8h.html#353ccabf5ddc119a6a33e92f7b9961c7">CipherDir</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#91b351e01288f31eccb3b42bc096c2ba">GetCipherDirection</a> () const</td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="4f31510a192d1121856efe8ad0a9b844"></a><!-- doxytag: member="BlockCipher::AlgorithmName" ref="4f31510a192d1121856efe8ad0a9b844" args="() const" -->virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_algorithm.html#4f31510a192d1121856efe8ad0a9b844">AlgorithmName</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns name of this algorithm, not universally implemented yet <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d0016ba2d505c23aa85aad49e6c19bb7"></a><!-- doxytag: member="BlockCipher::Clone" ref="d0016ba2d505c23aa85aad49e6c19bb7" args="() const" -->virtual <a class="el" href="class_clonable.html">Clonable</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_clonable.html#d0016ba2d505c23aa85aad49e6c19bb7">Clone</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">this is not implemented by most classes yet <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="b9e027a141d40929fef51343064d1a69"></a><!-- doxytag: member="BlockCipher::MinKeyLength" ref="b9e027a141d40929fef51343064d1a69" args="() const=0" -->virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_simple_keying_interface.html#b9e027a141d40929fef51343064d1a69">MinKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns smallest valid key length in bytes */ <br></td></tr><tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="99ebc91e778d51d8481c4c4e8403508b"></a><!-- doxytag: member="BlockCipher::MaxKeyLength" ref="99ebc91e778d51d8481c4c4e8403508b" args="() const=0" -->virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_simple_keying_interface.html#99ebc91e778d51d8481c4c4e8403508b">MaxKeyLength</a> () const=0</td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -