Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 23e07fd43e778a61ff4b78161a3e2389 > files > 1927

cryptopp-doc-5.6.1-5.fc14.noarch.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++: rw.cpp 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.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Crypto++</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">rw.cpp</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// rw.cpp - written and placed in the public domain by Wei Dai</span>
<a name="l00002"></a>00002 
<a name="l00003"></a>00003 <span class="preprocessor">#include &quot;pch.h&quot;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;<a class="code" href="rw_8h.html" title="This file contains classes that implement the Rabin-Williams signature schemes as defined in IEEE P13...">rw.h</a>&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;nbtheory.h&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;asn.h&quot;</span>
<a name="l00007"></a>00007 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef CRYPTOPP_IMPORTS</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span>
<a name="l00010"></a>00010 NAMESPACE_BEGIN(CryptoPP)
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 void <a class="code" href="class_r_w_function.html" title="_">RWFunction</a>::BERDecode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt)
<a name="l00013"></a>00013 {
<a name="l00014"></a>00014         <a class="code" href="class_b_e_r_sequence_decoder.html" title="BER Sequence Decoder.">BERSequenceDecoder</a> seq(bt);
<a name="l00015"></a>00015         m_n.BERDecode(seq);
<a name="l00016"></a>00016         seq.MessageEnd();
<a name="l00017"></a>00017 }
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="keywordtype">void</span> RWFunction::DEREncode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt)<span class="keyword"> const</span>
<a name="l00020"></a>00020 <span class="keyword"></span>{
<a name="l00021"></a>00021         <a class="code" href="class_d_e_r_sequence_encoder.html" title="DER Sequence Encoder.">DERSequenceEncoder</a> seq(bt);
<a name="l00022"></a>00022         m_n.<a class="code" href="class_integer.html#a6ab51a05bee88cfa690179611e8a084e" title="encode using Distinguished Encoding Rules, put result into a BufferedTransformation object...">DEREncode</a>(seq);
<a name="l00023"></a>00023         seq.MessageEnd();
<a name="l00024"></a>00024 }
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> RWFunction::ApplyFunction(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;in)<span class="keyword"> const</span>
<a name="l00027"></a>00027 <span class="keyword"></span>{
<a name="l00028"></a>00028         DoQuickSanityCheck();
<a name="l00029"></a>00029 
<a name="l00030"></a>00030         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> out = in.Squared()%m_n;
<a name="l00031"></a>00031         <span class="keyword">const</span> word r = 12;
<a name="l00032"></a>00032         <span class="comment">// this code was written to handle both r = 6 and r = 12,</span>
<a name="l00033"></a>00033         <span class="comment">// but now only r = 12 is used in P1363</span>
<a name="l00034"></a>00034         <span class="keyword">const</span> word r2 = r/2;
<a name="l00035"></a>00035         <span class="keyword">const</span> word r3a = (16 + 5 - r) % 16;     <span class="comment">// n%16 could be 5 or 13</span>
<a name="l00036"></a>00036         <span class="keyword">const</span> word r3b = (16 + 13 - r) % 16;
<a name="l00037"></a>00037         <span class="keyword">const</span> word r4 = (8 + 5 - r/2) % 8;      <span class="comment">// n%8 == 5</span>
<a name="l00038"></a>00038         <span class="keywordflow">switch</span> (out % 16)
<a name="l00039"></a>00039         {
<a name="l00040"></a>00040         <span class="keywordflow">case</span> r:
<a name="l00041"></a>00041                 <span class="keywordflow">break</span>;
<a name="l00042"></a>00042         <span class="keywordflow">case</span> r2:
<a name="l00043"></a>00043         <span class="keywordflow">case</span> r2+8:
<a name="l00044"></a>00044                 out &lt;&lt;= 1;
<a name="l00045"></a>00045                 <span class="keywordflow">break</span>;
<a name="l00046"></a>00046         <span class="keywordflow">case</span> r3a:
<a name="l00047"></a>00047         <span class="keywordflow">case</span> r3b:
<a name="l00048"></a>00048                 out.Negate();
<a name="l00049"></a>00049                 out += m_n;
<a name="l00050"></a>00050                 <span class="keywordflow">break</span>;
<a name="l00051"></a>00051         <span class="keywordflow">case</span> r4:
<a name="l00052"></a>00052         <span class="keywordflow">case</span> r4+8:
<a name="l00053"></a>00053                 out.Negate();
<a name="l00054"></a>00054                 out += m_n;
<a name="l00055"></a>00055                 out &lt;&lt;= 1;
<a name="l00056"></a>00056                 <span class="keywordflow">break</span>;
<a name="l00057"></a>00057         <span class="keywordflow">default</span>:
<a name="l00058"></a>00058                 out = <a class="code" href="class_integer.html#a19b7e6d48b1b57bd4846160ea2928175" title="avoid calling constructors for these frequently used integers">Integer::Zero</a>();
<a name="l00059"></a>00059         }
<a name="l00060"></a>00060         <span class="keywordflow">return</span> out;
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 
<a name="l00063"></a><a class="code" href="class_r_w_function.html#a6280452ff21d540667c6b3f08faba0c9">00063</a> <span class="keywordtype">bool</span> <a class="code" href="class_r_w_function.html#a6280452ff21d540667c6b3f08faba0c9" title="check this object for errors">RWFunction::Validate</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> level)<span class="keyword"> const</span>
<a name="l00064"></a>00064 <span class="keyword"></span>{
<a name="l00065"></a>00065         <span class="keywordtype">bool</span> pass = <span class="keyword">true</span>;
<a name="l00066"></a>00066         pass = pass &amp;&amp; m_n &gt; <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638" title="avoid calling constructors for these frequently used integers">Integer::One</a>() &amp;&amp; m_n%8 == 5;
<a name="l00067"></a>00067         <span class="keywordflow">return</span> pass;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 
<a name="l00070"></a><a class="code" href="class_r_w_function.html#a0c9efa849855d8aa9c907d84d3aebd42">00070</a> <span class="keywordtype">bool</span> <a class="code" href="class_r_w_function.html#a0c9efa849855d8aa9c907d84d3aebd42" title="to be implemented by derived classes, users should use one of the above functions instead...">RWFunction::GetVoidValue</a>(<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="l00071"></a>00071 <span class="keyword"></span>{
<a name="l00072"></a>00072         <span class="keywordflow">return</span> GetValueHelper(<span class="keyword">this</span>, name, valueType, pValue).Assignable()
<a name="l00073"></a>00073                 CRYPTOPP_GET_FUNCTION_ENTRY(Modulus)
<a name="l00074"></a>00074                 ;
<a name="l00075"></a>00075 }
<a name="l00076"></a>00076 
<a name="l00077"></a><a class="code" href="class_r_w_function.html#a99293c55c055b338bd7c783a7b8c0484">00077</a> <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#a99293c55c055b338bd7c783a7b8c0484" title="assign values from source to this object">RWFunction::AssignFrom</a>(<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="l00078"></a>00078 {
<a name="l00079"></a>00079         AssignFromHelper(<span class="keyword">this</span>, source)
<a name="l00080"></a>00080                 CRYPTOPP_SET_FUNCTION_ENTRY(Modulus)
<a name="l00081"></a>00081                 ;
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="comment">// *****************************************************************************</span>
<a name="l00085"></a>00085 <span class="comment">// private key operations:</span>
<a name="l00086"></a>00086 
<a name="l00087"></a>00087 <span class="comment">// generate a random private key</span>
<a name="l00088"></a><a class="code" href="class_invertible_r_w_function.html#a8953bb59727e0ae2d79071874a793c48">00088</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a8953bb59727e0ae2d79071874a793c48">InvertibleRWFunction::GenerateRandom</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <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;alg)
<a name="l00089"></a>00089 {
<a name="l00090"></a>00090         <span class="keywordtype">int</span> modulusSize = 2048;
<a name="l00091"></a>00091         alg.<a class="code" href="class_name_value_pairs.html#a39b6daefcabcdd07f5ae482a075e1728" title="get a named value with type int">GetIntValue</a>(<span class="stringliteral">&quot;ModulusSize&quot;</span>, modulusSize) || alg.<a class="code" href="class_name_value_pairs.html#a39b6daefcabcdd07f5ae482a075e1728" title="get a named value with type int">GetIntValue</a>(<span class="stringliteral">&quot;KeySize&quot;</span>, modulusSize);
<a name="l00092"></a>00092 
<a name="l00093"></a>00093         <span class="keywordflow">if</span> (modulusSize &lt; 16)
<a name="l00094"></a>00094                 <span class="keywordflow">throw</span> <a class="code" href="class_invalid_argument.html" title="exception thrown when an invalid argument is detected">InvalidArgument</a>(<span class="stringliteral">&quot;InvertibleRWFunction: specified modulus length is too small&quot;</span>);
<a name="l00095"></a>00095 
<a name="l00096"></a>00096         <a class="code" href="class_algorithm_parameters.html">AlgorithmParameters</a> primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize);
<a name="l00097"></a>00097         m_p.GenerateRandom(rng, <a class="code" href="class_combined_name_value_pairs.html">CombinedNameValuePairs</a>(primeParam, MakeParameters(<span class="stringliteral">&quot;EquivalentTo&quot;</span>, 3)(<span class="stringliteral">&quot;Mod&quot;</span>, 8)));
<a name="l00098"></a>00098         m_q.GenerateRandom(rng, <a class="code" href="class_combined_name_value_pairs.html">CombinedNameValuePairs</a>(primeParam, MakeParameters(<span class="stringliteral">&quot;EquivalentTo&quot;</span>, 7)(<span class="stringliteral">&quot;Mod&quot;</span>, 8)));
<a name="l00099"></a>00099 
<a name="l00100"></a>00100         m_n = m_p * m_q;
<a name="l00101"></a>00101         m_u = m_q.<a class="code" href="class_integer.html#a881f9c714ee42f35718725a43d4d7db3" title="calculate multiplicative inverse of *this mod n">InverseMod</a>(m_p);
<a name="l00102"></a>00102 }
<a name="l00103"></a>00103 
<a name="l00104"></a>00104 <span class="keywordtype">void</span> InvertibleRWFunction::BERDecode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt)
<a name="l00105"></a>00105 {
<a name="l00106"></a>00106         <a class="code" href="class_b_e_r_sequence_decoder.html" title="BER Sequence Decoder.">BERSequenceDecoder</a> seq(bt);
<a name="l00107"></a>00107         m_n.BERDecode(seq);
<a name="l00108"></a>00108         m_p.BERDecode(seq);
<a name="l00109"></a>00109         m_q.BERDecode(seq);
<a name="l00110"></a>00110         m_u.BERDecode(seq);
<a name="l00111"></a>00111         seq.MessageEnd();
<a name="l00112"></a>00112 }
<a name="l00113"></a>00113 
<a name="l00114"></a>00114 <span class="keywordtype">void</span> InvertibleRWFunction::DEREncode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt)<span class="keyword"> const</span>
<a name="l00115"></a>00115 <span class="keyword"></span>{
<a name="l00116"></a>00116         <a class="code" href="class_d_e_r_sequence_encoder.html" title="DER Sequence Encoder.">DERSequenceEncoder</a> seq(bt);
<a name="l00117"></a>00117         m_n.<a class="code" href="class_integer.html#a6ab51a05bee88cfa690179611e8a084e" title="encode using Distinguished Encoding Rules, put result into a BufferedTransformation object...">DEREncode</a>(seq);
<a name="l00118"></a>00118         m_p.<a class="code" href="class_integer.html#a6ab51a05bee88cfa690179611e8a084e" title="encode using Distinguished Encoding Rules, put result into a BufferedTransformation object...">DEREncode</a>(seq);
<a name="l00119"></a>00119         m_q.<a class="code" href="class_integer.html#a6ab51a05bee88cfa690179611e8a084e" title="encode using Distinguished Encoding Rules, put result into a BufferedTransformation object...">DEREncode</a>(seq);
<a name="l00120"></a>00120         m_u.<a class="code" href="class_integer.html#a6ab51a05bee88cfa690179611e8a084e" title="encode using Distinguished Encoding Rules, put result into a BufferedTransformation object...">DEREncode</a>(seq);
<a name="l00121"></a>00121         seq.MessageEnd();
<a name="l00122"></a>00122 }
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> InvertibleRWFunction::CalculateInverse(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;x)<span class="keyword"> const</span>
<a name="l00125"></a>00125 <span class="keyword"></span>{
<a name="l00126"></a>00126         DoQuickSanityCheck();
<a name="l00127"></a>00127         <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">ModularArithmetic</a> modn(m_n);
<a name="l00128"></a>00128         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> r, rInv;
<a name="l00129"></a>00129         <span class="keywordflow">do</span> {    <span class="comment">// do this in a loop for people using small numbers for testing</span>
<a name="l00130"></a>00130                 r.Randomize(rng, <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638" title="avoid calling constructors for these frequently used integers">Integer::One</a>(), m_n - <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638" title="avoid calling constructors for these frequently used integers">Integer::One</a>());
<a name="l00131"></a>00131                 rInv = modn.<a class="code" href="class_integer.html#a94954b3df8073387d225be1033b0fa5b" title="return inverse if 1 or -1, otherwise return 0">MultiplicativeInverse</a>(r);
<a name="l00132"></a>00132         } <span class="keywordflow">while</span> (rInv.IsZero());
<a name="l00133"></a>00133         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> re = modn.Square(r);
<a name="l00134"></a>00134         re = modn.Multiply(re, x);                      <span class="comment">// blind</span>
<a name="l00135"></a>00135 
<a name="l00136"></a>00136         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> cp=re%m_p, cq=re%m_q;
<a name="l00137"></a>00137         <span class="keywordflow">if</span> (Jacobi(cp, m_p) * Jacobi(cq, m_q) != 1)
<a name="l00138"></a>00138         {
<a name="l00139"></a>00139                 cp = cp.IsOdd() ? (cp+m_p) &gt;&gt; 1 : cp &gt;&gt; 1;
<a name="l00140"></a>00140                 cq = cq.IsOdd() ? (cq+m_q) &gt;&gt; 1 : cq &gt;&gt; 1;
<a name="l00141"></a>00141         }
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 <span class="preprocessor">        #pragma omp parallel</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor">                #pragma omp sections</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span>                {
<a name="l00146"></a>00146 <span class="preprocessor">                        #pragma omp section</span>
<a name="l00147"></a>00147 <span class="preprocessor"></span>                                cp = ModularSquareRoot(cp, m_p);
<a name="l00148"></a>00148 <span class="preprocessor">                        #pragma omp section</span>
<a name="l00149"></a>00149 <span class="preprocessor"></span>                                cq = ModularSquareRoot(cq, m_q);
<a name="l00150"></a>00150                 }
<a name="l00151"></a>00151 
<a name="l00152"></a>00152         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> y = CRT(cq, m_q, cp, m_p, m_u);
<a name="l00153"></a>00153         y = modn.Multiply(y, rInv);                             <span class="comment">// unblind</span>
<a name="l00154"></a>00154         y = STDMIN(y, m_n-y);
<a name="l00155"></a>00155         <span class="keywordflow">if</span> (ApplyFunction(y) != x)                              <span class="comment">// check</span>
<a name="l00156"></a>00156                 <span class="keywordflow">throw</span> <a class="code" href="class_exception.html" title="base class for all exceptions thrown by Crypto++">Exception</a>(<a class="code" href="class_exception.html#a8e53909d979479380e0274807c074c0aa27d9ee7704100a88e4ae4adcc4072015" title="some error not belong to any of the above categories">Exception::OTHER_ERROR</a>, <span class="stringliteral">&quot;InvertibleRWFunction: computational error during private key operation&quot;</span>);
<a name="l00157"></a>00157         <span class="keywordflow">return</span> y;
<a name="l00158"></a>00158 }
<a name="l00159"></a>00159 
<a name="l00160"></a><a class="code" href="class_invertible_r_w_function.html#a7f5052834d9716bfc3a5585c6addbd46">00160</a> <span class="keywordtype">bool</span> <a class="code" href="class_invertible_r_w_function.html#a7f5052834d9716bfc3a5585c6addbd46" title="check this object for errors">InvertibleRWFunction::Validate</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> level)<span class="keyword"> const</span>
<a name="l00161"></a>00161 <span class="keyword"></span>{
<a name="l00162"></a>00162         <span class="keywordtype">bool</span> pass = <a class="code" href="class_invertible_r_w_function.html#a7f5052834d9716bfc3a5585c6addbd46" title="check this object for errors">RWFunction::Validate</a>(rng, level);
<a name="l00163"></a>00163         pass = pass &amp;&amp; m_p &gt; <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638" title="avoid calling constructors for these frequently used integers">Integer::One</a>() &amp;&amp; m_p%8 == 3 &amp;&amp; m_p &lt; m_n;
<a name="l00164"></a>00164         pass = pass &amp;&amp; m_q &gt; <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638" title="avoid calling constructors for these frequently used integers">Integer::One</a>() &amp;&amp; m_q%8 == 7 &amp;&amp; m_q &lt; m_n;
<a name="l00165"></a>00165         pass = pass &amp;&amp; m_u.IsPositive() &amp;&amp; m_u &lt; m_p;
<a name="l00166"></a>00166         <span class="keywordflow">if</span> (level &gt;= 1)
<a name="l00167"></a>00167         {
<a name="l00168"></a>00168                 pass = pass &amp;&amp; m_p * m_q == m_n;
<a name="l00169"></a>00169                 pass = pass &amp;&amp; m_u * m_q % m_p == 1;
<a name="l00170"></a>00170         }
<a name="l00171"></a>00171         <span class="keywordflow">if</span> (level &gt;= 2)
<a name="l00172"></a>00172                 pass = pass &amp;&amp; VerifyPrime(rng, m_p, level-2) &amp;&amp; VerifyPrime(rng, m_q, level-2);
<a name="l00173"></a>00173         <span class="keywordflow">return</span> pass;
<a name="l00174"></a>00174 }
<a name="l00175"></a>00175 
<a name="l00176"></a><a class="code" href="class_invertible_r_w_function.html#abd17ed1b135d340abc325046eebef6ac">00176</a> <span class="keywordtype">bool</span> <a class="code" href="class_invertible_r_w_function.html#abd17ed1b135d340abc325046eebef6ac" title="to be implemented by derived classes, users should use one of the above functions instead...">InvertibleRWFunction::GetVoidValue</a>(<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="l00177"></a>00177 <span class="keyword"></span>{
<a name="l00178"></a>00178         <span class="keywordflow">return</span> GetValueHelper&lt;RWFunction&gt;(<span class="keyword">this</span>, name, valueType, pValue).Assignable()
<a name="l00179"></a>00179                 CRYPTOPP_GET_FUNCTION_ENTRY(Prime1)
<a name="l00180"></a>00180                 CRYPTOPP_GET_FUNCTION_ENTRY(Prime2)
<a name="l00181"></a>00181                 CRYPTOPP_GET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1)
<a name="l00182"></a>00182                 ;
<a name="l00183"></a>00183 }
<a name="l00184"></a>00184 
<a name="l00185"></a><a class="code" href="class_invertible_r_w_function.html#a56b0314b678c58228671d3c9049f86db">00185</a> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a56b0314b678c58228671d3c9049f86db" title="assign values from source to this object">InvertibleRWFunction::AssignFrom</a>(<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="l00186"></a>00186 {
<a name="l00187"></a>00187         AssignFromHelper&lt;RWFunction&gt;(<span class="keyword">this</span>, source)
<a name="l00188"></a>00188                 CRYPTOPP_SET_FUNCTION_ENTRY(Prime1)
<a name="l00189"></a>00189                 CRYPTOPP_SET_FUNCTION_ENTRY(Prime2)
<a name="l00190"></a>00190                 CRYPTOPP_SET_FUNCTION_ENTRY(MultiplicativeInverseOfPrime2ModPrime1)
<a name="l00191"></a>00191                 ;
<a name="l00192"></a>00192 }
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 NAMESPACE_END
<a name="l00195"></a>00195 
<a name="l00196"></a>00196 <span class="preprocessor">#endif</span>
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Sun Oct 16 2011 for Crypto++ by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>