⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pubkey_8h-source.html

📁 Crypto++是一个非常强大的密码学库,主要是功能全
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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++: pubkey.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&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Compound&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Compound&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div><h1>pubkey.h</h1><a href="pubkey_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// pubkey.h - written and placed in the public domain by Wei Dai</span>00002 00003 <span class="preprocessor">#ifndef CRYPTOPP_PUBKEY_H</span>00004 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_PUBKEY_H</span>00005 <span class="preprocessor"></span><span class="comment"></span>00006 <span class="comment">/** \file</span>00007 <span class="comment"></span>00008 <span class="comment">        This file contains helper classes/functions for implementing public key algorithms.</span>00009 <span class="comment"></span>00010 <span class="comment">        The class hierachies in this .h file tend to look like this:</span>00011 <span class="comment">&lt;pre&gt;</span>00012 <span class="comment">                  x1</span>00013 <span class="comment">                 / \</span>00014 <span class="comment">                y1  z1</span>00015 <span class="comment">                 |  |</span>00016 <span class="comment">            x2&lt;y1&gt;  x2&lt;z1&gt;</span>00017 <span class="comment">                 |  |</span>00018 <span class="comment">                y2  z2</span>00019 <span class="comment">                 |  |</span>00020 <span class="comment">            x3&lt;y2&gt;  x3&lt;z2&gt;</span>00021 <span class="comment">                 |  |</span>00022 <span class="comment">                y3  z3</span>00023 <span class="comment">&lt;/pre&gt;</span>00024 <span class="comment">        - x1, y1, z1 are abstract interface classes defined in cryptlib.h</span>00025 <span class="comment">        - x2, y2, z2 are implementations of the interfaces using "abstract policies", which</span>00026 <span class="comment">          are pure virtual functions that should return interfaces to interchangeable algorithms.</span>00027 <span class="comment">          These classes have "Base" suffixes.</span>00028 <span class="comment">        - x3, y3, z3 hold actual algorithms and implement those virtual functions.</span>00029 <span class="comment">          These classes have "Impl" suffixes.</span>00030 <span class="comment"></span>00031 <span class="comment">        The "TF_" prefix means an implementation using trapdoor functions on integers.</span>00032 <span class="comment">        The "DL_" prefix means an implementation using group operations (in groups where discrete log is hard).</span>00033 <span class="comment">*/</span>00034 00035 <span class="preprocessor">#include "<a class="code" href="integer_8h.html">integer.h</a>"</span>00036 <span class="preprocessor">#include "filters.h"</span>00037 <span class="preprocessor">#include "eprecomp.h"</span>00038 <span class="preprocessor">#include "<a class="code" href="fips140_8h.html">fips140.h</a>"</span>00039 <span class="preprocessor">#include "argnames.h"</span>00040 <span class="preprocessor">#include &lt;memory&gt;</span>00041 00042 <span class="comment">// VC60 workaround: this macro is defined in shlobj.h and conflicts with a template parameter used in this file</span>00043 <span class="preprocessor">#undef INTERFACE</span>00044 <span class="preprocessor"></span>00045 NAMESPACE_BEGIN(CryptoPP)00046 00047 CRYPTOPP_DLL <a class="code" href="class_integer.html">Integer</a> NR_EncodeDigest(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> modulusBits, <span class="keyword">const</span> byte *digest, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestLen);00048 CRYPTOPP_DLL <a class="code" href="class_integer.html">Integer</a> DSA_EncodeDigest(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> modulusBits, <span class="keyword">const</span> byte *digest, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> digestLen);00049 00050 <span class="keyword">template</span> &lt;<span class="keyword">typename</span> STANDARD&gt;00051 <span class="keyword">struct </span>CryptoStandardTraits00052 {00053         <span class="keyword">typedef</span> <span class="keyword">typename</span> STANDARD::EncryptionPaddingAlgorithm EncryptionPaddingAlgorithm;00054 00055         <span class="keyword">template</span> &lt;<span class="keyword">class</span> H&gt; <span class="keyword">class </span>SignaturePaddingAlgorithm {};00056         <span class="keyword">template</span> &lt;<span class="keyword">class</span> H&gt; <span class="keyword">class </span>DecoratedHashingAlgorithm {};00057 };00058 00059 <span class="comment">// ********************************************************</span>00060 <span class="comment"></span>00061 <span class="comment">//! .</span><a name="l00062"></a><a class="code" href="class_trapdoor_function_bounds.html">00062</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL TrapdoorFunctionBounds00063 {00064 <span class="keyword">public</span>:00065         <span class="keyword">virtual</span> ~TrapdoorFunctionBounds() {}00066 00067         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> PreimageBound() <span class="keyword">const</span> =0;00068         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> ImageBound() <span class="keyword">const</span> =0;00069         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> MaxPreimage()<span class="keyword"> const </span>{<span class="keywordflow">return</span> --PreimageBound();}00070         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> MaxImage()<span class="keyword"> const </span>{<span class="keywordflow">return</span> --ImageBound();}00071 };00072 <span class="comment"></span>00073 <span class="comment">//! .</span><a name="l00074"></a><a class="code" href="class_randomized_trapdoor_function.html">00074</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL RandomizedTrapdoorFunction : <span class="keyword">public</span> TrapdoorFunctionBounds00075 {00076 <span class="keyword">public</span>:00077         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> ApplyRandomizedFunction(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x) <span class="keyword">const</span> =0;00078 };00079 <span class="comment"></span>00080 <span class="comment">//! .</span><a name="l00081"></a><a class="code" href="class_trapdoor_function.html">00081</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL TrapdoorFunction : <span class="keyword">public</span> RandomizedTrapdoorFunction00082 {00083 <span class="keyword">public</span>:00084         <a class="code" href="class_integer.html">Integer</a> ApplyRandomizedFunction(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x)<span class="keyword"> const</span>00085 <span class="keyword">                </span>{<span class="keywordflow">return</span> ApplyFunction(x);}00086 00087         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> ApplyFunction(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x) <span class="keyword">const</span> =0;00088 };00089 <span class="comment"></span>00090 <span class="comment">//! .</span><a name="l00091"></a><a class="code" href="class_randomized_trapdoor_function_inverse.html">00091</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL RandomizedTrapdoorFunctionInverse00092 {00093 <span class="keyword">public</span>:00094         <span class="keyword">virtual</span> ~RandomizedTrapdoorFunctionInverse() {}00095 00096         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> CalculateRandomizedInverse(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x) <span class="keyword">const</span> =0;00097 };00098 <span class="comment"></span>00099 <span class="comment">//! .</span><a name="l00100"></a><a class="code" href="class_trapdoor_function_inverse.html">00100</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL TrapdoorFunctionInverse : <span class="keyword">public</span> RandomizedTrapdoorFunctionInverse00101 {00102 <span class="keyword">public</span>:00103         <span class="keyword">virtual</span> ~TrapdoorFunctionInverse() {}00104 00105         <a class="code" href="class_integer.html">Integer</a> CalculateRandomizedInverse(<a class="code" href="class_random_number_generator.html">RandomNumberGenerator</a> &amp;rng, <span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x)<span class="keyword"> const</span>00106 <span class="keyword">                </span>{<span class="keywordflow">return</span> CalculateInverse(x);}00107 00108         <span class="keyword">virtual</span> <a class="code" href="class_integer.html">Integer</a> CalculateInverse(<span class="keyword">const</span> <a class="code" href="class_integer.html">Integer</a> &amp;x) <span class="keyword">const</span> =0;00109 };00110 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -