Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > 07dfcfe50d66c9a48a3c5e6c1693f12a > files > 1710

cryptopp-doc-5.6.1-0.1.svn479.fc13.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Crypto++: ecp.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>ecp.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef CRYPTOPP_ECP_H</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_ECP_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &quot;modarith.h&quot;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;eprecomp.h&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;smartptr.h&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="pubkey_8h.html" title="This file contains helper classes/functions for implementing public key algorithms...">pubkey.h</a>&quot;</span>
<a name="l00008"></a>00008 
<a name="l00009"></a>00009 NAMESPACE_BEGIN(CryptoPP)
<a name="l00010"></a>00010 
<a name="l00011"></a>00011 <span class="comment">//! Elliptical Curve Point</span>
<a name="l00012"></a><a class="code" href="struct_e_c_p_point.html">00012</a> <span class="comment"></span>struct CRYPTOPP_DLL <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">ECPPoint</a>
<a name="l00013"></a>00013 {
<a name="l00014"></a>00014         ECPPoint() : identity(<span class="keyword">true</span>) {}
<a name="l00015"></a>00015         ECPPoint(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;x, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;y)
<a name="l00016"></a>00016                 : identity(<span class="keyword">false</span>), x(x), y(y) {}
<a name="l00017"></a>00017 
<a name="l00018"></a>00018         <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> ECPPoint &amp;t)<span class="keyword"> const</span>
<a name="l00019"></a>00019 <span class="keyword">                </span>{<span class="keywordflow">return</span> (identity &amp;&amp; t.identity) || (!identity &amp;&amp; !t.identity &amp;&amp; x==t.x &amp;&amp; y==t.y);}
<a name="l00020"></a>00020         <span class="keywordtype">bool</span> <a class="code" href="gf2n_8h.html#abe7b3406821884ed8df76bf9e8266efb" title="compares degree">operator&lt; </a>(<span class="keyword">const</span> ECPPoint &amp;t)<span class="keyword"> const</span>
<a name="l00021"></a>00021 <span class="keyword">                </span>{<span class="keywordflow">return</span> identity ? !t.identity : (!t.identity &amp;&amp; (x&lt;t.x || (x==t.x &amp;&amp; y&lt;t.y)));}
<a name="l00022"></a>00022 
<a name="l00023"></a>00023         <span class="keywordtype">bool</span> identity;
<a name="l00024"></a>00024         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> x, y;
<a name="l00025"></a>00025 };
<a name="l00026"></a>00026 
<a name="l00027"></a>00027 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_abstract_group.html">AbstractGroup&lt;ECPPoint&gt;</a>;
<a name="l00028"></a>00028 <span class="comment"></span>
<a name="l00029"></a>00029 <span class="comment">//! Elliptic Curve over GF(p), where p is prime</span>
<a name="l00030"></a><a class="code" href="class_e_c_p.html">00030</a> <span class="comment"></span><span class="keyword">class </span>CRYPTOPP_DLL <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> : <span class="keyword">public</span> <a class="code" href="class_abstract_group.html" title="Abstract Group.">AbstractGroup</a>&lt;ECPPoint&gt;
<a name="l00031"></a>00031 {
<a name="l00032"></a>00032 <span class="keyword">public</span>:
<a name="l00033"></a>00033         <span class="keyword">typedef</span> <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">ModularArithmetic</a> <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">Field</a>;
<a name="l00034"></a>00034         <span class="keyword">typedef</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a>;
<a name="l00035"></a>00035         <span class="keyword">typedef</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">ECPPoint</a> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a>;
<a name="l00036"></a>00036 
<a name="l00037"></a>00037         <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>() {}
<a name="l00038"></a>00038         <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>(<span class="keyword">const</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> &amp;ecp, <span class="keywordtype">bool</span> convertToMontgomeryRepresentation = <span class="keyword">false</span>);
<a name="l00039"></a>00039         <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;modulus, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a> &amp;a, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a> &amp;b)
<a name="l00040"></a>00040                 : m_fieldPtr(<span class="keyword">new</span> <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">Field</a>(modulus)), m_a(a.IsNegative() ? modulus+a : a), m_b(b) {}
<a name="l00041"></a>00041         <span class="comment">// construct from BER encoded parameters</span>
<a name="l00042"></a>00042         <span class="comment">// this constructor will decode and extract the the fields fieldID and curve of the sequence ECParameters</span>
<a name="l00043"></a>00043         <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt);
<a name="l00044"></a>00044 
<a name="l00045"></a>00045         <span class="comment">// encode the fields fieldID and curve of the sequence ECParameters</span>
<a name="l00046"></a>00046         <span class="keywordtype">void</span> DEREncode(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt) <span class="keyword">const</span>;
<a name="l00047"></a>00047 
<a name="l00048"></a>00048         <span class="keywordtype">bool</span> Equal(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;Q) <span class="keyword">const</span>;
<a name="l00049"></a>00049         <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a>&amp; Identity() <span class="keyword">const</span>;
<a name="l00050"></a>00050         <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a>&amp; Inverse(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P) <span class="keyword">const</span>;
<a name="l00051"></a>00051         <span class="keywordtype">bool</span> InversionIsFast()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}
<a name="l00052"></a>00052         <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a>&amp; Add(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;Q) <span class="keyword">const</span>;
<a name="l00053"></a>00053         <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a>&amp; Double(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P) <span class="keyword">const</span>;
<a name="l00054"></a>00054         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> ScalarMultiply(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k) <span class="keyword">const</span>;
<a name="l00055"></a>00055         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> CascadeScalarMultiply(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k1, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;Q, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k2) <span class="keyword">const</span>;
<a name="l00056"></a>00056         <span class="keywordtype">void</span> SimultaneousMultiply(<a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> *results, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;base, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> *exponents, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> exponentsCount) <span class="keyword">const</span>;
<a name="l00057"></a>00057 
<a name="l00058"></a>00058         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> Multiply(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P)<span class="keyword"> const</span>
<a name="l00059"></a>00059 <span class="keyword">                </span>{<span class="keywordflow">return</span> ScalarMultiply(P, k);}
<a name="l00060"></a>00060         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> CascadeMultiply(<span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k1, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> &amp;k2, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;Q)<span class="keyword"> const</span>
<a name="l00061"></a>00061 <span class="keyword">                </span>{<span class="keywordflow">return</span> CascadeScalarMultiply(P, k1, Q, k2);}
<a name="l00062"></a>00062 
<a name="l00063"></a>00063         <span class="keywordtype">bool</span> ValidateParameters(<a class="code" href="class_random_number_generator.html" title="interface for random number generators">RandomNumberGenerator</a> &amp;rng, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> level=3) <span class="keyword">const</span>;
<a name="l00064"></a>00064         <span class="keywordtype">bool</span> VerifyPoint(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P) <span class="keyword">const</span>;
<a name="l00065"></a>00065 
<a name="l00066"></a>00066         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> EncodedPointSize(<span class="keywordtype">bool</span> compressed = <span class="keyword">false</span>)<span class="keyword"> const</span>
<a name="l00067"></a>00067 <span class="keyword">                </span>{<span class="keywordflow">return</span> 1 + (compressed?1:2)*GetField().MaxElementByteLength();}
<a name="l00068"></a>00068         <span class="comment">// returns false if point is compressed and not valid (doesn&apos;t check if uncompressed)</span>
<a name="l00069"></a>00069         <span class="keywordtype">bool</span> DecodePoint(<a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt, <span class="keywordtype">size_t</span> len) <span class="keyword">const</span>;
<a name="l00070"></a>00070         <span class="keywordtype">bool</span> DecodePoint(<a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keyword">const</span> byte *encodedPoint, <span class="keywordtype">size_t</span> len) <span class="keyword">const</span>;
<a name="l00071"></a>00071         <span class="keywordtype">void</span> EncodePoint(byte *encodedPoint, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keywordtype">bool</span> compressed) <span class="keyword">const</span>;
<a name="l00072"></a>00072         <span class="keywordtype">void</span> EncodePoint(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keywordtype">bool</span> compressed) <span class="keyword">const</span>;
<a name="l00073"></a>00073 
<a name="l00074"></a>00074         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> BERDecodePoint(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt) <span class="keyword">const</span>;
<a name="l00075"></a>00075         <span class="keywordtype">void</span> DEREncodePoint(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> &amp;P, <span class="keywordtype">bool</span> compressed) <span class="keyword">const</span>;
<a name="l00076"></a>00076 
<a name="l00077"></a>00077         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">Integer</a> FieldSize()<span class="keyword"> const </span>{<span class="keywordflow">return</span> GetField().GetModulus();}
<a name="l00078"></a>00078         <span class="keyword">const</span> <a class="code" href="class_modular_arithmetic.html" title="ring of congruence classes modulo n">Field</a> &amp; GetField()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *m_fieldPtr;}
<a name="l00079"></a>00079         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a> &amp; GetA()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_a;}
<a name="l00080"></a>00080         <span class="keyword">const</span> <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a> &amp; GetB()<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_b;}
<a name="l00081"></a>00081 
<a name="l00082"></a>00082         <span class="keywordtype">bool</span> operator==(<span class="keyword">const</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> &amp;rhs)<span class="keyword"> const</span>
<a name="l00083"></a>00083 <span class="keyword">                </span>{<span class="keywordflow">return</span> GetField() == rhs.GetField() &amp;&amp; m_a == rhs.m_a &amp;&amp; m_b == rhs.m_b;}
<a name="l00084"></a>00084 
<a name="l00085"></a>00085 <span class="keyword">private</span>:
<a name="l00086"></a>00086         <a class="code" href="classclonable__ptr.html">clonable_ptr&lt;Field&gt;</a> m_fieldPtr;
<a name="l00087"></a>00087         <a class="code" href="class_integer.html" title="multiple precision integer and basic arithmetics">FieldElement</a> m_a, m_b;
<a name="l00088"></a>00088         <span class="keyword">mutable</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Point</a> m_R;
<a name="l00089"></a>00089 };
<a name="l00090"></a>00090 
<a name="l00091"></a>00091 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_d_l___fixed_base_precomputation_impl.html">DL_FixedBasePrecomputationImpl&lt;ECP::Point&gt;</a>;
<a name="l00092"></a>00092 CRYPTOPP_DLL_TEMPLATE_CLASS <a class="code" href="class_d_l___group_precomputation.html">DL_GroupPrecomputation&lt;ECP::Point&gt;</a>;
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt; <span class="keyword">class </span>EcPrecomputation;
<a name="l00095"></a>00095 <span class="comment"></span>
<a name="l00096"></a>00096 <span class="comment">//! ECP precomputation</span>
<a name="l00097"></a><a class="code" href="class_ec_precomputation_3_01_e_c_p_01_4.html">00097</a> <span class="comment"></span><span class="keyword">template</span>&lt;&gt; <span class="keyword">class </span>EcPrecomputation&lt;<a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>&gt; : <span class="keyword">public</span> <a class="code" href="class_d_l___group_precomputation.html">DL_GroupPrecomputation</a>&lt;ECP::Point&gt;
<a name="l00098"></a>00098 {
<a name="l00099"></a>00099 <span class="keyword">public</span>:
<a name="l00100"></a>00100         <span class="keyword">typedef</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">EllipticCurve</a>;
<a name="l00101"></a>00101         
<a name="l00102"></a>00102         <span class="comment">// DL_GroupPrecomputation</span>
<a name="l00103"></a>00103         <span class="keywordtype">bool</span> NeedConversions()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <span class="keyword">true</span>;}
<a name="l00104"></a>00104         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> ConvertIn(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> &amp;P)<span class="keyword"> const</span>
<a name="l00105"></a>00105 <span class="keyword">                </span>{<span class="keywordflow">return</span> P.identity ? P : <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">ECP::Point</a>(m_ec-&gt;GetField().ConvertIn(P.x), m_ec-&gt;GetField().ConvertIn(P.y));};
<a name="l00106"></a>00106         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> ConvertOut(<span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> &amp;P)<span class="keyword"> const</span>
<a name="l00107"></a>00107 <span class="keyword">                </span>{<span class="keywordflow">return</span> P.identity ? P : <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">ECP::Point</a>(m_ec-&gt;GetField().ConvertOut(P.x), m_ec-&gt;GetField().ConvertOut(P.y));}
<a name="l00108"></a>00108         <span class="keyword">const</span> <a class="code" href="class_abstract_group.html" title="Abstract Group.">AbstractGroup&lt;Element&gt;</a> &amp; GetGroup()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *m_ec;}
<a name="l00109"></a>00109         <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> BERDecodeElement(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt)<span class="keyword"> const </span>{<span class="keywordflow">return</span> m_ec-&gt;BERDecodePoint(bt);}
<a name="l00110"></a>00110         <span class="keywordtype">void</span> DEREncodeElement(<a class="code" href="class_buffered_transformation.html" title="interface for buffered transformations">BufferedTransformation</a> &amp;bt, <span class="keyword">const</span> <a class="code" href="struct_e_c_p_point.html" title="Elliptical Curve Point.">Element</a> &amp;v)<span class="keyword"> const </span>{m_ec-&gt;DEREncodePoint(bt, v, <span class="keyword">false</span>);}
<a name="l00111"></a>00111 
<a name="l00112"></a>00112         <span class="comment">// non-inherited</span>
<a name="l00113"></a>00113         <span class="keywordtype">void</span> SetCurve(<span class="keyword">const</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> &amp;ec)
<a name="l00114"></a>00114         {
<a name="l00115"></a>00115                 m_ec.reset(<span class="keyword">new</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a>(ec, <span class="keyword">true</span>));
<a name="l00116"></a>00116                 m_ecOriginal = ec;
<a name="l00117"></a>00117         }
<a name="l00118"></a>00118         <span class="keyword">const</span> <a class="code" href="class_e_c_p.html" title="Elliptic Curve over GF(p), where p is prime.">ECP</a> &amp; GetCurve()<span class="keyword"> const </span>{<span class="keywordflow">return</span> *m_ecOriginal;}
<a name="l00119"></a>00119 
<a name="l00120"></a>00120 <span class="keyword">private</span>:
<a name="l00121"></a>00121         <a class="code" href="classvalue__ptr.html">value_ptr&lt;ECP&gt;</a> m_ec, m_ecOriginal;
<a name="l00122"></a>00122 };
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 NAMESPACE_END
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 <span class="preprocessor">#endif</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 9 Dec 2009 for Crypto++ by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>