<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crypto++: BlockTransformation Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crypto++  <span id="projectnumber">7.0</span> </div> <div id="projectbrief">Free C++ class library of cryptographic schemes</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',false,false,'search.php','Search'); }); /* @license-end */</script> <div id="main-nav"></div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-types">Public Types</a> | <a href="#pub-methods">Public Member Functions</a> | <a href="class_block_transformation-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">BlockTransformation Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p>Interface for the data processing part of block ciphers. <a href="class_block_transformation.html#details">More...</a></p> <div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"> <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Inheritance diagram for BlockTransformation:</div> <div id="dynsection-0-summary" class="dynsummary" style="display:block;"> </div> <div id="dynsection-0-content" class="dyncontent" style="display:none;"> <div class="center"> <img src="class_block_transformation.png" usemap="#BlockTransformation_map" alt=""/> <map id="BlockTransformation_map" name="BlockTransformation_map"> <area href="class_algorithm.html" title="Interface for all crypto algorithms. " alt="Algorithm" shape="rect" coords="625,56,1115,80"/> <area href="class_clonable.html" title="Interface for cloning objects. " alt="Clonable" shape="rect" coords="625,0,1115,24"/> <area href="class_block_cipher.html" title="Interface for one direction (encryption or decryption) of a block cipher. " alt="BlockCipher" shape="rect" coords="625,168,1115,192"/> <area href="class_s_a_f_e_r_1_1_base.html" title="SAFER block cipher default operation. " alt="SAFER::Base" shape="rect" coords="250,224,740,248"/> <area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, BTEA_Info >" shape="rect" coords="1000,224,1490,248"/> <area href="class_s_a_f_e_r_1_1_dec.html" title="SAFER block cipher decryption operation. " alt="SAFER::Dec" shape="rect" coords="0,280,490,304"/> <area href="class_s_a_f_e_r_1_1_enc.html" title="SAFER block cipher encryption operation. " alt="SAFER::Enc" shape="rect" coords="500,280,990,304"/> <area href="class_algorithm_impl.html" alt="AlgorithmImpl< SimpleKeyingInterfaceImpl< BlockCipher, BTEA_Info >, BTEA_Info >" shape="rect" coords="1000,280,1490,304"/> </map> </div></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> Public Types</h2></td></tr> <tr class="memitem:adec6c003f0e1539c0a9da64e2d17352d"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352d">FlagsForAdvancedProcessBlocks</a> { <br />   <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352da29b5a55fe327fe4764833fd427298deb">BT_InBlockIsCounter</a> =1, <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352dab4c0ce98fee079d801069d4252f6c345">BT_DontIncrementInOutPointers</a> =2, <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352da692d5da11e5444e32f6e4e091623eaab">BT_XorInput</a> =4, <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352da4123a7839e78785bd6495ac651c06855">BT_ReverseDirection</a> =8, <br />   <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352dab263d9d3939b425f3f36b10e8990a525">BT_AllowParallel</a> =16 <br /> }</td></tr> <tr class="memdesc:adec6c003f0e1539c0a9da64e2d17352d"><td class="mdescLeft"> </td><td class="mdescRight">Bit flags that control <a class="el" href="class_block_transformation.html#a73ad0afb596da5f7e1f26ddf47394afb" title="Encrypt and xor multiple blocks using additional flags. ">AdvancedProcessBlocks()</a> behavior. <a href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352d">More...</a><br /></td></tr> <tr class="separator:adec6c003f0e1539c0a9da64e2d17352d"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a1904cf145e4c5c650dd7aff32f54e153"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a1904cf145e4c5c650dd7aff32f54e153">ProcessAndXorBlock</a> (const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0</td></tr> <tr class="memdesc:a1904cf145e4c5c650dd7aff32f54e153"><td class="mdescLeft"> </td><td class="mdescRight">Encrypt or decrypt a block. <a href="#a1904cf145e4c5c650dd7aff32f54e153">More...</a><br /></td></tr> <tr class="separator:a1904cf145e4c5c650dd7aff32f54e153"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a93b18a5b11cd6f61bf19624192575d1d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a93b18a5b11cd6f61bf19624192575d1d">ProcessBlock</a> (const byte *inBlock, byte *outBlock) const</td></tr> <tr class="memdesc:a93b18a5b11cd6f61bf19624192575d1d"><td class="mdescLeft"> </td><td class="mdescRight">Encrypt or decrypt a block. <a href="#a93b18a5b11cd6f61bf19624192575d1d">More...</a><br /></td></tr> <tr class="separator:a93b18a5b11cd6f61bf19624192575d1d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ace6715ffdfd9ffa00182de8462ea6c4b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#ace6715ffdfd9ffa00182de8462ea6c4b">ProcessBlock</a> (byte *inoutBlock) const</td></tr> <tr class="memdesc:ace6715ffdfd9ffa00182de8462ea6c4b"><td class="mdescLeft"> </td><td class="mdescRight">Encrypt or decrypt a block in place. <a href="#ace6715ffdfd9ffa00182de8462ea6c4b">More...</a><br /></td></tr> <tr class="separator:ace6715ffdfd9ffa00182de8462ea6c4b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adfdb78b033996020435c3dcffdca76ce"><td class="memItemLeft" align="right" valign="top">virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce">BlockSize</a> () const =0</td></tr> <tr class="memdesc:adfdb78b033996020435c3dcffdca76ce"><td class="mdescLeft"> </td><td class="mdescRight">Provides the block size of the cipher. <a href="#adfdb78b033996020435c3dcffdca76ce">More...</a><br /></td></tr> <tr class="separator:adfdb78b033996020435c3dcffdca76ce"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ac4796a7db0ddec123e00fadef4a71a38"><td class="memItemLeft" align="right" valign="top">virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#ac4796a7db0ddec123e00fadef4a71a38">OptimalDataAlignment</a> () const</td></tr> <tr class="memdesc:ac4796a7db0ddec123e00fadef4a71a38"><td class="mdescLeft"> </td><td class="mdescRight">Provides input and output data alignment for optimal performance. <a href="#ac4796a7db0ddec123e00fadef4a71a38">More...</a><br /></td></tr> <tr class="separator:ac4796a7db0ddec123e00fadef4a71a38"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa4118be8bfaf6772a9a8e03dd450614b"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#aa4118be8bfaf6772a9a8e03dd450614b">IsPermutation</a> () const</td></tr> <tr class="memdesc:aa4118be8bfaf6772a9a8e03dd450614b"><td class="mdescLeft"> </td><td class="mdescRight">Determines if the transformation is a permutation. <a href="#aa4118be8bfaf6772a9a8e03dd450614b">More...</a><br /></td></tr> <tr class="separator:aa4118be8bfaf6772a9a8e03dd450614b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a50f2565057bc9ba7bb70a98d9c9b39cd"><td class="memItemLeft" align="right" valign="top">virtual bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a50f2565057bc9ba7bb70a98d9c9b39cd">IsForwardTransformation</a> () const =0</td></tr> <tr class="memdesc:a50f2565057bc9ba7bb70a98d9c9b39cd"><td class="mdescLeft"> </td><td class="mdescRight">Determines if the cipher is being operated in its forward direction. <a href="#a50f2565057bc9ba7bb70a98d9c9b39cd">More...</a><br /></td></tr> <tr class="separator:a50f2565057bc9ba7bb70a98d9c9b39cd"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a9ee1da34a4c957d4be87d2b0469806b0"><td class="memItemLeft" align="right" valign="top">virtual unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a9ee1da34a4c957d4be87d2b0469806b0">OptimalNumberOfParallelBlocks</a> () const</td></tr> <tr class="memdesc:a9ee1da34a4c957d4be87d2b0469806b0"><td class="mdescLeft"> </td><td class="mdescRight">Determines the number of blocks that can be processed in parallel. <a href="#a9ee1da34a4c957d4be87d2b0469806b0">More...</a><br /></td></tr> <tr class="separator:a9ee1da34a4c957d4be87d2b0469806b0"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a73ad0afb596da5f7e1f26ddf47394afb"><td class="memItemLeft" align="right" valign="top">virtual size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a73ad0afb596da5f7e1f26ddf47394afb">AdvancedProcessBlocks</a> (const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const</td></tr> <tr class="memdesc:a73ad0afb596da5f7e1f26ddf47394afb"><td class="mdescLeft"> </td><td class="mdescRight">Encrypt and xor multiple blocks using additional flags. <a href="#a73ad0afb596da5f7e1f26ddf47394afb">More...</a><br /></td></tr> <tr class="separator:a73ad0afb596da5f7e1f26ddf47394afb"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a91b351e01288f31eccb3b42bc096c2ba"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cryptlib_8h.html#a353ccabf5ddc119a6a33e92f7b9961c7">CipherDir</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_block_transformation.html#a91b351e01288f31eccb3b42bc096c2ba">GetCipherDirection</a> () const</td></tr> <tr class="memdesc:a91b351e01288f31eccb3b42bc096c2ba"><td class="mdescLeft"> </td><td class="mdescRight">Provides the direction of the cipher. <a href="#a91b351e01288f31eccb3b42bc096c2ba">More...</a><br /></td></tr> <tr class="separator:a91b351e01288f31eccb3b42bc096c2ba"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_algorithm"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_algorithm')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_algorithm.html">Algorithm</a></td></tr> <tr class="memitem:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_algorithm.html#a1c77f5117ca2cd881baf26a364cfc606">Algorithm</a> (bool checkSelfTestStatus=true)</td></tr> <tr class="memdesc:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Interface for all crypto algorithms. <a href="class_algorithm.html#a1c77f5117ca2cd881baf26a364cfc606">More...</a><br /></td></tr> <tr class="separator:a1c77f5117ca2cd881baf26a364cfc606 inherit pub_methods_class_algorithm"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4f31510a192d1121856efe8ad0a9b844 inherit pub_methods_class_algorithm"><td class="memItemLeft" align="right" valign="top">virtual std::string </td><td class="memItemRight" valign="bottom"><a class="el" href="class_algorithm.html#a4f31510a192d1121856efe8ad0a9b844">AlgorithmName</a> () const</td></tr> <tr class="memdesc:a4f31510a192d1121856efe8ad0a9b844 inherit pub_methods_class_algorithm"><td class="mdescLeft"> </td><td class="mdescRight">Provides the name of this algorithm. <a href="class_algorithm.html#a4f31510a192d1121856efe8ad0a9b844">More...</a><br /></td></tr> <tr class="separator:a4f31510a192d1121856efe8ad0a9b844 inherit pub_methods_class_algorithm"><td class="memSeparator" colspan="2"> </td></tr> <tr class="inherit_header pub_methods_class_clonable"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_clonable')"><img src="closed.png" alt="-"/> Public Member Functions inherited from <a class="el" href="class_clonable.html">Clonable</a></td></tr> <tr class="memitem:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="class_clonable.html">Clonable</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_clonable.html#ad0016ba2d505c23aa85aad49e6c19bb7">Clone</a> () const</td></tr> <tr class="memdesc:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="mdescLeft"> </td><td class="mdescRight">Copies this object. <a href="class_clonable.html#ad0016ba2d505c23aa85aad49e6c19bb7">More...</a><br /></td></tr> <tr class="separator:ad0016ba2d505c23aa85aad49e6c19bb7 inherit pub_methods_class_clonable"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Interface for the data processing part of block ciphers. </p> <p>Classes derived from <a class="el" href="class_block_transformation.html" title="Interface for the data processing part of block ciphers. ">BlockTransformation</a> are block ciphers in ECB mode (for example the DES::Encryption class), which are stateless. These classes should not be used directly, but only in combination with a mode class (see <a class="el" href="struct_cipher_mode_documentation.html" title="Block cipher mode of operation information. ">CipherModeDocumentation</a> in <a class="el" href="modes_8h.html" title="Classes for block cipher modes of operation. ">modes.h</a>). </p> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00808">808</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div><h2 class="groupheader">Member Enumeration Documentation</h2> <a id="adec6c003f0e1539c0a9da64e2d17352d"></a> <h2 class="memtitle"><span class="permalink"><a href="#adec6c003f0e1539c0a9da64e2d17352d">◆ </a></span>FlagsForAdvancedProcessBlocks</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="class_block_transformation.html#adec6c003f0e1539c0a9da64e2d17352d">BlockTransformation::FlagsForAdvancedProcessBlocks</a></td> </tr> </table> </div><div class="memdoc"> <p>Bit flags that control <a class="el" href="class_block_transformation.html#a73ad0afb596da5f7e1f26ddf47394afb" title="Encrypt and xor multiple blocks using additional flags. ">AdvancedProcessBlocks()</a> behavior. </p> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="adec6c003f0e1539c0a9da64e2d17352da29b5a55fe327fe4764833fd427298deb"></a>BT_InBlockIsCounter </td><td class="fielddoc"><p>inBlock is a counter </p> </td></tr> <tr><td class="fieldname"><a id="adec6c003f0e1539c0a9da64e2d17352dab4c0ce98fee079d801069d4252f6c345"></a>BT_DontIncrementInOutPointers </td><td class="fielddoc"><p>should not modify block pointers </p> </td></tr> <tr><td class="fieldname"><a id="adec6c003f0e1539c0a9da64e2d17352da692d5da11e5444e32f6e4e091623eaab"></a>BT_XorInput </td><td class="fielddoc"><p>Xor inputs before transformation. </p> </td></tr> <tr><td class="fieldname"><a id="adec6c003f0e1539c0a9da64e2d17352da4123a7839e78785bd6495ac651c06855"></a>BT_ReverseDirection </td><td class="fielddoc"><p>perform the transformation in reverse </p> </td></tr> <tr><td class="fieldname"><a id="adec6c003f0e1539c0a9da64e2d17352dab263d9d3939b425f3f36b10e8990a525"></a>BT_AllowParallel </td><td class="fielddoc"><p>Allow parallel transformations. </p> </td></tr> </table> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00868">868</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <h2 class="groupheader">Member Function Documentation</h2> <a id="a1904cf145e4c5c650dd7aff32f54e153"></a> <h2 class="memtitle"><span class="permalink"><a href="#a1904cf145e4c5c650dd7aff32f54e153">◆ </a></span>ProcessAndXorBlock()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void BlockTransformation::ProcessAndXorBlock </td> <td>(</td> <td class="paramtype">const byte * </td> <td class="paramname"><em>inBlock</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>xorBlock</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">byte * </td> <td class="paramname"><em>outBlock</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Encrypt or decrypt a block. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">inBlock</td><td>the input message before processing </td></tr> <tr><td class="paramname">outBlock</td><td>the output message after processing </td></tr> <tr><td class="paramname">xorBlock</td><td>an optional XOR mask</td></tr> </table> </dd> </dl> <p>ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock.</p> <p>The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> at runtime. </p><dl class="section note"><dt>Note</dt><dd>The message can be transformed in-place, or the buffers must <em>not</em> overlap </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_block_size.html" title="Inherited by algorithms with fixed block size. ">FixedBlockSize</a>, <a class="el" href="class_block_cipher_final.html" title="Provides class member functions to key a block cipher. ">BlockCipherFinal</a> from <a class="el" href="seckey_8h.html" title="Classes and functions for implementing secret key algorithms. ">seckey.h</a> and <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> </dd></dl> <p>Implemented in <a class="el" href="class_s_a_f_e_r_1_1_dec.html#a094105c91af621b22c42bb487c57c2fe">SAFER::Dec</a>, and <a class="el" href="class_s_a_f_e_r_1_1_enc.html#af32a26d17ef3be03ace98c09d84feaf6">SAFER::Enc</a>.</p> </div> </div> <a id="a93b18a5b11cd6f61bf19624192575d1d"></a> <h2 class="memtitle"><span class="permalink"><a href="#a93b18a5b11cd6f61bf19624192575d1d">◆ </a></span>ProcessBlock() <span class="overload">[1/2]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void BlockTransformation::ProcessBlock </td> <td>(</td> <td class="paramtype">const byte * </td> <td class="paramname"><em>inBlock</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">byte * </td> <td class="paramname"><em>outBlock</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Encrypt or decrypt a block. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">inBlock</td><td>the input message before processing </td></tr> <tr><td class="paramname">outBlock</td><td>the output message after processing</td></tr> </table> </dd> </dl> <p>ProcessBlock encrypts or decrypts inBlock and write to outBlock.</p> <p>The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> at runtime. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_block_size.html" title="Inherited by algorithms with fixed block size. ">FixedBlockSize</a>, <a class="el" href="class_block_cipher_final.html" title="Provides class member functions to key a block cipher. ">BlockCipherFinal</a> from <a class="el" href="seckey_8h.html" title="Classes and functions for implementing secret key algorithms. ">seckey.h</a> and <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> </dd></dl> <dl class="section note"><dt>Note</dt><dd>The message can be transformed in-place, or the buffers must <em>not</em> overlap </dd></dl> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00832">832</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <a id="ace6715ffdfd9ffa00182de8462ea6c4b"></a> <h2 class="memtitle"><span class="permalink"><a href="#ace6715ffdfd9ffa00182de8462ea6c4b">◆ </a></span>ProcessBlock() <span class="overload">[2/2]</span></h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">void BlockTransformation::ProcessBlock </td> <td>(</td> <td class="paramtype">byte * </td> <td class="paramname"><em>inoutBlock</em></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Encrypt or decrypt a block in place. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">inoutBlock</td><td>the input message before processing</td></tr> </table> </dd> </dl> <p>ProcessBlock encrypts or decrypts inoutBlock in-place.</p> <p>The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> at runtime. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_fixed_block_size.html" title="Inherited by algorithms with fixed block size. ">FixedBlockSize</a>, <a class="el" href="class_block_cipher_final.html" title="Provides class member functions to key a block cipher. ">BlockCipherFinal</a> from <a class="el" href="seckey_8h.html" title="Classes and functions for implementing secret key algorithms. ">seckey.h</a> and <a class="el" href="class_block_transformation.html#adfdb78b033996020435c3dcffdca76ce" title="Provides the block size of the cipher. ">BlockSize()</a> </dd></dl> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00841">841</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <a id="adfdb78b033996020435c3dcffdca76ce"></a> <h2 class="memtitle"><span class="permalink"><a href="#adfdb78b033996020435c3dcffdca76ce">◆ </a></span>BlockSize()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual unsigned int BlockTransformation::BlockSize </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Provides the block size of the cipher. </p> <dl class="section return"><dt>Returns</dt><dd>the block size of the cipher, in bytes </dd></dl> </div> </div> <a id="ac4796a7db0ddec123e00fadef4a71a38"></a> <h2 class="memtitle"><span class="permalink"><a href="#ac4796a7db0ddec123e00fadef4a71a38">◆ </a></span>OptimalDataAlignment()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned int BlockTransformation::OptimalDataAlignment </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Provides input and output data alignment for optimal performance. </p> <dl class="section return"><dt>Returns</dt><dd>the input data alignment that provides optimal performance </dd></dl> <dl class="section see"><dt>See also</dt><dd>GetAlignment() and OptimalBlockSize() </dd></dl> <p>Reimplemented in <a class="el" href="class_s_a_f_e_r_1_1_base.html#a12da959d8bc01569b0a8786b1682d1b4">SAFER::Base</a>.</p> <p class="definition">Definition at line <a class="el" href="cryptlib_8cpp_source.html#l00196">196</a> of file <a class="el" href="cryptlib_8cpp_source.html">cryptlib.cpp</a>.</p> </div> </div> <a id="aa4118be8bfaf6772a9a8e03dd450614b"></a> <h2 class="memtitle"><span class="permalink"><a href="#aa4118be8bfaf6772a9a8e03dd450614b">◆ </a></span>IsPermutation()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual bool BlockTransformation::IsPermutation </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Determines if the transformation is a permutation. </p> <dl class="section return"><dt>Returns</dt><dd>true if this is a permutation (i.e. there is an inverse transformation) </dd></dl> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00855">855</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <a id="a50f2565057bc9ba7bb70a98d9c9b39cd"></a> <h2 class="memtitle"><span class="permalink"><a href="#a50f2565057bc9ba7bb70a98d9c9b39cd">◆ </a></span>IsForwardTransformation()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual bool BlockTransformation::IsForwardTransformation </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Determines if the cipher is being operated in its forward direction. </p> <dl class="section return"><dt>Returns</dt><dd>true if DIR is ENCRYPTION, false otherwise </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_block_transformation.html#a50f2565057bc9ba7bb70a98d9c9b39cd" title="Determines if the cipher is being operated in its forward direction. ">IsForwardTransformation()</a>, <a class="el" href="class_block_transformation.html#aa4118be8bfaf6772a9a8e03dd450614b" title="Determines if the transformation is a permutation. ">IsPermutation()</a>, <a class="el" href="class_block_transformation.html#a91b351e01288f31eccb3b42bc096c2ba" title="Provides the direction of the cipher. ">GetCipherDirection()</a> </dd></dl> </div> </div> <a id="a9ee1da34a4c957d4be87d2b0469806b0"></a> <h2 class="memtitle"><span class="permalink"><a href="#a9ee1da34a4c957d4be87d2b0469806b0">◆ </a></span>OptimalNumberOfParallelBlocks()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual unsigned int BlockTransformation::OptimalNumberOfParallelBlocks </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Determines the number of blocks that can be processed in parallel. </p> <dl class="section return"><dt>Returns</dt><dd>the number of blocks that can be processed in parallel, for bit-slicing implementations</dd></dl> <p>Bit-slicing is often used to improve throughput and minimize timing attacks. </p> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00865">865</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <a id="a73ad0afb596da5f7e1f26ddf47394afb"></a> <h2 class="memtitle"><span class="permalink"><a href="#a73ad0afb596da5f7e1f26ddf47394afb">◆ </a></span>AdvancedProcessBlocks()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">size_t BlockTransformation::AdvancedProcessBlocks </td> <td>(</td> <td class="paramtype">const byte * </td> <td class="paramname"><em>inBlocks</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>xorBlocks</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">byte * </td> <td class="paramname"><em>outBlocks</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>length</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">word32 </td> <td class="paramname"><em>flags</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Encrypt and xor multiple blocks using additional flags. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">inBlocks</td><td>the input message before processing </td></tr> <tr><td class="paramname">xorBlocks</td><td>an optional XOR mask </td></tr> <tr><td class="paramname">outBlocks</td><td>the output message after processing </td></tr> <tr><td class="paramname">length</td><td>the size of the blocks, in bytes </td></tr> <tr><td class="paramname">flags</td><td>additional flags to control processing</td></tr> </table> </dd> </dl> <p>Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags. </p><dl class="section note"><dt>Note</dt><dd>If BT_InBlockIsCounter is set, then the last byte of inBlocks may be modified. </dd></dl> <p class="definition">Definition at line <a class="el" href="cryptlib_8cpp_source.html#l00147">147</a> of file <a class="el" href="cryptlib_8cpp_source.html">cryptlib.cpp</a>.</p> </div> </div> <a id="a91b351e01288f31eccb3b42bc096c2ba"></a> <h2 class="memtitle"><span class="permalink"><a href="#a91b351e01288f31eccb3b42bc096c2ba">◆ </a></span>GetCipherDirection()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cryptlib_8h.html#a353ccabf5ddc119a6a33e92f7b9961c7">CipherDir</a> BlockTransformation::GetCipherDirection </td> <td>(</td> <td class="paramname"></td><td>)</td> <td> const</td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">inline</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Provides the direction of the cipher. </p> <dl class="section return"><dt>Returns</dt><dd>ENCRYPTION if <a class="el" href="class_block_transformation.html#a50f2565057bc9ba7bb70a98d9c9b39cd" title="Determines if the cipher is being operated in its forward direction. ">IsForwardTransformation()</a> is true, DECRYPTION otherwise </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="class_block_transformation.html#a50f2565057bc9ba7bb70a98d9c9b39cd" title="Determines if the cipher is being operated in its forward direction. ">IsForwardTransformation()</a>, <a class="el" href="class_block_transformation.html#aa4118be8bfaf6772a9a8e03dd450614b" title="Determines if the transformation is a permutation. ">IsPermutation()</a> </dd></dl> <p class="definition">Definition at line <a class="el" href="cryptlib_8h_source.html#l00893">893</a> of file <a class="el" href="cryptlib_8h_source.html">cryptlib.h</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li><a class="el" href="cryptlib_8h_source.html">cryptlib.h</a></li> <li><a class="el" href="cryptlib_8cpp_source.html">cryptlib.cpp</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:17 for Crypto++ by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>