1 <!-- HTML header for doxygen 1.8.10--> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 <html xmlns="http://www.w3.org/1999/xhtml"> 4 <head> 5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 6 <meta http-equiv="X-UA-Compatible" content="IE=9"/> 7 <meta name="generator" content="Doxygen 1.8.14"/> 8 <title>Intel® Enhanced Privacy ID SDK: ecdsa</title> 9 <link href="tabs.css" rel="stylesheet" type="text/css"/> 10 <script type="text/javascript" src="jquery.js"></script> 11 <script type="text/javascript" src="dynsections.js"></script> 12 <link href="navtree.css" rel="stylesheet" type="text/css"/> 13 <script type="text/javascript" src="resize.js"></script> 14 <script type="text/javascript" src="navtreedata.js"></script> 15 <script type="text/javascript" src="navtree.js"></script> 16 <script type="text/javascript"> 17 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 18 $(document).ready(initResizable); 19 /* @license-end */</script> 20 <link href="doxygen.css" rel="stylesheet" type="text/css" /> 21 <link href="epidstyle.css" rel="stylesheet" type="text/css"/> 22 </head> 23 <body> 24 <div id="top"><!-- do not remove this div, it is closed by doxygen! --> 25 <div id="titlearea"> 26 <table cellspacing="0" cellpadding="0"> 27 <tbody> 28 <tr style="height: 56px;"> 29 <td id="projectalign" style="padding-left: 0.5em;"> 30 <div id="projectname"><a 31 onclick="storeLink('index.html')" 32 id="projectlink" 33 class="index.html" 34 href="index.html">Intel® Enhanced Privacy ID SDK</a> 35  <span id="projectnumber">6.0.1</span> 36 </div> 37 </td> 38 </tr> 39 </tbody> 40 </table> 41 </div> 42 <!-- end header part --> 43 <!-- Generated by Doxygen 1.8.14 --> 44 </div><!-- top --> 45 <div id="side-nav" class="ui-resizable side-nav-resizable"> 46 <div id="nav-tree"> 47 <div id="nav-tree-contents"> 48 <div id="nav-sync" class="sync"></div> 49 </div> 50 </div> 51 <div id="splitbar" style="-moz-user-select:none;" 52 class="ui-resizable-handle"> 53 </div> 54 </div> 55 <script type="text/javascript"> 56 /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 57 $(document).ready(function(){initNavTree('group___ecdsa_primitives.html','');}); 58 /* @license-end */ 59 </script> 60 <div id="doc-content"> 61 <div class="header"> 62 <div class="summary"> 63 <a href="#func-members">Functions</a> </div> 64 <div class="headertitle"> 65 <div class="title">ecdsa<div class="ingroups"><a class="el" href="group___epid_module.html">epid&nbsp;</a> » <a class="el" href="group___epid_common.html">common</a> » <a class="el" href="group___epid_math.html">math</a></div></div> </div> 66 </div><!--header--> 67 <div class="contents"> 68 69 <p>Elliptic Curve Digital Signature Algorithm Primitives. 70 <a href="#details">More...</a></p> 71 <table class="memberdecls"> 72 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 73 Functions</h2></td></tr> 74 <tr class="memitem:ga07e4ebd3423e1f6f9ae35f0608dde7c0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___ecdsa_primitives.html#ga07e4ebd3423e1f6f9ae35f0608dde7c0">EcdsaVerifyBuffer</a> (<a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> buf, size_t buf_len, <a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a> const *pubkey, <a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> const *sig)</td></tr> 75 <tr class="memdesc:ga07e4ebd3423e1f6f9ae35f0608dde7c0"><td class="mdescLeft"> </td><td class="mdescRight">Verifies authenticity of a digital signature over a buffer. <a href="#ga07e4ebd3423e1f6f9ae35f0608dde7c0">More...</a><br /></td></tr> 76 <tr class="separator:ga07e4ebd3423e1f6f9ae35f0608dde7c0"><td class="memSeparator" colspan="2"> </td></tr> 77 <tr class="memitem:gaef0e8a31e830fe9285b43a0969e6611a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a">EcdsaSignBuffer</a> (<a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> buf, size_t buf_len, <a class="el" href="struct_ecdsa_private_key.html">EcdsaPrivateKey</a> const *privkey, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> rnd_func, void *rnd_param, <a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> *sig)</td></tr> 78 <tr class="memdesc:gaef0e8a31e830fe9285b43a0969e6611a"><td class="mdescLeft"> </td><td class="mdescRight">Creates ECDSA signature of buffer. <a href="#gaef0e8a31e830fe9285b43a0969e6611a">More...</a><br /></td></tr> 79 <tr class="separator:gaef0e8a31e830fe9285b43a0969e6611a"><td class="memSeparator" colspan="2"> </td></tr> 80 </table> 81 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 82 <p>Elliptic Curve Digital Signature Algorithm Primitives. </p> 83 <p>Provides APIs for computing and checking buffer signatures using the Elliptic Curve Digital Signature Algorithm. </p> 84 <h2 class="groupheader">Function Documentation</h2> 85 <a id="gaef0e8a31e830fe9285b43a0969e6611a"></a> 86 <h2 class="memtitle"><span class="permalink"><a href="#gaef0e8a31e830fe9285b43a0969e6611a">◆ </a></span>EcdsaSignBuffer()</h2> 87 88 <div class="memitem"> 89 <div class="memproto"> 90 <table class="memname"> 91 <tr> 92 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaSignBuffer </td> 93 <td>(</td> 94 <td class="paramtype"><a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> </td> 95 <td class="paramname"><em>buf</em>, </td> 96 </tr> 97 <tr> 98 <td class="paramkey"></td> 99 <td></td> 100 <td class="paramtype">size_t </td> 101 <td class="paramname"><em>buf_len</em>, </td> 102 </tr> 103 <tr> 104 <td class="paramkey"></td> 105 <td></td> 106 <td class="paramtype"><a class="el" href="struct_ecdsa_private_key.html">EcdsaPrivateKey</a> const * </td> 107 <td class="paramname"><em>privkey</em>, </td> 108 </tr> 109 <tr> 110 <td class="paramkey"></td> 111 <td></td> 112 <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> </td> 113 <td class="paramname"><em>rnd_func</em>, </td> 114 </tr> 115 <tr> 116 <td class="paramkey"></td> 117 <td></td> 118 <td class="paramtype">void * </td> 119 <td class="paramname"><em>rnd_param</em>, </td> 120 </tr> 121 <tr> 122 <td class="paramkey"></td> 123 <td></td> 124 <td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> * </td> 125 <td class="paramname"><em>sig</em> </td> 126 </tr> 127 <tr> 128 <td></td> 129 <td>)</td> 130 <td></td><td></td> 131 </tr> 132 </table> 133 </div><div class="memdoc"> 134 135 <p>Creates ECDSA signature of buffer. </p> 136 <p>Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to generate a signature of the SHA-256 hash of the input buffer with the provided private key.</p> 137 <p>The operation is over the standard secp256r1 curve.</p> 138 <dl class="params"><dt>Parameters</dt><dd> 139 <table class="params"> 140 <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to sign. </td></tr> 141 <tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr> 142 <tr><td class="paramdir">[in]</td><td class="paramname">privkey</td><td>The ECDSA private key on secp256r1 curve. </td></tr> 143 <tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator. </td></tr> 144 <tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through context data for rnd_func. </td></tr> 145 <tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The resulting ECDSA signature.</td></tr> 146 </table> 147 </dd> 148 </dl> 149 <dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl> 150 <dl class="retval"><dt>Return values</dt><dd> 151 <table class="retval"> 152 <tr><td class="paramname"><a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360a61234ad9610406da6bf7977afd72a357" title="reached max iteration for random number generation ">kEpidRandMaxIterErr</a></td><td>Failed to sign after maximum number of iterations due to bad luck in random number generation.</td></tr> 153 </table> 154 </dd> 155 </dl> 156 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a" title="Creates ECDSA signature of buffer. ">EcdsaSignBuffer</a> </dd></dl> 157 158 </div> 159 </div> 160 <a id="ga07e4ebd3423e1f6f9ae35f0608dde7c0"></a> 161 <h2 class="memtitle"><span class="permalink"><a href="#ga07e4ebd3423e1f6f9ae35f0608dde7c0">◆ </a></span>EcdsaVerifyBuffer()</h2> 162 163 <div class="memitem"> 164 <div class="memproto"> 165 <table class="memname"> 166 <tr> 167 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaVerifyBuffer </td> 168 <td>(</td> 169 <td class="paramtype"><a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> </td> 170 <td class="paramname"><em>buf</em>, </td> 171 </tr> 172 <tr> 173 <td class="paramkey"></td> 174 <td></td> 175 <td class="paramtype">size_t </td> 176 <td class="paramname"><em>buf_len</em>, </td> 177 </tr> 178 <tr> 179 <td class="paramkey"></td> 180 <td></td> 181 <td class="paramtype"><a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a> const * </td> 182 <td class="paramname"><em>pubkey</em>, </td> 183 </tr> 184 <tr> 185 <td class="paramkey"></td> 186 <td></td> 187 <td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> const * </td> 188 <td class="paramname"><em>sig</em> </td> 189 </tr> 190 <tr> 191 <td></td> 192 <td>)</td> 193 <td></td><td></td> 194 </tr> 195 </table> 196 </div><div class="memdoc"> 197 198 <p>Verifies authenticity of a digital signature over a buffer. </p> 199 <p>Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to verify that the SHA-256 hash of the input buffer was signed with the private key corresponding to the provided public key.</p> 200 <p>The operation is over the standard secp256r1 curve.</p> 201 <dl class="section warning"><dt>Warning</dt><dd>It is the responsibility of the caller to verify the identity of the public key.</dd></dl> 202 <dl class="params"><dt>Parameters</dt><dd> 203 <table class="params"> 204 <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to verify. </td></tr> 205 <tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr> 206 <tr><td class="paramdir">[in]</td><td class="paramname">pubkey</td><td>The ECDSA public key on secp256r1 curve. </td></tr> 207 <tr><td class="paramdir">[in]</td><td class="paramname">sig</td><td>The ECDSA signature to be verified.</td></tr> 208 </table> 209 </dd> 210 </dl> 211 <dl class="section return"><dt>Returns</dt><dd><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360" title="Return status for SDK functions. ">EpidStatus</a></dd></dl> 212 <dl class="retval"><dt>Return values</dt><dd> 213 <table class="retval"> 214 <tr><td class="paramname"><a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360ab45ad60085d03c03ea30b40a0519897e" title="Signature is valid. ">kEpidSigValid</a></td><td><a class="el" href="struct_ecdsa_signature.html" title="ECDSA Signature using NIST 256-bit curve secp256r1. ">EcdsaSignature</a> is valid for the given buffer. </td></tr> 215 <tr><td class="paramname"><a class="el" href="group___error_codes.html#ggafdb27c77c2c4b32c807e326a8a0da360aeedd19b8a1cbdecf963f90b4860e02b8" title="Signature is invalid. ">kEpidSigInvalid</a></td><td><a class="el" href="struct_ecdsa_signature.html" title="ECDSA Signature using NIST 256-bit curve secp256r1. ">EcdsaSignature</a> is invalid for the given buffer.</td></tr> 216 </table> 217 </dd> 218 </dl> 219 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___ecdsa_primitives.html#gaef0e8a31e830fe9285b43a0969e6611a" title="Creates ECDSA signature of buffer. ">EcdsaSignBuffer</a> </dd></dl> 220 221 </div> 222 </div> 223 </div><!-- contents --> 224 </div><!-- doc-content --> 225 <!-- HTML footer for doxygen 1.8.10--> 226 <!-- start footer part --> 227 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 228 <ul> 229 <li class="footer"> 230 © 2016-2017 Intel Corporation 231 </li> 232 </ul> 233 </div> 234 </body> 235 </html> 236