📄 class_simple_keying_interface.html
字号:
<!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++: SimpleKeyingInterface 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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>SimpleKeyingInterface Class Reference</h1><code>#include <<a class="el" href="cryptlib_8h-source.html">cryptlib.h</a>></code><p><p>Inheritance diagram for SimpleKeyingInterface:<p><center><img src="class_simple_keying_interface.png" usemap="#SimpleKeyingInterface_map" border="0" alt=""></center><map name="SimpleKeyingInterface_map"><area href="class_block_cipher.html" alt="BlockCipher" shape="rect" coords="0,56,474,80"><area href="class_message_authentication_code.html" alt="MessageAuthenticationCode" shape="rect" coords="968,56,1442,80"><area href="class_simple_keyed_transformation.html" alt="SimpleKeyedTransformation< T >" shape="rect" coords="1452,56,1926,80"><area href="class_symmetric_cipher.html" alt="SymmetricCipher" shape="rect" coords="1936,56,2410,80"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Blowfish_Info >" shape="rect" coords="484,168,958,192"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, CAST128_Info >" shape="rect" coords="484,224,958,248"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, CAST256_Info >" shape="rect" coords="484,280,958,304"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_EDE2_Info >" shape="rect" coords="484,336,958,360"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_EDE3_Info >" shape="rect" coords="484,392,958,416"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_Info >" shape="rect" coords="484,448,958,472"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, DES_XEX3_Info >" shape="rect" coords="484,504,958,528"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Diamond2_Info >" shape="rect" coords="484,560,958,584"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Diamond2Lite_Info >" shape="rect" coords="484,616,958,640"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, GOST_Info >" shape="rect" coords="484,672,958,696"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, IDEA_Info >" shape="rect" coords="484,728,958,752"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, LR_Info< T > >" shape="rect" coords="484,784,958,808"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, MARS_Info >" shape="rect" coords="484,840,958,864"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, MDC_Info< T > >" shape="rect" coords="484,896,958,920"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC2_Info >" shape="rect" coords="484,952,958,976"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC5_Info >" shape="rect" coords="484,1008,958,1032"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, RC6_Info >" shape="rect" coords="484,1064,958,1088"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Rijndael_Info >" shape="rect" coords="484,1120,958,1144"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Serpent_Info >" shape="rect" coords="484,1176,958,1200"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, SHARK_Info >" shape="rect" coords="484,1232,958,1256"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, SKIPJACK_Info >" shape="rect" coords="484,1288,958,1312"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Square_Info >" shape="rect" coords="484,1344,958,1368"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, TEA_Info >" shape="rect" coords="484,1400,958,1424"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, ThreeWay_Info >" shape="rect" coords="484,1456,958,1480"><area href="class_simple_keying_interface_impl.html" alt="SimpleKeyingInterfaceImpl< BlockCipher, Twofish_Info >" shape="rect" coords="484,1512,958,1536"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< BASE, INFO >" shape="rect" coords="1452,392,1926,416"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< CBC_MAC_Base, CBC_MAC< T > >" shape="rect" coords="1452,448,1926,472"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< DMAC_Base< T > >" shape="rect" coords="1452,504,1926,528"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< HMAC_Base, HMAC< T > >" shape="rect" coords="1452,560,1926,584"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< PanamaMAC_Base< B > >" shape="rect" coords="1452,616,1926,640"><area href="class_message_authentication_code_final_template.html" alt="MessageAuthenticationCodeFinalTemplate< XMACC_Base< T > >" shape="rect" coords="1452,672,1926,696"><area href="class_panama_m_a_c___base.html" alt="PanamaMAC_Base< B >" shape="rect" coords="1452,728,1926,752"><area href="class_a_r_c4___base.html" alt="ARC4_Base" shape="rect" coords="2420,112,2894,136"></map><a href="class_simple_keying_interface-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>keying interface for crypto algorithms that take byte strings as keys <p><p>Definition at line <a class="el" href="cryptlib_8h-source.html#l00348">348</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><b>IV_Requirement</b> { <br> <b>STRUCTURED_IV</b> = 0, <b>RANDOM_IV</b>, <b>UNPREDICTABLE_RANDOM_IV</b>, <b>INTERNALLY_GENERATED_IV</b>, <br> <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="_x_m_a_c_c___basea21" doxytag="SimpleKeyingInterface::MinKeyLength"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea21">MinKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::MaxKeyLength"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea22">MaxKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::DefaultKeyLength"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea23">DefaultKeyLength</a> () const=0</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::GetValidKeyLength"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea24">GetValidKeyLength</a> (unsigned int n) const=0</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">returns the smallest valid key length in bytes that is >= 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="SimpleKeyingInterface::IsValidKeyLength"></a>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea25">IsValidKeyLength</a> (unsigned int n) const</td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.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> &params=<a class="el" href="cryptlib_8h.html#a3">g_nullNameValuePairs</a>)=0</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::SetKeyWithRounds"></a>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea27">SetKeyWithRounds</a> (const byte *key, unsigned int length, int rounds)</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::SetKeyWithIV"></a>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea28">SetKeyWithIV</a> (const byte *key, unsigned int length, const byte *iv)</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::IVRequirement"></a>virtual IV_Requirement </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea29">IVRequirement</a> () const=0</td></tr><tr><td class="mdescLeft"> </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 </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea30">IsResynchronizable</a> () const</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::CanUseRandomIVs"></a>bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea31">CanUseRandomIVs</a> () const</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::CanUsePredictableIVs"></a>bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea32">CanUsePredictableIVs</a> () const</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::CanUseStructuredIVs"></a>bool </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_c___basea33">CanUseStructuredIVs</a> () const</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::IVSize"></a>virtual unsigned int </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_ca32">IVSize</a> () const</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::Resynchronize"></a>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_ca33">Resynchronize</a> (const byte *IV)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">resynchronize with an IV <br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_simple_keying_interface.html#_x_m_a_c_ca34">GetNextIV</a> (byte *IV)</td></tr><tr><td class="mdescLeft"> </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="SimpleKeyingInterface::ThrowIfInvalidKeyLength"></a>void </td><td class="memItemRight" valign=bottom><b>ThrowIfInvalidKeyLength</b> (const <a class="el" href="class_algorithm.html">Algorithm</a> &algorithm, unsigned int length)</td></tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -