Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > 07dfcfe50d66c9a48a3c5e6c1693f12a > files > 2435

cryptopp-doc-5.6.1-0.1.svn479.fc13.i686.rpm

<!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"/>
<title>Crypto++: xtrcrypt.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.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&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;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">        &quot;The XTR public key system&quot; 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 &quot;<a class="code" href="xtr_8h.html" title="&amp;quot;The XTR public key system&amp;quot; by Arjen K.">xtr.h</a>&quot;</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> &amp;p, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;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> &amp;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> &amp;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> &amp;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> &amp;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> &amp;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 &amp;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> &amp;source);
<a name="l00028"></a>00028         CryptoParameters &amp; 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#abc1e1ffa5ef284a2eb001487d8d83283">00029</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_x_t_r___d_h.html#abc1e1ffa5ef284a2eb001487d8d83283" title="return length of agreed value produced">AgreedValueLength</a>()<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#a58f718388a09fc5b254ea50492517dbd">00030</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_x_t_r___d_h.html#a58f718388a09fc5b254ea50492517dbd" title="return length of private keys in this domain">PrivateKeyLength</a>()<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#a00ff72c1d7f0b3f8b6d2e21b90214c17">00031</a>         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_x_t_r___d_h.html#a00ff72c1d7f0b3f8b6d2e21b90214c17" title="return length of public keys in this domain">PublicKeyLength</a>()<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> &amp;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> &amp;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>00037         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;GetModulus()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_p;}
<a name="l00038"></a>00038         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;GetSubgroupOrder()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_q;}
<a name="l00039"></a>00039         <span class="keyword">const</span> <a class="code" href="class_g_f_p2_element.html" title="an element of GF(p^2)">GFP2Element</a> &amp;GetSubgroupGenerator()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_g;}
<a name="l00040"></a>00040 
<a name="l00041"></a>00041         <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> &amp;p) {m_p = p;}
<a name="l00042"></a>00042         <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> &amp;q) {m_q = q;}
<a name="l00043"></a>00043         <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> &amp;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></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 9 Dec 2009 for Crypto++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>