<!-- HTML header for doxygen 1.8.10-->
<!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.14"/>
<title>Intel® Enhanced Privacy ID SDK: ecdsa</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="epidstyle.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 id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a
onclick="storeLink('index.html')"
id="projectlink"
class="index.html"
href="index.html">Intel® Enhanced Privacy ID SDK</a>
 <span id="projectnumber">6.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group___ecdsa_primitives.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="summary">
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<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>
</div><!--header-->
<div class="contents">
<p>Elliptic Curve Digital Signature Algorithm Primitives.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<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>
<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>
<tr class="separator:ga07e4ebd3423e1f6f9ae35f0608dde7c0"><td class="memSeparator" colspan="2"> </td></tr>
<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>
<tr class="memdesc:gaef0e8a31e830fe9285b43a0969e6611a"><td class="mdescLeft"> </td><td class="mdescRight">Creates ECDSA signature of buffer. <a href="#gaef0e8a31e830fe9285b43a0969e6611a">More...</a><br /></td></tr>
<tr class="separator:gaef0e8a31e830fe9285b43a0969e6611a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Elliptic Curve Digital Signature Algorithm Primitives. </p>
<p>Provides APIs for computing and checking buffer signatures using the Elliptic Curve Digital Signature Algorithm. </p>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaef0e8a31e830fe9285b43a0969e6611a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaef0e8a31e830fe9285b43a0969e6611a">◆ </a></span>EcdsaSignBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaSignBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>buf_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_ecdsa_private_key.html">EcdsaPrivateKey</a> const * </td>
<td class="paramname"><em>privkey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> </td>
<td class="paramname"><em>rnd_func</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void * </td>
<td class="paramname"><em>rnd_param</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> * </td>
<td class="paramname"><em>sig</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates ECDSA signature of buffer. </p>
<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>
<p>The operation is over the standard secp256r1 curve.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to sign. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">privkey</td><td>The ECDSA private key on secp256r1 curve. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">rnd_func</td><td>Random number generator. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">rnd_param</td><td>Pass through context data for rnd_func. </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">sig</td><td>The resulting ECDSA signature.</td></tr>
</table>
</dd>
</dl>
<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>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a id="ga07e4ebd3423e1f6f9ae35f0608dde7c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07e4ebd3423e1f6f9ae35f0608dde7c0">◆ </a></span>EcdsaVerifyBuffer()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> EcdsaVerifyBuffer </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> </td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>buf_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_ecdsa_public_key.html">EcdsaPublicKey</a> const * </td>
<td class="paramname"><em>pubkey</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="struct_ecdsa_signature.html">EcdsaSignature</a> const * </td>
<td class="paramname"><em>sig</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Verifies authenticity of a digital signature over a buffer. </p>
<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>
<p>The operation is over the standard secp256r1 curve.</p>
<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>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">buf</td><td>Pointer to buffer containing message to verify. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">buf_len</td><td>The size of buf in bytes. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">pubkey</td><td>The ECDSA public key on secp256r1 curve. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">sig</td><td>The ECDSA signature to be verified.</td></tr>
</table>
</dd>
</dl>
<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>
<dl class="retval"><dt>Return values</dt><dd>
<table class="retval">
<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>
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">
© 2016-2017 Intel Corporation
</li>
</ul>
</div>
</body>
</html>