group___ecdsa_primitives.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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.11"/>
  8. <title>Intel&reg; 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. $(document).ready(initResizable);
  18. $(window).load(resizeHeight);
  19. </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&reg; Enhanced Privacy ID SDK</a>
  35. &#160;<span id="projectnumber">2.0.0</span>
  36. </div>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. <!-- end header part -->
  43. <!-- Generated by Doxygen 1.8.11 -->
  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. $(document).ready(function(){initNavTree('group___ecdsa_primitives.html','');});
  57. </script>
  58. <div id="doc-content">
  59. <div class="header">
  60. <div class="summary">
  61. <a href="#func-members">Functions</a> </div>
  62. <div class="headertitle">
  63. <div class="title">ecdsa<div class="ingroups"><a class="el" href="group___epid_module.html">epid</a> &raquo; <a class="el" href="group___epid_common.html">common</a> &raquo; <a class="el" href="group___epid_math.html">math</a></div></div> </div>
  64. </div><!--header-->
  65. <div class="contents">
  66. <p>Elliptic Curve Digital Signature Algorithm Primitives.
  67. <a href="#details">More...</a></p>
  68. <table class="memberdecls">
  69. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  70. Functions</h2></td></tr>
  71. <tr class="memitem:gaab68de7291db6e42a01e99c2fa40057f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ecdsa_primitives.html#gaab68de7291db6e42a01e99c2fa40057f">EcdsaVerifyBuffer</a> (void const *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>
  72. <tr class="memdesc:gaab68de7291db6e42a01e99c2fa40057f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Verifies authenticity of a digital signature over a buffer. <a href="#gaab68de7291db6e42a01e99c2fa40057f">More...</a><br /></td></tr>
  73. <tr class="separator:gaab68de7291db6e42a01e99c2fa40057f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  74. <tr class="memitem:ga67091ecae643c1b8a0b0a4946eda7afe"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___ecdsa_primitives.html#ga67091ecae643c1b8a0b0a4946eda7afe">EcdsaSignBuffer</a> (void const *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>
  75. <tr class="memdesc:ga67091ecae643c1b8a0b0a4946eda7afe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates ECDSA signature of buffer. <a href="#ga67091ecae643c1b8a0b0a4946eda7afe">More...</a><br /></td></tr>
  76. <tr class="separator:ga67091ecae643c1b8a0b0a4946eda7afe"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. </table>
  78. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  79. <p>Elliptic Curve Digital Signature Algorithm Primitives. </p>
  80. <p>Provides APIs for computing and checking buffer signatures using the Elliptic Curve Digital Signature Algorithm. </p>
  81. <h2 class="groupheader">Function Documentation</h2>
  82. <a class="anchor" id="ga67091ecae643c1b8a0b0a4946eda7afe"></a>
  83. <div class="memitem">
  84. <div class="memproto">
  85. <table class="memname">
  86. <tr>
  87. <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaSignBuffer </td>
  88. <td>(</td>
  89. <td class="paramtype">void const *&#160;</td>
  90. <td class="paramname"><em>buf</em>, </td>
  91. </tr>
  92. <tr>
  93. <td class="paramkey"></td>
  94. <td></td>
  95. <td class="paramtype">size_t&#160;</td>
  96. <td class="paramname"><em>buf_len</em>, </td>
  97. </tr>
  98. <tr>
  99. <td class="paramkey"></td>
  100. <td></td>
  101. <td class="paramtype"><a class="el" href="struct_ecdsa_private_key.html">EcdsaPrivateKey</a> const *&#160;</td>
  102. <td class="paramname"><em>privkey</em>, </td>
  103. </tr>
  104. <tr>
  105. <td class="paramkey"></td>
  106. <td></td>
  107. <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a>&#160;</td>
  108. <td class="paramname"><em>rnd_func</em>, </td>
  109. </tr>
  110. <tr>
  111. <td class="paramkey"></td>
  112. <td></td>
  113. <td class="paramtype">void *&#160;</td>
  114. <td class="paramname"><em>rnd_param</em>, </td>
  115. </tr>
  116. <tr>
  117. <td class="paramkey"></td>
  118. <td></td>
  119. <td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> *&#160;</td>
  120. <td class="paramname"><em>sig</em>&#160;</td>
  121. </tr>
  122. <tr>
  123. <td></td>
  124. <td>)</td>
  125. <td></td><td></td>
  126. </tr>
  127. </table>
  128. </div><div class="memdoc">
  129. <p>Creates ECDSA signature of buffer. </p>
  130. <p>Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to generate a signature of the SHA256 hash of the input buffer with the provided private key.</p>
  131. <p>The operation is over the standard secp256r1 curve.</p>
  132. <dl class="params"><dt>Parameters</dt><dd>
  133. <table class="params">
  134. <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to sign. </td></tr>
  135. <tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr>
  136. <tr><td class="paramdir">[in]</td><td class="paramname">privkey</td><td>The ECDSA private key on secp256r1 curve. </td></tr>
  137. <tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator. </td></tr>
  138. <tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through context data for rnd_func. </td></tr>
  139. <tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The resulting ECDSA signature.</td></tr>
  140. </table>
  141. </dd>
  142. </dl>
  143. <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>
  144. <dl class="retval"><dt>Return values</dt><dd>
  145. <table class="retval">
  146. <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>
  147. </table>
  148. </dd>
  149. </dl>
  150. <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___ecdsa_primitives.html#ga67091ecae643c1b8a0b0a4946eda7afe" title="Creates ECDSA signature of buffer. ">EcdsaSignBuffer</a> </dd></dl>
  151. </div>
  152. </div>
  153. <a class="anchor" id="gaab68de7291db6e42a01e99c2fa40057f"></a>
  154. <div class="memitem">
  155. <div class="memproto">
  156. <table class="memname">
  157. <tr>
  158. <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaVerifyBuffer </td>
  159. <td>(</td>
  160. <td class="paramtype">void const *&#160;</td>
  161. <td class="paramname"><em>buf</em>, </td>
  162. </tr>
  163. <tr>
  164. <td class="paramkey"></td>
  165. <td></td>
  166. <td class="paramtype">size_t&#160;</td>
  167. <td class="paramname"><em>buf_len</em>, </td>
  168. </tr>
  169. <tr>
  170. <td class="paramkey"></td>
  171. <td></td>
  172. <td class="paramtype"><a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a> const *&#160;</td>
  173. <td class="paramname"><em>pubkey</em>, </td>
  174. </tr>
  175. <tr>
  176. <td class="paramkey"></td>
  177. <td></td>
  178. <td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> const *&#160;</td>
  179. <td class="paramname"><em>sig</em>&#160;</td>
  180. </tr>
  181. <tr>
  182. <td></td>
  183. <td>)</td>
  184. <td></td><td></td>
  185. </tr>
  186. </table>
  187. </div><div class="memdoc">
  188. <p>Verifies authenticity of a digital signature over a buffer. </p>
  189. <p>Uses Elliptic Curve Digital Signature Algorithm (ECDSA) to verify that the SHA256 hash of the input buffer was signed with the private key corresponding to the provided public key.</p>
  190. <p>The operation is over the standard secp256r1 curve.</p>
  191. <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>
  192. <dl class="params"><dt>Parameters</dt><dd>
  193. <table class="params">
  194. <tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to verify. </td></tr>
  195. <tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr>
  196. <tr><td class="paramdir">[in]</td><td class="paramname">pubkey</td><td>The ECDSA public key on secp256r1 curve. </td></tr>
  197. <tr><td class="paramdir">[in]</td><td class="paramname">sig</td><td>The ECDSA signature to be verified.</td></tr>
  198. </table>
  199. </dd>
  200. </dl>
  201. <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>
  202. <dl class="retval"><dt>Return values</dt><dd>
  203. <table class="retval">
  204. <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>
  205. <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>
  206. </table>
  207. </dd>
  208. </dl>
  209. <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___ecdsa_primitives.html#ga67091ecae643c1b8a0b0a4946eda7afe" title="Creates ECDSA signature of buffer. ">EcdsaSignBuffer</a> </dd></dl>
  210. </div>
  211. </div>
  212. </div><!-- contents -->
  213. </div><!-- doc-content -->
  214. <!-- HTML footer for doxygen 1.8.10-->
  215. <!-- start footer part -->
  216. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  217. <ul>
  218. <li class="footer">
  219. &copy; 2016 Intel Corporation
  220. </li>
  221. </ul>
  222. </div>
  223. </body>
  224. </html>