📄 xtrcrypt_8h-source.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++: xtrcrypt.h Source File</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><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul></div><div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul></div><h1>xtrcrypt.h</h1><a href="xtrcrypt_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_XTRCRYPT_H</span><a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_XTRCRYPT_H</span><a name="l00003"></a>00003 <span class="preprocessor"></span><span class="comment"></span><a name="l00004"></a>00004 <span class="comment">/** \file</span><a name="l00005"></a>00005 <span class="comment"> "The XTR public key system" by Arjen K. Lenstra and Eric R. Verheul</span><a name="l00006"></a>00006 <span class="comment">*/</span><a name="l00007"></a>00007 <a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="xtr_8h.html" title=""The XTR public key system" by Arjen K.">xtr.h</a>"</span><a name="l00009"></a>00009 <a name="l00010"></a>00010 NAMESPACE_BEGIN(CryptoPP)<a name="l00011"></a>00011 <a name="l00012"></a>00012 <span class="comment">//! XTR-DH with key validation</span><a name="l00013"></a>00013 <span class="comment"></span><a name="l00014"></a><a class="code" href="class_x_t_r___d_h.html">00014</a> class <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">XTR_DH</a> : public <a class="code" href="class_simple_key_agreement_domain.html" title="interface for domains of simple key agreement protocols">SimpleKeyAgreementDomain</a>, public <a class="code" href="class_crypto_parameters.html" title="interface for crypto prameters">CryptoParameters</a><a name="l00015"></a>00015 {<a name="l00016"></a>00016 <span class="keyword">typedef</span> <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">XTR_DH</a> <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">ThisClass</a>;<a name="l00017"></a>00017 <a name="l00018"></a>00018 <span class="keyword">public</span>:<a name="l00019"></a>00019 <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">XTR_DH</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q, <span class="keyword">const</span> <a class="code" href="class_g_f_p2_element.html" title="an element of GF(p^2)">GFP2Element</a> &g);<a name="l00020"></a>00020 <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">XTR_DH</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pbits, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> qbits);<a name="l00021"></a>00021 <a class="code" href="class_x_t_r___d_h.html" title="XTR-DH with key validation.">XTR_DH</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &domainParams);<a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="keywordtype">void</span> DEREncode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &domainParams) <span class="keyword">const</span>;<a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="keywordtype">bool</span> Validate(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level) <span class="keyword">const</span>;<a name="l00026"></a>00026 <span class="keywordtype">bool</span> GetVoidValue(<span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> std::type_info &valueType, <span class="keywordtype">void</span> *pValue) <span class="keyword">const</span>;<a name="l00027"></a>00027 <span class="keywordtype">void</span> AssignFrom(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html" title="interface for retrieving values given their names">NameValuePairs</a> &source);<a name="l00028"></a><a class="code" href="class_x_t_r___d_h.html#c8961d7753053e451e951ad8ba808582">00028</a> CryptoParameters & AccessCryptoParameters() {<span class="keywordflow">return</span> *<span class="keyword">this</span>;}<a name="l00029"></a><a class="code" href="class_x_t_r___d_h.html#68d30b38dde37f451a539d0d1907408d">00029</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> AgreedValueLength()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 2*m_p.ByteCount();}<a name="l00030"></a><a class="code" href="class_x_t_r___d_h.html#e3f6c87695d27b57f218daa0a7a19a6b">00030</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> PrivateKeyLength()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_q.ByteCount();}<a name="l00031"></a><a class="code" href="class_x_t_r___d_h.html#d8086f9959a856e7c1279b18af566b6c">00031</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> PublicKeyLength()<span class="keyword"> const </span>{<span class="keywordflow">return</span> 2*m_p.ByteCount();}<a name="l00032"></a>00032 <a name="l00033"></a>00033 <span class="keywordtype">void</span> GeneratePrivateKey(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, byte *privateKey) <span class="keyword">const</span>;<a name="l00034"></a>00034 <span class="keywordtype">void</span> GeneratePublicKey(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> byte *privateKey, byte *publicKey) <span class="keyword">const</span>;<a name="l00035"></a>00035 <span class="keywordtype">bool</span> Agree(byte *agreedValue, <span class="keyword">const</span> byte *privateKey, <span class="keyword">const</span> byte *otherPublicKey, <span class="keywordtype">bool</span> validateOtherPublicKey=<span class="keyword">true</span>) <span class="keyword">const</span>;<a name="l00036"></a>00036 <a name="l00037"></a><a class="code" href="class_x_t_r___d_h.html#d7ae6a2f100dd44708abf51e12ad9d9a">00037</a> <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &GetModulus()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_p;}<a name="l00038"></a><a class="code" href="class_x_t_r___d_h.html#54ad5c5da5e6e8f50294a25f1622e4bd">00038</a> <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &GetSubgroupOrder()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_q;}<a name="l00039"></a><a class="code" href="class_x_t_r___d_h.html#10bb4bfec12520d0874287173cc9e0fe">00039</a> <span class="keyword">const</span> <a class="code" href="class_g_f_p2_element.html" title="an element of GF(p^2)">GFP2Element</a> &GetSubgroupGenerator()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_g;}<a name="l00040"></a>00040 <a name="l00041"></a><a class="code" href="class_x_t_r___d_h.html#de9c4eff843a1c2fd08e82b3a2a1fc43">00041</a> <span class="keywordtype">void</span> SetModulus(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p) {m_p = p;}<a name="l00042"></a><a class="code" href="class_x_t_r___d_h.html#74093256e7be4e3f10d512b2edbfdbbd">00042</a> <span class="keywordtype">void</span> SetSubgroupOrder(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q) {m_q = q;}<a name="l00043"></a><a class="code" href="class_x_t_r___d_h.html#f009d4699f4c7c427c799c5967eae47d">00043</a> <span class="keywordtype">void</span> SetSubgroupGenerator(<span class="keyword">const</span> <a class="code" href="class_g_f_p2_element.html" title="an element of GF(p^2)">GFP2Element</a> &g) {m_g = g;}<a name="l00044"></a>00044 <a name="l00045"></a>00045 <span class="keyword">private</span>:<a name="l00046"></a>00046 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ExponentBitLength() <span class="keyword">const</span>;<a name="l00047"></a>00047 <a name="l00048"></a>00048 <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> m_p, m_q;<a name="l00049"></a>00049 <a class="code" href="class_g_f_p2_element.html" title="an element of GF(p^2)">GFP2Element</a> m_g;<a name="l00050"></a>00050 };<a name="l00051"></a>00051 <a name="l00052"></a>00052 NAMESPACE_END<a name="l00053"></a>00053 <a name="l00054"></a>00054 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:26 2007 for Crypto++ by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -