<!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++: rw.cpp Source File</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="headertitle"> <div class="title">rw.cpp</div> </div> </div><!--header--> <div class="contents"> <div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// rw.cpp - originally written and placed in the public domain by Wei Dai</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> </div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="preprocessor">#include "<a class="code" href="pch_8h.html">pch.h</a>"</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> </div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#include "<a class="code" href="rw_8h.html">rw.h</a>"</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#include "<a class="code" href="asn_8h.html">asn.h</a>"</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include "<a class="code" href="integer_8h.html">integer.h</a>"</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "<a class="code" href="nbtheory_8h.html">nbtheory.h</a>"</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include "<a class="code" href="modarith_8h.html">modarith.h</a>"</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include "<a class="code" href="asn_8h.html">asn.h</a>"</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#ifndef CRYPTOPP_IMPORTS</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#if defined(_OPENMP)</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> CRYPTOPP_RW_USE_OMP = <span class="keyword">true</span>;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#else</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> CRYPTOPP_RW_USE_OMP = <span class="keyword">false</span>;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> NAMESPACE_BEGIN(<a class="code" href="namespace_crypto_p_p.html">CryptoPP</a>)</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="keywordtype">void</span> RWFunction::BERDecode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <a class="code" href="class_b_e_r_sequence_decoder.html">BERSequenceDecoder</a> seq(bt);</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  m_n.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  seq.MessageEnd();</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> }</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="keywordtype">void</span> RWFunction::DEREncode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)<span class="keyword"> const</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword"></span>{</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <a class="code" href="class_d_e_r_sequence_encoder.html">DERSequenceEncoder</a> seq(bt);</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  m_n.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  seq.MessageEnd();</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="class_r_w_function.html#a37cf8dd12263547a61890f8409a3d4d5"> 36</a></span> <a class="code" href="class_integer.html">Integer</a> <a class="code" href="class_r_w_function.html#a37cf8dd12263547a61890f8409a3d4d5">RWFunction::ApplyFunction</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &in)<span class="keyword"> const</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword"></span>{</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="class_crypto_material.html#aa1da44802c5cf00946043922cb9e7e6e">DoQuickSanityCheck</a>();</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <a class="code" href="class_integer.html">Integer</a> out = in.<a class="code" href="class_integer.html#a7b5e639045868c5ac338f4180e1c7efa">Squared</a>()%m_n;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keyword">const</span> word r = 12;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="comment">// this code was written to handle both r = 6 and r = 12,</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="comment">// but now only r = 12 is used in P1363</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">const</span> word r2 = r/2;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">const</span> word r3a = (16 + 5 - r) % 16; <span class="comment">// n%16 could be 5 or 13</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keyword">const</span> word r3b = (16 + 13 - r) % 16;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">const</span> word r4 = (8 + 5 - r/2) % 8; <span class="comment">// n%8 == 5</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordflow">switch</span> (out % 16)</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">case</span> r:</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">case</span> r2:</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">case</span> r2+8:</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  out <<= 1;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">case</span> r3a:</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keywordflow">case</span> r3b:</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  out.<a class="code" href="class_integer.html#a87410093addf9a2253fe07b39b918b02">Negate</a>();</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  out += m_n;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">case</span> r4:</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">case</span> r4+8:</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  out.<a class="code" href="class_integer.html#a87410093addf9a2253fe07b39b918b02">Negate</a>();</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  out += m_n;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  out <<= 1;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  out = <a class="code" href="class_integer.html#a19b7e6d48b1b57bd4846160ea2928175">Integer::Zero</a>();</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">return</span> out;</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> }</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="class_r_w_function.html#af326ae91ff9d6719c879861d21d380ac"> 73</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_r_w_function.html#af326ae91ff9d6719c879861d21d380ac">RWFunction::Validate</a>(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level)<span class="keyword"> const</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="keyword"></span>{</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  CRYPTOPP_UNUSED(rng), CRYPTOPP_UNUSED(level);</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="keywordtype">bool</span> pass = <span class="keyword">true</span>;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  pass = pass && m_n > <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>() && m_n%8 == 5;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">return</span> pass;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> }</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="class_r_w_function.html#aa0b787a1b8a8afbf430fafe53d6cb4a7"> 82</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_r_w_function.html#aa0b787a1b8a8afbf430fafe53d6cb4a7">RWFunction::GetVoidValue</a>(<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></div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keyword"></span>{</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> GetValueHelper(<span class="keyword">this</span>, name, valueType, pValue).Assignable()</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  CRYPTOPP_GET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a7e07afb1cbb505fa8cf1b93e67f4782d">Modulus</a>)</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  ;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"><a class="line" href="class_r_w_function.html#a99293c55c055b338bd7c783a7b8c0484"> 89</a></span> <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#a99293c55c055b338bd7c783a7b8c0484">RWFunction::AssignFrom</a>(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &source)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> {</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  AssignFromHelper(<span class="keyword">this</span>, source)</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  CRYPTOPP_SET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a7e07afb1cbb505fa8cf1b93e67f4782d">Modulus</a>)</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  ;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="comment">// *****************************************************************************</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="comment">// private key operations:</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment">// generate a random private key</span></div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a8953bb59727e0ae2d79071874a793c48"> 100</a></span> <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">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &alg)</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> {</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordtype">int</span> modulusSize = 2048;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  alg.<a class="code" href="class_name_value_pairs.html#a94e5b19dc54625799797668ff8627c57">GetIntValue</a>(<span class="stringliteral">"ModulusSize"</span>, modulusSize) || alg.<a class="code" href="class_name_value_pairs.html#a94e5b19dc54625799797668ff8627c57">GetIntValue</a>(<span class="stringliteral">"KeySize"</span>, modulusSize);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keywordflow">if</span> (modulusSize < 16)</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keywordflow">throw</span> <a class="code" href="class_invalid_argument.html">InvalidArgument</a>(<span class="stringliteral">"InvertibleRWFunction: specified modulus length is too small"</span>);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> </div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <a class="code" href="class_algorithm_parameters.html">AlgorithmParameters</a> primeParam = MakeParametersForTwoPrimesOfEqualSize(modulusSize);</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  m_p.<a class="code" href="class_integer.html#a0d9a427fe64a454b11b24fe61c10dbeb">GenerateRandom</a>(rng, <a class="code" href="class_combined_name_value_pairs.html">CombinedNameValuePairs</a>(primeParam, <a class="code" href="algparam_8h.html#aa13eee74de98cf8aaa7e83f4fae7f28b">MakeParameters</a>(<span class="stringliteral">"EquivalentTo"</span>, 3)(<span class="stringliteral">"Mod"</span>, 8)));</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  m_q.<a class="code" href="class_integer.html#a0d9a427fe64a454b11b24fe61c10dbeb">GenerateRandom</a>(rng, <a class="code" href="class_combined_name_value_pairs.html">CombinedNameValuePairs</a>(primeParam, <a class="code" href="algparam_8h.html#aa13eee74de98cf8aaa7e83f4fae7f28b">MakeParameters</a>(<span class="stringliteral">"EquivalentTo"</span>, 7)(<span class="stringliteral">"Mod"</span>, 8)));</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  m_n = m_p * m_q;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  m_u = m_q.<a class="code" href="class_integer.html#af805574831ce19221692966e6217e6e0">InverseMod</a>(m_p);</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <a class="code" href="class_invertible_r_w_function.html#ac342086a1eb669da37bafa45572f08b9">Precompute</a>();</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a6087d4bf788bd6beab89699eb7069b86"> 118</a></span> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a6087d4bf788bd6beab89699eb7069b86">InvertibleRWFunction::Initialize</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &n, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &p, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &q, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &u)</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> {</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  m_n = n; m_p = p; m_q = q; m_u = u;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <a class="code" href="class_invertible_r_w_function.html#ac342086a1eb669da37bafa45572f08b9">Precompute</a>();</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> }</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">void</span> InvertibleRWFunction::PrecomputeTweakedRoots()<span class="keyword"> const</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="keyword"></span>{</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="class_modular_arithmetic.html">ModularArithmetic</a> modp(m_p), modq(m_q);</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="preprocessor"> #pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  {</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="preprocessor"> #pragma omp section</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  m_pre_2_9p = modp.Exponentiate(2, (9 * m_p - 11)/8);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="preprocessor"> #pragma omp section</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  m_pre_2_3q = modq.Exponentiate(2, (3 * m_q - 5)/8);</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="preprocessor"> #pragma omp section</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  m_pre_q_p = modp.Exponentiate(m_q, m_p - 2);</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  m_precompute = <span class="keyword">true</span>;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> }</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> </div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a9960b78b03de88ace2fde8b99f517722"> 142</a></span> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a9960b78b03de88ace2fde8b99f517722">InvertibleRWFunction::LoadPrecomputation</a>(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> {</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="class_b_e_r_sequence_decoder.html">BERSequenceDecoder</a> seq(bt);</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  m_pre_2_9p.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  m_pre_2_3q.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  m_pre_q_p.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  seq.MessageEnd();</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  m_precompute = <span class="keyword">true</span>;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> }</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span> </div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a0e54f331b0e4ee2fc99cb36dc6919039"> 153</a></span> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a0e54f331b0e4ee2fc99cb36dc6919039">InvertibleRWFunction::SavePrecomputation</a>(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)<span class="keyword"> const</span></div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="keyword"></span>{</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  <span class="keywordflow">if</span>(!m_precompute)</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <a class="code" href="class_invertible_r_w_function.html#ac342086a1eb669da37bafa45572f08b9">Precompute</a>();</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> </div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <a class="code" href="class_d_e_r_sequence_encoder.html">DERSequenceEncoder</a> seq(bt);</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  m_pre_2_9p.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  m_pre_2_3q.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  m_pre_q_p.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  seq.MessageEnd();</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> }</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span> <span class="keywordtype">void</span> InvertibleRWFunction::BERDecode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> {</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <a class="code" href="class_b_e_r_sequence_decoder.html">BERSequenceDecoder</a> seq(bt);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  m_n.BERDecode(seq);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  m_p.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  m_q.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  m_u.<a class="code" href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">BERDecode</a>(seq);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  seq.MessageEnd();</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> </div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  m_precompute = <span class="keyword">false</span>;</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> }</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> <span class="keywordtype">void</span> InvertibleRWFunction::DEREncode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt)<span class="keyword"> const</span></div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="keyword"></span>{</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <a class="code" href="class_d_e_r_sequence_encoder.html">DERSequenceEncoder</a> seq(bt);</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  m_n.DEREncode(seq);</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  m_p.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  m_q.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  m_u.<a class="code" href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">DEREncode</a>(seq);</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  seq.MessageEnd();</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> }</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="comment">// DJB's "RSA signatures and Rabin-Williams signatures..." (http://cr.yp.to/sigs/rwsota-20080131.pdf).</span></div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#adbe2ded92af6360ab4a17e2cb6289085"> 188</a></span> <a class="code" href="class_integer.html">Integer</a> <a class="code" href="class_invertible_r_w_function.html#adbe2ded92af6360ab4a17e2cb6289085">InvertibleRWFunction::CalculateInverse</a>(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &x)<span class="keyword"> const</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span> <span class="keyword"></span>{</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <a class="code" href="class_crypto_material.html#aa1da44802c5cf00946043922cb9e7e6e">DoQuickSanityCheck</a>();</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span> </div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">if</span>(!m_precompute)</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <a class="code" href="class_invertible_r_w_function.html#ac342086a1eb669da37bafa45572f08b9">Precompute</a>();</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span> </div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <a class="code" href="class_modular_arithmetic.html">ModularArithmetic</a> modn(m_n), modp(m_p), modq(m_q);</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="class_integer.html">Integer</a> r, rInv;</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> </div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="keywordflow">do</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  {</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="comment">// Do this in a loop for people using small numbers for testing</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  r.<a class="code" href="class_integer.html#a62a8829c926b4e421183e76ea4233702">Randomize</a>(rng, <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>(), m_n - <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>());</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">// Fix for CVE-2015-2141. Thanks to Evgeny Sidorov for reporting.</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="comment">// Squaring to satisfy Jacobi requirements suggested by Jean-Pierre Munch.</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  r = modn.Square(r);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  rInv = modn.<a class="code" href="class_integer.html#ad10f8a0906d5f1a802184a07f1c002c7">MultiplicativeInverse</a>(r);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  } <span class="keywordflow">while</span> (rInv.<a class="code" href="class_integer.html#acca1f2de6c0bfa91c49950daf681b678">IsZero</a>());</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span> </div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <a class="code" href="class_integer.html">Integer</a> re = modn.Square(r);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  re = modn.Multiply(re, x); <span class="comment">// blind</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &h = re, &p = m_p, &q = m_q;</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <a class="code" href="class_integer.html">Integer</a> e, f;</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> U = modq.<a class="code" href="class_abstract_ring.html#a0f011366054a4edb80be92f968083538">Exponentiate</a>(h, (q+1)/8);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keywordflow">if</span>(((modq.<a class="code" href="class_abstract_ring.html#a0f011366054a4edb80be92f968083538">Exponentiate</a>(U, 4) - h) % q).IsZero())</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  e = <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>();</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  e = -1;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> </div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> eh = e*h, V = modp.Exponentiate(eh, (p-3)/8);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">if</span>(((modp.Multiply(modp.Exponentiate(V, 4), modp.Exponentiate(eh, 2)) - eh) % p).IsZero())</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  f = <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>();</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  f = 2;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> </div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <a class="code" href="class_integer.html">Integer</a> W, X;</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> <span class="preprocessor"> #pragma omp parallel sections if(CRYPTOPP_RW_USE_OMP)</span></div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  {</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> <span class="preprocessor"> #pragma omp section</span></div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  {</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  W = (f.IsUnit() ? U : modq.<a class="code" href="class_modular_arithmetic.html#a3b88a85b11eb1a826d26d01bdaafbf0a">Multiply</a>(m_pre_2_3q, U));</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  }</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="preprocessor"> #pragma omp section</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  {</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> t = modp.Multiply(modp.Exponentiate(V, 3), eh);</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  X = (f.IsUnit() ? t : modp.Multiply(m_pre_2_9p, t));</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  }</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  }</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> Y = W + q * modp.Multiply(m_pre_q_p, (X - W));</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> </div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">// Signature</span></div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <a class="code" href="class_integer.html">Integer</a> s = modn.Multiply(modn.Square(Y), rInv);</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>((e * f * s.<a class="code" href="class_integer.html#a7b5e639045868c5ac338f4180e1c7efa">Squared</a>()) % m_n == x);</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="comment">// IEEE P1363, Section 8.2.8 IFSP-RW, p.44</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  s = <a class="code" href="misc_8h.html#abe412b0409249cb54899e97bc7d86424">STDMIN</a>(s, m_n - s);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="keywordflow">if</span> (<a class="code" href="class_r_w_function.html#a37cf8dd12263547a61890f8409a3d4d5">ApplyFunction</a>(s) != x) <span class="comment">// check</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keywordflow">throw</span> <a class="code" href="class_exception.html">Exception</a>(<a class="code" href="class_exception.html#a8e53909d979479380e0274807c074c0aa27d9ee7704100a88e4ae4adcc4072015">Exception::OTHER_ERROR</a>, <span class="stringliteral">"InvertibleRWFunction: computational error during private key operation"</span>);</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> </div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> }</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div><div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a1c3858f76fdd2c48bcac7346d75b8c9e"> 253</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_invertible_r_w_function.html#a1c3858f76fdd2c48bcac7346d75b8c9e">InvertibleRWFunction::Validate</a>(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level)<span class="keyword"> const</span></div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> <span class="keyword"></span>{</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keywordtype">bool</span> pass = <a class="code" href="class_r_w_function.html#af326ae91ff9d6719c879861d21d380ac">RWFunction::Validate</a>(rng, level);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  pass = pass && m_p > <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>() && m_p%8 == 3 && m_p < m_n;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  pass = pass && m_q > <a class="code" href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a>() && m_q%8 == 7 && m_q < m_n;</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  pass = pass && m_u.<a class="code" href="class_integer.html#a13ddbfd8e9729932c2a99b0dff530978">IsPositive</a>() && m_u < m_p;</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">if</span> (level >= 1)</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  {</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  pass = pass && m_p * m_q == m_n;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  pass = pass && m_u * m_q % m_p == 1;</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  }</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <span class="keywordflow">if</span> (level >= 2)</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  {</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  pass = pass && <a class="code" href="nbtheory_8h.html#a633d17045e229eccc3614426df054463">VerifyPrime</a>(rng, m_p, level-2) && <a class="code" href="nbtheory_8h.html#a633d17045e229eccc3614426df054463">VerifyPrime</a>(rng, m_q, level-2);</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a>(pass);</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  }</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">return</span> pass;</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span> }</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span> </div><div class="line"><a name="l00278"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a7532c7a2c5e2938fa998733f44f35148"> 278</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_invertible_r_w_function.html#a7532c7a2c5e2938fa998733f44f35148">InvertibleRWFunction::GetVoidValue</a>(<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></div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span> <span class="keyword"></span>{</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">return</span> GetValueHelper<RWFunction>(<span class="keyword">this</span>, name, valueType, pValue).Assignable()</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  CRYPTOPP_GET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a6cdb26682afe9bb0e1f245a052924d52">Prime1</a>)</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  CRYPTOPP_GET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#afbc931235175c1df9b9826a0d88999d8">Prime2</a>)</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  CRYPTOPP_GET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a9579c719b8981c185c8f9fec9f180a55">MultiplicativeInverseOfPrime2ModPrime1</a>)</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  ;</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span> }</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span> </div><div class="line"><a name="l00287"></a><span class="lineno"><a class="line" href="class_invertible_r_w_function.html#a56b0314b678c58228671d3c9049f86db"> 287</a></span> <span class="keywordtype">void</span> <a class="code" href="class_invertible_r_w_function.html#a56b0314b678c58228671d3c9049f86db">InvertibleRWFunction::AssignFrom</a>(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &source)</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> {</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  AssignFromHelper<RWFunction>(<span class="keyword">this</span>, source)</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  CRYPTOPP_SET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a6cdb26682afe9bb0e1f245a052924d52">Prime1</a>)</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  CRYPTOPP_SET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#afbc931235175c1df9b9826a0d88999d8">Prime2</a>)</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  CRYPTOPP_SET_FUNCTION_ENTRY(<a class="code" href="namespace_name.html#a9579c719b8981c185c8f9fec9f180a55">MultiplicativeInverseOfPrime2ModPrime1</a>)</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  ;</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> </div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  m_precompute = <span class="keyword">false</span>;</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> }</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> </div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> NAMESPACE_END</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span> </div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="class_exception_html"><div class="ttname"><a href="class_exception.html">Exception</a></div><div class="ttdoc">Base class for all exceptions thrown by the library. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00155">cryptlib.h:155</a></div></div> <div class="ttc" id="namespace_name_html_a9579c719b8981c185c8f9fec9f180a55"><div class="ttname"><a href="namespace_name.html#a9579c719b8981c185c8f9fec9f180a55">Name::MultiplicativeInverseOfPrime2ModPrime1</a></div><div class="ttdeci">const char * MultiplicativeInverseOfPrime2ModPrime1()</div><div class="ttdoc">Integer. </div><div class="ttdef"><b>Definition:</b> <a href="argnames_8h_source.html#l00047">argnames.h:47</a></div></div> <div class="ttc" id="class_invalid_argument_html"><div class="ttname"><a href="class_invalid_argument.html">InvalidArgument</a></div><div class="ttdoc">An invalid argument was detected. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00199">cryptlib.h:199</a></div></div> <div class="ttc" id="class_integer_html_ad10f8a0906d5f1a802184a07f1c002c7"><div class="ttname"><a href="class_integer.html#ad10f8a0906d5f1a802184a07f1c002c7">Integer::MultiplicativeInverse</a></div><div class="ttdeci">Integer MultiplicativeInverse() const</div><div class="ttdoc">Calculate multiplicative inverse. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l04357">integer.cpp:4357</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_adbe2ded92af6360ab4a17e2cb6289085"><div class="ttname"><a href="class_invertible_r_w_function.html#adbe2ded92af6360ab4a17e2cb6289085">InvertibleRWFunction::CalculateInverse</a></div><div class="ttdeci">Integer CalculateInverse(RandomNumberGenerator &rng, const Integer &x) const</div><div class="ttdoc">Calculates the inverse of an element. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00188">rw.cpp:188</a></div></div> <div class="ttc" id="namespace_name_html_afbc931235175c1df9b9826a0d88999d8"><div class="ttname"><a href="namespace_name.html#afbc931235175c1df9b9826a0d88999d8">Name::Prime2</a></div><div class="ttdeci">const char * Prime2()</div><div class="ttdoc">Integer. </div><div class="ttdef"><b>Definition:</b> <a href="argnames_8h_source.html#l00044">argnames.h:44</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a1c3858f76fdd2c48bcac7346d75b8c9e"><div class="ttname"><a href="class_invertible_r_w_function.html#a1c3858f76fdd2c48bcac7346d75b8c9e">InvertibleRWFunction::Validate</a></div><div class="ttdeci">bool Validate(RandomNumberGenerator &rng, unsigned int level) const</div><div class="ttdoc">Check this object for errors. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00253">rw.cpp:253</a></div></div> <div class="ttc" id="class_integer_html_a0671bd1dbe49e2eecdaaa65ffcb5b6ec"><div class="ttname"><a href="class_integer.html#a0671bd1dbe49e2eecdaaa65ffcb5b6ec">Integer::DEREncode</a></div><div class="ttdeci">void DEREncode(BufferedTransformation &bt) const</div><div class="ttdoc">Encode in DER format. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l03405">integer.cpp:3405</a></div></div> <div class="ttc" id="class_exception_html_a8e53909d979479380e0274807c074c0aa27d9ee7704100a88e4ae4adcc4072015"><div class="ttname"><a href="class_exception.html#a8e53909d979479380e0274807c074c0aa27d9ee7704100a88e4ae4adcc4072015">Exception::OTHER_ERROR</a></div><div class="ttdoc">Some other error occurred not belonging to other categories. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00174">cryptlib.h:174</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a6087d4bf788bd6beab89699eb7069b86"><div class="ttname"><a href="class_invertible_r_w_function.html#a6087d4bf788bd6beab89699eb7069b86">InvertibleRWFunction::Initialize</a></div><div class="ttdeci">void Initialize(const Integer &n, const Integer &p, const Integer &q, const Integer &u)</div><div class="ttdoc">Initialize a Rabin-Williams private key. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00118">rw.cpp:118</a></div></div> <div class="ttc" id="class_modular_arithmetic_html"><div class="ttname"><a href="class_modular_arithmetic.html">ModularArithmetic</a></div><div class="ttdoc">Ring of congruence classes modulo n. </div><div class="ttdef"><b>Definition:</b> <a href="modarith_8h_source.html#l00038">modarith.h:38</a></div></div> <div class="ttc" id="class_random_number_generator_html"><div class="ttname"><a href="class_random_number_generator.html">RandomNumberGenerator</a></div><div class="ttdoc">Interface for random number generators. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l01330">cryptlib.h:1330</a></div></div> <div class="ttc" id="class_integer_html_a62a8829c926b4e421183e76ea4233702"><div class="ttname"><a href="class_integer.html#a62a8829c926b4e421183e76ea4233702">Integer::Randomize</a></div><div class="ttdeci">void Randomize(RandomNumberGenerator &rng, size_t bitCount)</div><div class="ttdoc">Set this Integer to random integer. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l03476">integer.cpp:3476</a></div></div> <div class="ttc" id="class_combined_name_value_pairs_html"><div class="ttname"><a href="class_combined_name_value_pairs.html">CombinedNameValuePairs</a></div><div class="ttdoc">Combines two sets of NameValuePairs. </div><div class="ttdef"><b>Definition:</b> <a href="algparam_8h_source.html#l00124">algparam.h:124</a></div></div> <div class="ttc" id="class_integer_html_af805574831ce19221692966e6217e6e0"><div class="ttname"><a href="class_integer.html#af805574831ce19221692966e6217e6e0">Integer::InverseMod</a></div><div class="ttdeci">Integer InverseMod(const Integer &n) const</div><div class="ttdoc">Calculate multiplicative inverse. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l04386">integer.cpp:4386</a></div></div> <div class="ttc" id="class_b_e_r_sequence_decoder_html"><div class="ttname"><a href="class_b_e_r_sequence_decoder.html">BERSequenceDecoder</a></div><div class="ttdoc">BER Sequence Decoder. </div><div class="ttdef"><b>Definition:</b> <a href="asn_8h_source.html#l00305">asn.h:305</a></div></div> <div class="ttc" id="class_integer_html_a0d9a427fe64a454b11b24fe61c10dbeb"><div class="ttname"><a href="class_integer.html#a0d9a427fe64a454b11b24fe61c10dbeb">Integer::GenerateRandom</a></div><div class="ttdeci">void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &params=g_nullNameValuePairs)</div><div class="ttdoc">Generate a random number. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00484">integer.h:484</a></div></div> <div class="ttc" id="class_buffered_transformation_html"><div class="ttname"><a href="class_buffered_transformation.html">BufferedTransformation</a></div><div class="ttdoc">Interface for buffered transformations. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l01545">cryptlib.h:1545</a></div></div> <div class="ttc" id="class_r_w_function_html_a37cf8dd12263547a61890f8409a3d4d5"><div class="ttname"><a href="class_r_w_function.html#a37cf8dd12263547a61890f8409a3d4d5">RWFunction::ApplyFunction</a></div><div class="ttdeci">Integer ApplyFunction(const Integer &x) const</div><div class="ttdoc">Applies the trapdoor. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00036">rw.cpp:36</a></div></div> <div class="ttc" id="class_integer_html_a13ddbfd8e9729932c2a99b0dff530978"><div class="ttname"><a href="class_integer.html#a13ddbfd8e9729932c2a99b0dff530978">Integer::IsPositive</a></div><div class="ttdeci">bool IsPositive() const</div><div class="ttdoc">Determines if the Integer is positive. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00342">integer.h:342</a></div></div> <div class="ttc" id="class_integer_html_a8c070592581bf6c2f928c72bfa1c1638"><div class="ttname"><a href="class_integer.html#a8c070592581bf6c2f928c72bfa1c1638">Integer::One</a></div><div class="ttdeci">static const Integer & One()</div><div class="ttdoc">Integer representing 1. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l04824">integer.cpp:4824</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a8953bb59727e0ae2d79071874a793c48"><div class="ttname"><a href="class_invertible_r_w_function.html#a8953bb59727e0ae2d79071874a793c48">InvertibleRWFunction::GenerateRandom</a></div><div class="ttdeci">void GenerateRandom(RandomNumberGenerator &rng, const NameValuePairs &alg)</div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00100">rw.cpp:100</a></div></div> <div class="ttc" id="class_r_w_function_html_af326ae91ff9d6719c879861d21d380ac"><div class="ttname"><a href="class_r_w_function.html#af326ae91ff9d6719c879861d21d380ac">RWFunction::Validate</a></div><div class="ttdeci">bool Validate(RandomNumberGenerator &rng, unsigned int level) const</div><div class="ttdoc">Check this object for errors. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00073">rw.cpp:73</a></div></div> <div class="ttc" id="namespace_name_html_a6cdb26682afe9bb0e1f245a052924d52"><div class="ttname"><a href="namespace_name.html#a6cdb26682afe9bb0e1f245a052924d52">Name::Prime1</a></div><div class="ttdeci">const char * Prime1()</div><div class="ttdoc">Integer. </div><div class="ttdef"><b>Definition:</b> <a href="argnames_8h_source.html#l00043">argnames.h:43</a></div></div> <div class="ttc" id="class_crypto_material_html_aa1da44802c5cf00946043922cb9e7e6e"><div class="ttname"><a href="class_crypto_material.html#aa1da44802c5cf00946043922cb9e7e6e">CryptoMaterial::DoQuickSanityCheck</a></div><div class="ttdeci">void DoQuickSanityCheck() const</div><div class="ttdoc">Perform a quick sanity check. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l02334">cryptlib.h:2334</a></div></div> <div class="ttc" id="rw_8h_html"><div class="ttname"><a href="rw_8h.html">rw.h</a></div><div class="ttdoc">Classes for Rabin-Williams signature scheme. </div></div> <div class="ttc" id="class_invertible_r_w_function_html_a7532c7a2c5e2938fa998733f44f35148"><div class="ttname"><a href="class_invertible_r_w_function.html#a7532c7a2c5e2938fa998733f44f35148">InvertibleRWFunction::GetVoidValue</a></div><div class="ttdeci">bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const</div><div class="ttdoc">Get a named value. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00278">rw.cpp:278</a></div></div> <div class="ttc" id="class_r_w_function_html_aa0b787a1b8a8afbf430fafe53d6cb4a7"><div class="ttname"><a href="class_r_w_function.html#aa0b787a1b8a8afbf430fafe53d6cb4a7">RWFunction::GetVoidValue</a></div><div class="ttdeci">bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const</div><div class="ttdoc">Get a named value. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00082">rw.cpp:82</a></div></div> <div class="ttc" id="class_modular_arithmetic_html_a3b88a85b11eb1a826d26d01bdaafbf0a"><div class="ttname"><a href="class_modular_arithmetic.html#a3b88a85b11eb1a826d26d01bdaafbf0a">ModularArithmetic::Multiply</a></div><div class="ttdeci">const Integer & Multiply(const Integer &a, const Integer &b) const</div><div class="ttdoc">Multiplies elements in the ring. </div><div class="ttdef"><b>Definition:</b> <a href="modarith_8h_source.html#l00174">modarith.h:174</a></div></div> <div class="ttc" id="algparam_8h_html_aa13eee74de98cf8aaa7e83f4fae7f28b"><div class="ttname"><a href="algparam_8h.html#aa13eee74de98cf8aaa7e83f4fae7f28b">MakeParameters</a></div><div class="ttdeci">AlgorithmParameters MakeParameters(const char *name, const T &value, bool throwIfNotUsed=true)</div><div class="ttdoc">Create an object that implements NameValuePairs. </div><div class="ttdef"><b>Definition:</b> <a href="algparam_8h_source.html#l00502">algparam.h:502</a></div></div> <div class="ttc" id="class_integer_html_acca1f2de6c0bfa91c49950daf681b678"><div class="ttname"><a href="class_integer.html#acca1f2de6c0bfa91c49950daf681b678">Integer::IsZero</a></div><div class="ttdeci">bool IsZero() const</div><div class="ttdoc">Determines if the Integer is 0. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00330">integer.h:330</a></div></div> <div class="ttc" id="nbtheory_8h_html_a633d17045e229eccc3614426df054463"><div class="ttname"><a href="nbtheory_8h.html#a633d17045e229eccc3614426df054463">VerifyPrime</a></div><div class="ttdeci">bool VerifyPrime(RandomNumberGenerator &rng, const Integer &p, unsigned int level=1)</div><div class="ttdoc">Verifies a number is probably prime. </div><div class="ttdef"><b>Definition:</b> <a href="nbtheory_8cpp_source.html#l00247">nbtheory.cpp:247</a></div></div> <div class="ttc" id="class_integer_html_a87410093addf9a2253fe07b39b918b02"><div class="ttname"><a href="class_integer.html#a87410093addf9a2253fe07b39b918b02">Integer::Negate</a></div><div class="ttdeci">void Negate()</div><div class="ttdoc">Reverse the Sign of the Integer. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l04293">integer.cpp:4293</a></div></div> <div class="ttc" id="class_r_w_function_html_a99293c55c055b338bd7c783a7b8c0484"><div class="ttname"><a href="class_r_w_function.html#a99293c55c055b338bd7c783a7b8c0484">RWFunction::AssignFrom</a></div><div class="ttdeci">void AssignFrom(const NameValuePairs &source)</div><div class="ttdoc">Assign values to this object. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00089">rw.cpp:89</a></div></div> <div class="ttc" id="class_integer_html"><div class="ttname"><a href="class_integer.html">Integer</a></div><div class="ttdoc">Multiple precision integer with arithmetic operations. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00049">integer.h:49</a></div></div> <div class="ttc" id="pch_8h_html"><div class="ttname"><a href="pch_8h.html">pch.h</a></div><div class="ttdoc">Precompiled header file. </div></div> <div class="ttc" id="class_abstract_ring_html_a0f011366054a4edb80be92f968083538"><div class="ttname"><a href="class_abstract_ring.html#a0f011366054a4edb80be92f968083538">AbstractRing::Exponentiate</a></div><div class="ttdeci">virtual Element Exponentiate(const Element &a, const Integer &e) const</div><div class="ttdoc">Raises a base to an exponent in the group. </div><div class="ttdef"><b>Definition:</b> <a href="algebra_8cpp_source.html#l00316">algebra.cpp:316</a></div></div> <div class="ttc" id="misc_8h_html_abe412b0409249cb54899e97bc7d86424"><div class="ttname"><a href="misc_8h.html#abe412b0409249cb54899e97bc7d86424">STDMIN</a></div><div class="ttdeci">const T & STDMIN(const T &a, const T &b)</div><div class="ttdoc">Replacement function for std::min. </div><div class="ttdef"><b>Definition:</b> <a href="misc_8h_source.html#l00507">misc.h:507</a></div></div> <div class="ttc" id="trap_8h_html_adf3b392588bc94cbeae9f415a78c7b95"><div class="ttname"><a href="trap_8h.html#adf3b392588bc94cbeae9f415a78c7b95">CRYPTOPP_ASSERT</a></div><div class="ttdeci">#define CRYPTOPP_ASSERT(exp)</div><div class="ttdoc">Debugging and diagnostic assertion. </div><div class="ttdef"><b>Definition:</b> <a href="trap_8h_source.html#l00060">trap.h:60</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a9960b78b03de88ace2fde8b99f517722"><div class="ttname"><a href="class_invertible_r_w_function.html#a9960b78b03de88ace2fde8b99f517722">InvertibleRWFunction::LoadPrecomputation</a></div><div class="ttdeci">virtual void LoadPrecomputation(BufferedTransformation &storedPrecomputation)</div><div class="ttdoc">Retrieve previously saved precomputation. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00142">rw.cpp:142</a></div></div> <div class="ttc" id="asn_8h_html"><div class="ttname"><a href="asn_8h.html">asn.h</a></div><div class="ttdoc">Classes and functions for working with ANS.1 objects. </div></div> <div class="ttc" id="nbtheory_8h_html"><div class="ttname"><a href="nbtheory_8h.html">nbtheory.h</a></div><div class="ttdoc">Classes and functions for number theoretic operations. </div></div> <div class="ttc" id="class_d_e_r_sequence_encoder_html"><div class="ttname"><a href="class_d_e_r_sequence_encoder.html">DERSequenceEncoder</a></div><div class="ttdoc">DER Sequence Encoder. </div><div class="ttdef"><b>Definition:</b> <a href="asn_8h_source.html#l00315">asn.h:315</a></div></div> <div class="ttc" id="class_integer_html_a7b5e639045868c5ac338f4180e1c7efa"><div class="ttname"><a href="class_integer.html#a7b5e639045868c5ac338f4180e1c7efa">Integer::Squared</a></div><div class="ttdeci">Integer Squared() const</div><div class="ttdoc">Multiply this integer by itself. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00609">integer.h:609</a></div></div> <div class="ttc" id="class_algorithm_parameters_html"><div class="ttname"><a href="class_algorithm_parameters.html">AlgorithmParameters</a></div><div class="ttdoc">An object that implements NameValuePairs. </div><div class="ttdef"><b>Definition:</b> <a href="algparam_8h_source.html#l00419">algparam.h:419</a></div></div> <div class="ttc" id="namespace_name_html_a7e07afb1cbb505fa8cf1b93e67f4782d"><div class="ttname"><a href="namespace_name.html#a7e07afb1cbb505fa8cf1b93e67f4782d">Name::Modulus</a></div><div class="ttdeci">const char * Modulus()</div><div class="ttdoc">Integer. </div><div class="ttdef"><b>Definition:</b> <a href="argnames_8h_source.html#l00033">argnames.h:33</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a0e54f331b0e4ee2fc99cb36dc6919039"><div class="ttname"><a href="class_invertible_r_w_function.html#a0e54f331b0e4ee2fc99cb36dc6919039">InvertibleRWFunction::SavePrecomputation</a></div><div class="ttdeci">virtual void SavePrecomputation(BufferedTransformation &storedPrecomputation) const</div><div class="ttdoc">Save precomputation for later use. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00153">rw.cpp:153</a></div></div> <div class="ttc" id="integer_8h_html"><div class="ttname"><a href="integer_8h.html">integer.h</a></div><div class="ttdoc">Multiple precision integer with arithmetic operations. </div></div> <div class="ttc" id="class_integer_html_a19b7e6d48b1b57bd4846160ea2928175"><div class="ttname"><a href="class_integer.html#a19b7e6d48b1b57bd4846160ea2928175">Integer::Zero</a></div><div class="ttdeci">static const Integer & Zero()</div><div class="ttdoc">Integer representing 0. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l04812">integer.cpp:4812</a></div></div> <div class="ttc" id="class_invertible_r_w_function_html_a56b0314b678c58228671d3c9049f86db"><div class="ttname"><a href="class_invertible_r_w_function.html#a56b0314b678c58228671d3c9049f86db">InvertibleRWFunction::AssignFrom</a></div><div class="ttdeci">void AssignFrom(const NameValuePairs &source)</div><div class="ttdoc">Assign values to this object. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8cpp_source.html#l00287">rw.cpp:287</a></div></div> <div class="ttc" id="class_integer_html_a810fc0382f8928893fe192ab79b1972c"><div class="ttname"><a href="class_integer.html#a810fc0382f8928893fe192ab79b1972c">Integer::BERDecode</a></div><div class="ttdeci">void BERDecode(const byte *input, size_t inputLen)</div><div class="ttdoc">Decode from BER format. </div><div class="ttdef"><b>Definition:</b> <a href="integer_8cpp_source.html#l03412">integer.cpp:3412</a></div></div> <div class="ttc" id="modarith_8h_html"><div class="ttname"><a href="modarith_8h.html">modarith.h</a></div><div class="ttdoc">Class file for performing modular arithmetic. </div></div> <div class="ttc" id="namespace_crypto_p_p_html"><div class="ttname"><a href="namespace_crypto_p_p.html">CryptoPP</a></div><div class="ttdoc">Crypto++ library namespace. </div></div> <div class="ttc" id="class_invertible_r_w_function_html_ac342086a1eb669da37bafa45572f08b9"><div class="ttname"><a href="class_invertible_r_w_function.html#ac342086a1eb669da37bafa45572f08b9">InvertibleRWFunction::Precompute</a></div><div class="ttdeci">virtual void Precompute(unsigned int unused=0)</div><div class="ttdoc">Perform precomputation. </div><div class="ttdef"><b>Definition:</b> <a href="rw_8h_source.html#l00110">rw.h:110</a></div></div> <div class="ttc" id="class_name_value_pairs_html_a94e5b19dc54625799797668ff8627c57"><div class="ttname"><a href="class_name_value_pairs.html#a94e5b19dc54625799797668ff8627c57">NameValuePairs::GetIntValue</a></div><div class="ttdeci">bool GetIntValue(const char *name, int &value) const</div><div class="ttdoc">Get a named value with type int. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00383">cryptlib.h:383</a></div></div> <div class="ttc" id="class_name_value_pairs_html"><div class="ttname"><a href="class_name_value_pairs.html">NameValuePairs</a></div><div class="ttdoc">Interface for retrieving values given their names. </div><div class="ttdef"><b>Definition:</b> <a href="cryptlib_8h_source.html#l00290">cryptlib.h:290</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Sep 16 2018 07:58:02 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>