<!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++: AdditiveCipherConcretePolicy< WT, W, X, BASE > Struct Template 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="#pub-static-attribs">Static Public Attributes</a> | <a href="struct_additive_cipher_concrete_policy-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">AdditiveCipherConcretePolicy< WT, W, X, BASE > Struct Template Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p>Base class for additive stream ciphers. <a href="struct_additive_cipher_concrete_policy.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 AdditiveCipherConcretePolicy< WT, W, X, BASE >:</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="struct_additive_cipher_concrete_policy.png" usemap="#AdditiveCipherConcretePolicy_3C_20WT_2C_20W_2C_20X_2C_20BASE_20_3E_map" alt=""/> <map id="AdditiveCipherConcretePolicy_3C_20WT_2C_20W_2C_20X_2C_20BASE_20_3E_map" name="AdditiveCipherConcretePolicy_3C_20WT_2C_20W_2C_20X_2C_20BASE_20_3E_map"> </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:a94149b18cb6bf530f196ba0132ba904f"><td class="memItemLeft" align="right" valign="top"><a id="a94149b18cb6bf530f196ba0132ba904f"></a> typedef WT </td><td class="memItemRight" valign="bottom"><b>WordType</b></td></tr> <tr class="separator:a94149b18cb6bf530f196ba0132ba904f"><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:a5bdc1cb44b0ddc8df0fb6953aec93602"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_additive_cipher_concrete_policy.html#a5bdc1cb44b0ddc8df0fb6953aec93602">GetAlignment</a> () const</td></tr> <tr class="memdesc:a5bdc1cb44b0ddc8df0fb6953aec93602"><td class="mdescLeft"> </td><td class="mdescRight">Provides data alignment requirements. <a href="#a5bdc1cb44b0ddc8df0fb6953aec93602">More...</a><br /></td></tr> <tr class="separator:a5bdc1cb44b0ddc8df0fb6953aec93602"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3518c4f5404dd2eb483599bb1109d715"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_additive_cipher_concrete_policy.html#a3518c4f5404dd2eb483599bb1109d715">GetBytesPerIteration</a> () const</td></tr> <tr class="memdesc:a3518c4f5404dd2eb483599bb1109d715"><td class="mdescLeft"> </td><td class="mdescRight">Provides number of bytes operated upon during an iteration. <a href="#a3518c4f5404dd2eb483599bb1109d715">More...</a><br /></td></tr> <tr class="separator:a3518c4f5404dd2eb483599bb1109d715"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad7d421c4073891ad3522c50052d32f60"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_additive_cipher_concrete_policy.html#ad7d421c4073891ad3522c50052d32f60">GetIterationsToBuffer</a> () const</td></tr> <tr class="memdesc:ad7d421c4073891ad3522c50052d32f60"><td class="mdescLeft"> </td><td class="mdescRight">Provides buffer size based on iterations. <a href="#ad7d421c4073891ad3522c50052d32f60">More...</a><br /></td></tr> <tr class="separator:ad7d421c4073891ad3522c50052d32f60"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4d61dfcd462d71960fe8567e2d475f14"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_additive_cipher_concrete_policy.html#a4d61dfcd462d71960fe8567e2d475f14">CanOperateKeystream</a> () const</td></tr> <tr class="memdesc:a4d61dfcd462d71960fe8567e2d475f14"><td class="mdescLeft"> </td><td class="mdescRight">Flag indicating. <a href="#a4d61dfcd462d71960fe8567e2d475f14">More...</a><br /></td></tr> <tr class="separator:a4d61dfcd462d71960fe8567e2d475f14"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a88ce0905757bcc373f028bfd9e0dec43"><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_additive_cipher_concrete_policy.html#a88ce0905757bcc373f028bfd9e0dec43">OperateKeystream</a> (<a class="el" href="strciphr_8h.html#ab4a226527d2bd01ff19bfa14d0974227">KeystreamOperation</a> operation, byte *output, const byte *input, size_t iterationCount)=0</td></tr> <tr class="memdesc:a88ce0905757bcc373f028bfd9e0dec43"><td class="mdescLeft"> </td><td class="mdescRight">Operates the keystream. <a href="#a88ce0905757bcc373f028bfd9e0dec43">More...</a><br /></td></tr> <tr class="separator:a88ce0905757bcc373f028bfd9e0dec43"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a> Static Public Attributes</h2></td></tr> <tr class="memitem:a0c584b68c2f3a8208ff245cd8d09fcd5"><td class="memItemLeft" align="right" valign="top"><a id="a0c584b68c2f3a8208ff245cd8d09fcd5"></a> static const int </td><td class="memItemRight" valign="bottom"><b>BYTES_PER_ITERATION</b> = sizeof(WordType) * W</td></tr> <tr class="separator:a0c584b68c2f3a8208ff245cd8d09fcd5"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><h3>template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy><br /> struct AdditiveCipherConcretePolicy< WT, W, X, BASE ></h3> <p>Base class for additive stream ciphers. </p> <dl class="tparams"><dt>Template Parameters</dt><dd> <table class="tparams"> <tr><td class="paramname">WT</td><td>word type </td></tr> <tr><td class="paramname">W</td><td>count of words </td></tr> <tr><td class="paramname">X</td><td>bytes per iteration count </td></tr> <tr><td class="paramname">BASE</td><td><a class="el" href="struct_additive_cipher_abstract_policy.html" title="Policy object for additive stream ciphers. ">AdditiveCipherAbstractPolicy</a> derived base class </td></tr> </table> </dd> </dl> <p class="definition">Definition at line <a class="el" href="strciphr_8h_source.html#l00181">181</a> of file <a class="el" href="strciphr_8h_source.html">strciphr.h</a>.</p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a5bdc1cb44b0ddc8df0fb6953aec93602"></a> <h2 class="memtitle"><span class="permalink"><a href="#a5bdc1cb44b0ddc8df0fb6953aec93602">◆ </a></span>GetAlignment()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned int <a class="el" href="struct_additive_cipher_concrete_policy.html">AdditiveCipherConcretePolicy</a>< WT, W, X, BASE >::GetAlignment </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 data alignment requirements. </p> <dl class="section return"><dt>Returns</dt><dd>data alignment requirements, in bytes</dd></dl> <p>Internally, the default implementation returns 1. If the stream cipher is implemented using an SSE2 ASM or intrinsics, then the value returned is usually 16. </p> <p class="definition">Definition at line <a class="el" href="strciphr_8h_source.html#l00191">191</a> of file <a class="el" href="strciphr_8h_source.html">strciphr.h</a>.</p> </div> </div> <a id="a3518c4f5404dd2eb483599bb1109d715"></a> <h2 class="memtitle"><span class="permalink"><a href="#a3518c4f5404dd2eb483599bb1109d715">◆ </a></span>GetBytesPerIteration()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned int <a class="el" href="struct_additive_cipher_concrete_policy.html">AdditiveCipherConcretePolicy</a>< WT, W, X, BASE >::GetBytesPerIteration </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 number of bytes operated upon during an iteration. </p> <dl class="section return"><dt>Returns</dt><dd>bytes operated upon during an iteration, in bytes </dd></dl> <dl class="section see"><dt>See also</dt><dd>GetOptimalBlockSize() </dd></dl> <p class="definition">Definition at line <a class="el" href="strciphr_8h_source.html#l00197">197</a> of file <a class="el" href="strciphr_8h_source.html">strciphr.h</a>.</p> </div> </div> <a id="ad7d421c4073891ad3522c50052d32f60"></a> <h2 class="memtitle"><span class="permalink"><a href="#ad7d421c4073891ad3522c50052d32f60">◆ </a></span>GetIterationsToBuffer()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">unsigned int <a class="el" href="struct_additive_cipher_concrete_policy.html">AdditiveCipherConcretePolicy</a>< WT, W, X, BASE >::GetIterationsToBuffer </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 buffer size based on iterations. </p> <dl class="section return"><dt>Returns</dt><dd>the buffer size based on iterations, in bytes </dd></dl> <p class="definition">Definition at line <a class="el" href="strciphr_8h_source.html#l00201">201</a> of file <a class="el" href="strciphr_8h_source.html">strciphr.h</a>.</p> </div> </div> <a id="a4d61dfcd462d71960fe8567e2d475f14"></a> <h2 class="memtitle"><span class="permalink"><a href="#a4d61dfcd462d71960fe8567e2d475f14">◆ </a></span>CanOperateKeystream()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">bool <a class="el" href="struct_additive_cipher_concrete_policy.html">AdditiveCipherConcretePolicy</a>< WT, W, X, BASE >::CanOperateKeystream </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>Flag indicating. </p> <dl class="section return"><dt>Returns</dt><dd>true if the stream can be generated independent of the transformation input, false otherwise </dd></dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="struct_additive_cipher_concrete_policy.html#a4d61dfcd462d71960fe8567e2d475f14" title="Flag indicating. ">CanOperateKeystream()</a>, <a class="el" href="struct_additive_cipher_concrete_policy.html#a88ce0905757bcc373f028bfd9e0dec43" title="Operates the keystream. ">OperateKeystream()</a>, WriteKeystream() </dd></dl> <p class="definition">Definition at line <a class="el" href="strciphr_8h_source.html#l00206">206</a> of file <a class="el" href="strciphr_8h_source.html">strciphr.h</a>.</p> </div> </div> <a id="a88ce0905757bcc373f028bfd9e0dec43"></a> <h2 class="memtitle"><span class="permalink"><a href="#a88ce0905757bcc373f028bfd9e0dec43">◆ </a></span>OperateKeystream()</h2> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<typename WT, unsigned int W, unsigned int X = 1, class BASE = AdditiveCipherAbstractPolicy> </div> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual void <a class="el" href="struct_additive_cipher_concrete_policy.html">AdditiveCipherConcretePolicy</a>< WT, W, X, BASE >::OperateKeystream </td> <td>(</td> <td class="paramtype"><a class="el" href="strciphr_8h.html#ab4a226527d2bd01ff19bfa14d0974227">KeystreamOperation</a> </td> <td class="paramname"><em>operation</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">byte * </td> <td class="paramname"><em>output</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const byte * </td> <td class="paramname"><em>input</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>iterationCount</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></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>Operates the keystream. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">operation</td><td>the operation with additional flags </td></tr> <tr><td class="paramname">output</td><td>the output buffer </td></tr> <tr><td class="paramname">input</td><td>the input buffer </td></tr> <tr><td class="paramname">iterationCount</td><td>the number of iterations to perform on the input</td></tr> </table> </dd> </dl> <p><a class="el" href="struct_additive_cipher_concrete_policy.html#a88ce0905757bcc373f028bfd9e0dec43" title="Operates the keystream. ">OperateKeystream()</a> will attempt to operate upon GetOptimalBlockSize() buffer, which will be derived from <a class="el" href="struct_additive_cipher_concrete_policy.html#a3518c4f5404dd2eb483599bb1109d715" title="Provides number of bytes operated upon during an iteration. ">GetBytesPerIteration()</a>. </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="struct_additive_cipher_concrete_policy.html#a4d61dfcd462d71960fe8567e2d475f14" title="Flag indicating. ">CanOperateKeystream()</a>, <a class="el" href="struct_additive_cipher_concrete_policy.html#a88ce0905757bcc373f028bfd9e0dec43" title="Operates the keystream. ">OperateKeystream()</a>, WriteKeystream(), <a class="el" href="strciphr_8h.html#ab4a226527d2bd01ff19bfa14d0974227" title="Keystream operation flags. ">KeystreamOperation()</a> </dd></dl> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="strciphr_8h_source.html">strciphr.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:12 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>