rabin_8h-source.html
来自「Crypto++是一个非常强大的密码学库,主要是功能全」· HTML 代码 · 共 137 行 · 第 1/2 页
HTML
137 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: rabin.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>rabin.h</h1><a href="rabin_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_RABIN_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_RABIN_H</span>00003 <span class="preprocessor"></span><span class="comment"></span>00004 <span class="comment">/** \file</span>00005 <span class="comment">*/</span>00006 00007 <span class="preprocessor">#include "oaep.h"</span>00008 <span class="preprocessor">#include "pssr.h"</span>00009 <span class="preprocessor">#include "<a class="code" href="integer_8h.html">integer.h</a>"</span>00010 00011 NAMESPACE_BEGIN(CryptoPP)00012 00013 <span class="comment">//! Rabin</span><a name="l00014"></a><a class="code" href="class_rabin_function.html">00014</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_rabin_function.html">RabinFunction</a> : <span class="keyword">public</span> <a class="code" href="class_trapdoor_function.html">TrapdoorFunction</a>, <span class="keyword">public</span> <a class="code" href="class_public_key.html">PublicKey</a>00015 {00016 <span class="keyword">typedef</span> <a class="code" href="class_rabin_function.html">RabinFunction</a> <a class="code" href="class_rabin_function.html">ThisClass</a>;00017 00018 <span class="keyword">public</span>:00019 <span class="keywordtype">void</span> Initialize(<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> &r, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &s)00020 {m_n = n; m_r = r; m_s = s;}00021 00022 <span class="keywordtype">void</span> BERDecode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt);00023 <span class="keywordtype">void</span> DEREncode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt) <span class="keyword">const</span>;00024 00025 <a class="code" href="class_integer.html">Integer</a> ApplyFunction(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &x) <span class="keyword">const</span>;00026 <a class="code" href="class_integer.html">Integer</a> PreimageBound()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}00027 <a class="code" href="class_integer.html">Integer</a> ImageBound()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}00028 00029 <span class="keywordtype">bool</span> <a class="code" href="class_rabin_function.html#_rabin_functiona6">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>;00030 <span class="keywordtype">bool</span> <a class="code" href="class_rabin_function.html#_rabin_functiona7">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>;00031 <span class="keywordtype">void</span> <a class="code" href="class_rabin_function.html#_rabin_functiona8">AssignFrom</a>(<span class="keyword">const</span> <a class="code" href="class_name_value_pairs.html">NameValuePairs</a> &source);00032 00033 <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a>& GetModulus()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_n;}00034 <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a>& GetQuadraticResidueModPrime1()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_r;}00035 <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a>& GetQuadraticResidueModPrime2()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_s;}00036 00037 <span class="keywordtype">void</span> SetModulus(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &n) {m_n = n;}00038 <span class="keywordtype">void</span> SetQuadraticResidueModPrime1(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &r) {m_r = r;}00039 <span class="keywordtype">void</span> SetQuadraticResidueModPrime2(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &s) {m_s = s;}00040 00041 <span class="keyword">protected</span>:00042 <a class="code" href="class_integer.html">Integer</a> m_n, m_r, m_s;00043 };00044 <span class="comment"></span>00045 <span class="comment">//! Invertible Rabin</span><a name="l00046"></a><a class="code" href="class_invertible_rabin_function.html">00046</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_invertible_rabin_function.html">InvertibleRabinFunction</a> : <span class="keyword">public</span> <a class="code" href="class_rabin_function.html">RabinFunction</a>, <span class="keyword">public</span> <a class="code" href="class_trapdoor_function_inverse.html">TrapdoorFunctionInverse</a>, <span class="keyword">public</span> <a class="code" href="class_private_key.html">PrivateKey</a>00047 {00048 <span class="keyword">typedef</span> <a class="code" href="class_invertible_rabin_function.html">InvertibleRabinFunction</a> <a class="code" href="class_invertible_rabin_function.html">ThisClass</a>;00049 00050 <span class="keyword">public</span>:00051 <span class="keywordtype">void</span> Initialize(<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> &r, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &s,00052 <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)00053 {m_n = n; m_r = r; m_s = s; m_p = p; m_q = q; m_u = u;}00054 <span class="keywordtype">void</span> Initialize(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> keybits)00055 {<a class="code" href="class_generatable_crypto_material.html#_x_t_r___d_ha28">GenerateRandomWithKeySize</a>(rng, keybits);}00056 00057 <span class="keywordtype">void</span> BERDecode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt);00058 <span class="keywordtype">void</span> DEREncode(<a class="code" href="class_buffered_transformation.html">BufferedTransformation</a> &bt) <span class="keyword">const</span>;00059 00060 <a class="code" href="class_integer.html">Integer</a> CalculateInverse(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &x) <span class="keyword">const</span>;00061 00062 <span class="keywordtype">bool</span> <a class="code" href="class_invertible_rabin_function.html#_invertible_rabin_functiona5">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>;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?