📄 rw_8h-source.html
字号:
<a name="l00040"></a>00040 <span class="comment">//! _</span><a name="l00041"></a><a class="code" href="class_invertible_r_w_function.html">00041</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL <a class="code" href="class_invertible_r_w_function.html" title="_">InvertibleRWFunction</a> : <span class="keyword">public</span> <a class="code" href="class_r_w_function.html" title="_">RWFunction</a>, <span class="keyword">public</span> <a class="code" href="class_trapdoor_function_inverse.html" title="_">TrapdoorFunctionInverse</a>, <span class="keyword">public</span> <a class="code" href="class_private_key.html" title="interface for private keys">PrivateKey</a><a name="l00042"></a>00042 {<a name="l00043"></a>00043 <span class="keyword">typedef</span> <a class="code" href="class_invertible_r_w_function.html" title="_">InvertibleRWFunction</a> <a class="code" href="class_r_w_function.html" title="_">ThisClass</a>;<a name="l00044"></a>00044 <a name="l00045"></a>00045 <span class="keyword">public</span>:<a name="l00046"></a><a class="code" href="class_invertible_r_w_function.html#6087d4bf788bd6beab89699eb7069b86">00046</a> <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#614204219fea42197352b8456ef0b7c5">Initialize</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &n, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &u)<a name="l00047"></a>00047 {m_n = n; m_p = p; m_q = q; m_u = u;}<a name="l00048"></a>00048 <span class="comment">// generate a random private key</span><a name="l00049"></a><a class="code" href="class_invertible_r_w_function.html#6489b68e2d321e3844b85060ba42f90c">00049</a> <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#614204219fea42197352b8456ef0b7c5">Initialize</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> modulusBits)<a name="l00050"></a>00050 {<a class="code" href="class_generatable_crypto_material.html#38d492343c32e530a5c2781b5797f755" title="calls the above function with a NameValuePairs object that just specifies "KeySize"...">GenerateRandomWithKeySize</a>(rng, modulusBits);}<a name="l00051"></a>00051 <a name="l00052"></a>00052 <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#d6ec85792b74c6dd4c9d48cabefdd882">BERDecode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &bt);<a name="l00053"></a>00053 <span class="keywordtype">void</span> <a class="code" href="class_r_w_function.html#bc83ab74fc89120f83bd8d387b5b436c">DEREncode</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &bt) <span class="keyword">const</span>;<a name="l00054"></a>00054 <a name="l00055"></a>00055 <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> CalculateInverse(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &x) <span class="keyword">const</span>;<a name="l00056"></a>00056 <a name="l00057"></a>00057 <span class="comment">// GeneratibleCryptoMaterial</span><a name="l00058"></a>00058 <span class="keywordtype">bool</span> <a class="code" href="class_crypto_material.html#439743c6b4e89ca8228a12fa1ea43ab1" title="check this object for errors">Validate</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level) <span class="keyword">const</span>;<a name="l00059"></a>00059 <span class="keywordtype">bool</span> <a class="code" href="class_name_value_pairs.html#9fc3f5c4480d53b8104c67ca7958e332" title="to be implemented by derived classes, users should use one of the above functions...">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>;<a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="class_crypto_material.html#20181c1b39a74a9fe91385b025b773c6" title="assign values from source to this object">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> &source);<span class="comment"></span><a name="l00061"></a>00061 <span class="comment"> /*! parameters: (ModulusSize) */</span><a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="class_generatable_crypto_material.html#be368b52db1ca7079b690f2d6e605f7a" title="generate a random key or crypto parameters">GenerateRandom</a>(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &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> &alg);<a name="l00063"></a>00063 <a name="l00064"></a><a class="code" href="class_invertible_r_w_function.html#5f283d5f1aad6946c910073fa2eb7dc6">00064</a> <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a>& GetPrime1()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_p;}<a name="l00065"></a><a class="code" href="class_invertible_r_w_function.html#82cd8d7828be9ff785291ac3ea9690b4">00065</a> <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a>& GetPrime2()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_q;}<a name="l00066"></a><a class="code" href="class_invertible_r_w_function.html#18af827a16a5bad9990f1b0e4bd052e8">00066</a> <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a>& GetMultiplicativeInverseOfPrime2ModPrime1()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_u;}<a name="l00067"></a>00067 <a name="l00068"></a><a class="code" href="class_invertible_r_w_function.html#5e390e6bd4701da66947fc2ae65e4598">00068</a> <span class="keywordtype">void</span> SetPrime1(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &p) {m_p = p;}<a name="l00069"></a><a class="code" href="class_invertible_r_w_function.html#370b4bc09e8465fe5c1db848b851653f">00069</a> <span class="keywordtype">void</span> SetPrime2(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &q) {m_q = q;}<a name="l00070"></a><a class="code" href="class_invertible_r_w_function.html#da25441d1383a4c1f838cc670b1d0188">00070</a> <span class="keywordtype">void</span> SetMultiplicativeInverseOfPrime2ModPrime1(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &u) {m_u = u;}<a name="l00071"></a>00071 <a name="l00072"></a>00072 <span class="keyword">protected</span>:<a name="l00073"></a><a class="code" href="class_invertible_r_w_function.html#e2afd7a6cc5342f098a858dde9161581">00073</a> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> m_p, m_q, m_u;<a name="l00074"></a>00074 };<a name="l00075"></a>00075 <span class="comment"></span><a name="l00076"></a>00076 <span class="comment">//! RW</span><a name="l00077"></a><a class="code" href="struct_r_w.html">00077</a> <span class="comment"></span><span class="keyword">struct </span><a class="code" href="struct_r_w.html" title="RW.">RW</a><a name="l00078"></a>00078 {<a name="l00079"></a><a class="code" href="struct_r_w.html#e884593d818d768a618a4acfed7f87f4">00079</a> <span class="keyword">static</span> std::string <a class="code" href="struct_r_w.html#e884593d818d768a618a4acfed7f87f4">StaticAlgorithmName</a>() {<span class="keywordflow">return</span> <span class="stringliteral">"RW"</span>;}<a name="l00080"></a><a class="code" href="struct_r_w.html#1009fcbd5e3da8f7894b1843e2a31604">00080</a> <span class="keyword">typedef</span> <a class="code" href="class_r_w_function.html" title="_">RWFunction</a> <a class="code" href="class_r_w_function.html" title="_">PublicKey</a>;<a name="l00081"></a><a class="code" href="struct_r_w.html#aec509081565d4c073b1f2fe744de3de">00081</a> <span class="keyword">typedef</span> <a class="code" href="class_invertible_r_w_function.html" title="_">InvertibleRWFunction</a> <a class="code" href="class_invertible_r_w_function.html" title="_">PrivateKey</a>;<a name="l00082"></a>00082 };<a name="l00083"></a>00083 <span class="comment"></span><a name="l00084"></a>00084 <span class="comment">//! RWSS</span><a name="l00085"></a>00085 <span class="comment"></span><span class="keyword">template</span> <<span class="keyword">class</span> STANDARD, <span class="keyword">class</span> H><a name="l00086"></a><a class="code" href="struct_r_w_s_s.html">00086</a> <span class="keyword">struct </span><a class="code" href="struct_r_w_s_s.html" title="RWSS.">RWSS</a> : <span class="keyword">public</span> <a class="code" href="class_t_f___s_s.html" title="Trapdoor Function Based Signature Scheme.">TF_SS</a><STANDARD, H, RW><a name="l00087"></a>00087 {<a name="l00088"></a>00088 };<a name="l00089"></a>00089 <a name="l00090"></a>00090 NAMESPACE_END<a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Fri Jun 1 11:11:24 2007 for Crypto++ by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -