<!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.5"/> <title>PolarSSL v1.3.9: ecp_group Struct Reference</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 style="padding-left: 0.5em;"> <div id="projectname">PolarSSL v1.3.9 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li class="current"><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-attribs">Data Fields</a> </div> <div class="headertitle"> <div class="title">ecp_group Struct Reference</div> </div> </div><!--header--> <div class="contents"> <p>ECP group structure. <a href="structecp__group.html#details">More...</a></p> <p><code>#include <<a class="el" href="ecp_8h_source.html">ecp.h</a>></code></p> <div class="dynheader"> Collaboration diagram for ecp_group:</div> <div class="dyncontent"> <div class="center"><img src="structecp__group__coll__graph.png" border="0" usemap="#ecp__group_coll__map" alt="Collaboration graph"/></div> <map name="ecp__group_coll__map" id="ecp__group_coll__map"> <area shape="rect" id="node2" href="structmpi.html" title="MPI structure. " alt="" coords="49,5,100,32"/><area shape="rect" id="node3" href="structecp__point.html" title="ECP point structure (jacobian coordinates) " alt="" coords="84,141,195,168"/></map> <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a> Data Fields</h2></td></tr> <tr class="memitem:a8f7b8f453c94152dcb7227639511f323"><td class="memItemLeft" align="right" valign="top"><a class="el" href="ecp_8h.html#a751fce96f17826537221248b4ed5cbd2">ecp_group_id</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a8f7b8f453c94152dcb7227639511f323">id</a></td></tr> <tr class="separator:a8f7b8f453c94152dcb7227639511f323"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa743e0f6bdba64120247a92f8edf1318"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmpi.html">mpi</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#aa743e0f6bdba64120247a92f8edf1318">P</a></td></tr> <tr class="separator:aa743e0f6bdba64120247a92f8edf1318"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1164b1ffac0af85f9bc89b35497036f9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmpi.html">mpi</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a1164b1ffac0af85f9bc89b35497036f9">A</a></td></tr> <tr class="separator:a1164b1ffac0af85f9bc89b35497036f9"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a83383f769f7a7b0067bd8eb237b30bec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmpi.html">mpi</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a83383f769f7a7b0067bd8eb237b30bec">B</a></td></tr> <tr class="separator:a83383f769f7a7b0067bd8eb237b30bec"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:adb738e2c6df3c75c4b30b2b1c3e61256"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structecp__point.html">ecp_point</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#adb738e2c6df3c75c4b30b2b1c3e61256">G</a></td></tr> <tr class="separator:adb738e2c6df3c75c4b30b2b1c3e61256"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a6b424e0dbad7d3c900375a2ff0154b95"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structmpi.html">mpi</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a6b424e0dbad7d3c900375a2ff0154b95">N</a></td></tr> <tr class="separator:a6b424e0dbad7d3c900375a2ff0154b95"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3a813481e3d2548e372bab92c50f4d48"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a3a813481e3d2548e372bab92c50f4d48">pbits</a></td></tr> <tr class="separator:a3a813481e3d2548e372bab92c50f4d48"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a372ef0b2cbf3232760e108e5b97c8a3e"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a372ef0b2cbf3232760e108e5b97c8a3e">nbits</a></td></tr> <tr class="separator:a372ef0b2cbf3232760e108e5b97c8a3e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af88943414b51c063db7077e833a3f293"><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#af88943414b51c063db7077e833a3f293">h</a></td></tr> <tr class="separator:af88943414b51c063db7077e833a3f293"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:afcdbaba12db0549629c81baeba2fd738"><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#afcdbaba12db0549629c81baeba2fd738">modp</a> )(<a class="el" href="structmpi.html">mpi</a> *)</td></tr> <tr class="separator:afcdbaba12db0549629c81baeba2fd738"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1b5b1955d1f8c3f5d275e1b70fa2ef6b"><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a1b5b1955d1f8c3f5d275e1b70fa2ef6b">t_pre</a> )(<a class="el" href="structecp__point.html">ecp_point</a> *, void *)</td></tr> <tr class="separator:a1b5b1955d1f8c3f5d275e1b70fa2ef6b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a725515d364696ab58c49cab20a27bbc5"><td class="memItemLeft" align="right" valign="top">int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a725515d364696ab58c49cab20a27bbc5">t_post</a> )(<a class="el" href="structecp__point.html">ecp_point</a> *, void *)</td></tr> <tr class="separator:a725515d364696ab58c49cab20a27bbc5"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aeb5e272208e1568f6f806d4ab14b782f"><td class="memItemLeft" align="right" valign="top">void * </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#aeb5e272208e1568f6f806d4ab14b782f">t_data</a></td></tr> <tr class="separator:aeb5e272208e1568f6f806d4ab14b782f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a14f55dfcfab4b1807f499bde186dff1d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structecp__point.html">ecp_point</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#a14f55dfcfab4b1807f499bde186dff1d">T</a></td></tr> <tr class="separator:a14f55dfcfab4b1807f499bde186dff1d"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa139ffe369496827f4dc0880fc73c02c"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structecp__group.html#aa139ffe369496827f4dc0880fc73c02c">T_size</a></td></tr> <tr class="separator:aa139ffe369496827f4dc0880fc73c02c"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>ECP group structure. </p> <p>We consider two types of curves equations:</p> <ol type="1"> <li>Short Weierstrass y^2 = x^3 + A x + B mod P (SEC1 + RFC 4492)</li> <li>Montgomery, y^2 = x^3 + A x^2 + x mod P (M255 + draft) In both cases, a generator G for a prime-order subgroup is fixed. In the short weierstrass, this subgroup is actually the whole curve, and its cardinal is denoted by N.</li> </ol> <p>In the case of Short Weierstrass curves, our code requires that N is an odd prime. (Use odd in <a class="el" href="ecp_8h.html#a337b0e41153f458872f7f73bad93711c" title="Multiplication by an integer: R = m * P (Not thread-safe to use same group in multiple threads) ...">ecp_mul()</a> and prime in <a class="el" href="ecdsa_8h.html#a5a5858bde5c49005fefbe74883fc9a9d" title="Compute ECDSA signature of a previously hashed message. ">ecdsa_sign()</a> for blinding.)</p> <p>In the case of Montgomery curves, we don't store A but (A + 2) / 4 which is the quantity actually used in the formulas. Also, nbits is not the size of N but the required size for private keys.</p> <p>If modp is NULL, reduction modulo P is done using a generic algorithm. Otherwise, it must point to a function that takes an mpi in the range 0..2^(2*pbits)-1 and transforms it in-place in an integer of little more than pbits, so that the integer may be efficiently brought in the 0..P-1 range by a few additions or substractions. It must return 0 on success and non-zero on failure. </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00136">136</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div><h2 class="groupheader">Field Documentation</h2> <a class="anchor" id="a1164b1ffac0af85f9bc89b35497036f9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structmpi.html">mpi</a> ecp_group::A</td> </tr> </table> </div><div class="memdoc"> <ol type="1"> <li>A in the equation, or 2. (A + 2) / 4 </li> </ol> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00140">140</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a83383f769f7a7b0067bd8eb237b30bec"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structmpi.html">mpi</a> ecp_group::B</td> </tr> </table> </div><div class="memdoc"> <ol type="1"> <li>B in the equation, or 2. unused </li> </ol> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00141">141</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="adb738e2c6df3c75c4b30b2b1c3e61256"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structecp__point.html">ecp_point</a> ecp_group::G</td> </tr> </table> </div><div class="memdoc"> <p>generator of the (sub)group used </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00142">142</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="af88943414b51c063db7077e833a3f293"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned int ecp_group::h</td> </tr> </table> </div><div class="memdoc"> <p>internal: 1 if the constants are static </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00146">146</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a8f7b8f453c94152dcb7227639511f323"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="ecp_8h.html#a751fce96f17826537221248b4ed5cbd2">ecp_group_id</a> ecp_group::id</td> </tr> </table> </div><div class="memdoc"> <p>internal group identifier </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00138">138</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="afcdbaba12db0549629c81baeba2fd738"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* ecp_group::modp)(<a class="el" href="structmpi.html">mpi</a> *)</td> </tr> </table> </div><div class="memdoc"> <p>function for fast reduction mod P </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00147">147</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a6b424e0dbad7d3c900375a2ff0154b95"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structmpi.html">mpi</a> ecp_group::N</td> </tr> </table> </div><div class="memdoc"> <ol type="1"> <li>the order of G, or 2. unused </li> </ol> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00143">143</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a372ef0b2cbf3232760e108e5b97c8a3e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t ecp_group::nbits</td> </tr> </table> </div><div class="memdoc"> <p>number of bits in 1. P, or 2. private keys </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00145">145</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="aa743e0f6bdba64120247a92f8edf1318"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structmpi.html">mpi</a> ecp_group::P</td> </tr> </table> </div><div class="memdoc"> <p>prime modulus of the base field </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00139">139</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a3a813481e3d2548e372bab92c50f4d48"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t ecp_group::pbits</td> </tr> </table> </div><div class="memdoc"> <p>number of bits in P </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00144">144</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a14f55dfcfab4b1807f499bde186dff1d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="structecp__point.html">ecp_point</a>* ecp_group::T</td> </tr> </table> </div><div class="memdoc"> <p>pre-computed points for ecp_mul_comb() </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00151">151</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="aeb5e272208e1568f6f806d4ab14b782f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void* ecp_group::t_data</td> </tr> </table> </div><div class="memdoc"> <p>unused </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00150">150</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a725515d364696ab58c49cab20a27bbc5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* ecp_group::t_post)(<a class="el" href="structecp__point.html">ecp_point</a> *, void *)</td> </tr> </table> </div><div class="memdoc"> <p>unused </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00149">149</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="a1b5b1955d1f8c3f5d275e1b70fa2ef6b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int(* ecp_group::t_pre)(<a class="el" href="structecp__point.html">ecp_point</a> *, void *)</td> </tr> </table> </div><div class="memdoc"> <p>unused </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00148">148</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <a class="anchor" id="aa139ffe369496827f4dc0880fc73c02c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">size_t ecp_group::T_size</td> </tr> </table> </div><div class="memdoc"> <p>number for pre-computed points </p> <p>Definition at line <a class="el" href="ecp_8h_source.html#l00152">152</a> of file <a class="el" href="ecp_8h_source.html">ecp.h</a>.</p> </div> </div> <hr/>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="ecp_8h_source.html">ecp.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Mon May 4 2015 10:42:42 for PolarSSL v1.3.9 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>