<!-- 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: tpm2</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___tpm2_module.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">tpm2<div class="ingroups"><a class="el" href="group___epid_module.html">epid&nbsp;</a> » <a class="el" href="group___epid_member_module.html">member</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Internal interface that models TPM 2.0 interfaces. <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:ga750e38b6d6cea1b05f605e476df065d9"><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___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9">Tpm2Commit</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *p1, void const *s2, size_t s2_len, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *y2, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *k, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *l, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> *e, uint16_t *counter)</td></tr> <tr class="memdesc:ga750e38b6d6cea1b05f605e476df065d9"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_Commit TPM operation. <a href="#ga750e38b6d6cea1b05f605e476df065d9">More...</a><br /></td></tr> <tr class="separator:ga750e38b6d6cea1b05f605e476df065d9"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga11a523e65eee3c7ad1ab21239329ce3e"><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___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e">Tpm2CreateContext</a> (<a class="el" href="struct_member_params.html">MemberParams</a> const *params, Epid2Params_ const *epid2_params, <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> *rnd_func, void **rnd_param, const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> **f, <a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr> <tr class="memdesc:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new Tpm context. <a href="#ga11a523e65eee3c7ad1ab21239329ce3e">More...</a><br /></td></tr> <tr class="separator:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga38f47cba4c26320db06aa50a77590ef4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4">Tpm2DeleteContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr> <tr class="memdesc:ga38f47cba4c26320db06aa50a77590ef4"><td class="mdescLeft"> </td><td class="mdescRight">Deletes an existing Tpm context. <a href="#ga38f47cba4c26320db06aa50a77590ef4">More...</a><br /></td></tr> <tr class="separator:ga38f47cba4c26320db06aa50a77590ef4"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga11cc131debbca60c0de7e53d48330b69"><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___tpm2_module.html#ga11cc131debbca60c0de7e53d48330b69">Tpm2SetHashAlg</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr> <tr class="memdesc:ga11cc131debbca60c0de7e53d48330b69"><td class="mdescLeft"> </td><td class="mdescRight">Sets the hash algorithm to be used by a TPM2. <a href="#ga11cc131debbca60c0de7e53d48330b69">More...</a><br /></td></tr> <tr class="separator:ga11cc131debbca60c0de7e53d48330b69"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___tpm2_module.html#ga8ee4fed3e1a4dd0c910102430fca8c81">Tpm2ResetContext</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> **ctx)</td></tr> <tr class="memdesc:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="mdescLeft"> </td><td class="mdescRight">Reset an existing Tpm context. <a href="#ga8ee4fed3e1a4dd0c910102430fca8c81">More...</a><br /></td></tr> <tr class="separator:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gae7f35aaf9045e4e21bc2ec56e384fcf6"><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___tpm2_module.html#gae7f35aaf9045e4e21bc2ec56e384fcf6">Tpm2GetRandom</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, int const num_bits, void *random_data)</td></tr> <tr class="memdesc:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="mdescLeft"> </td><td class="mdescRight">Get random data. <a href="#gae7f35aaf9045e4e21bc2ec56e384fcf6">More...</a><br /></td></tr> <tr class="separator:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac2507260f635a9c7abd9113cda6918f9"><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___tpm2_module.html#gac2507260f635a9c7abd9113cda6918f9">Tpm2LoadExternal</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *f_str)</td></tr> <tr class="memdesc:gac2507260f635a9c7abd9113cda6918f9"><td class="mdescLeft"> </td><td class="mdescRight">Invokes TPM2_LoadExternal command. <a href="#gac2507260f635a9c7abd9113cda6918f9">More...</a><br /></td></tr> <tr class="separator:gac2507260f635a9c7abd9113cda6918f9"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gadee3a48d63f03d55ea5f02e48d169326"><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___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326">Tpm2NvDefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size)</td></tr> <tr class="memdesc:gadee3a48d63f03d55ea5f02e48d169326"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_NV_DefineSpace TPM command. <a href="#gadee3a48d63f03d55ea5f02e48d169326">More...</a><br /></td></tr> <tr class="separator:gadee3a48d63f03d55ea5f02e48d169326"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga38ca781a9a0126223456e677f40e1d22"><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___tpm2_module.html#ga38ca781a9a0126223456e677f40e1d22">Tpm2NvUndefineSpace</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index)</td></tr> <tr class="memdesc:ga38ca781a9a0126223456e677f40e1d22"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_NV_UndefineSpace TPM command. <a href="#ga38ca781a9a0126223456e677f40e1d22">More...</a><br /></td></tr> <tr class="separator:ga38ca781a9a0126223456e677f40e1d22"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><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___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">Tpm2NvWrite</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void const *data)</td></tr> <tr class="memdesc:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_NV_Write TPM command. <a href="#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">More...</a><br /></td></tr> <tr class="separator:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><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___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd">Tpm2NvRead</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint32_t nv_index, size_t size, uint16_t offset, void *data)</td></tr> <tr class="memdesc:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_NV_Read TPM command. <a href="#ga2ec34e65adaf46a14a78f24a7fd0e4dd">More...</a><br /></td></tr> <tr class="separator:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ga035c8ffba3182ba75a38131e23bb31c7"><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___tpm2_module.html#ga035c8ffba3182ba75a38131e23bb31c7">Tpm2Sign</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, void const *digest, size_t digest_len, uint16_t counter, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *k, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> *s)</td></tr> <tr class="memdesc:ga035c8ffba3182ba75a38131e23bb31c7"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_Sign TPM command. <a href="#ga035c8ffba3182ba75a38131e23bb31c7">More...</a><br /></td></tr> <tr class="separator:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:gac3735163276efa0da4b793ba935513bb"><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___tpm2_module.html#gac3735163276efa0da4b793ba935513bb">Tpm2ReleaseCounter</a> (<a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> *ctx, uint16_t counter)</td></tr> <tr class="memdesc:gac3735163276efa0da4b793ba935513bb"><td class="mdescLeft"> </td><td class="mdescRight">Erases random r value assosiated with counter. <a href="#gac3735163276efa0da4b793ba935513bb">More...</a><br /></td></tr> <tr class="separator:gac3735163276efa0da4b793ba935513bb"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <p>Internal interface that models TPM 2.0 interfaces. </p> <p>Provides an interface that represents operations that can be directly translated to operations on TPM 2.0 devices. </p> <h2 class="groupheader">Function Documentation</h2> <a id="ga750e38b6d6cea1b05f605e476df065d9"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga750e38b6d6cea1b05f605e476df065d9">◆ </a></span>Tpm2Commit()</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> Tpm2Commit </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const * </td> <td class="paramname"><em>p1</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void const * </td> <td class="paramname"><em>s2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>s2_len</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const * </td> <td class="paramname"><em>y2</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> <td class="paramname"><em>k</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> <td class="paramname"><em>l</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> <td class="paramname"><em>e</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t * </td> <td class="paramname"><em>counter</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_Commit TPM operation. </p> <p>Generates random r and compute K, L and E points.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>A point P1 on G1 curve. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">s2</td><td>Octet array used to derive x-coordinate of a point P2. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">s2_len</td><td>Length of s2 buffer. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">y2</td><td>y coordinate of the point associated with s2. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">k</td><td>Result of G1.exp(P2, private key f). </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">l</td><td>Result of G1.exp(P2, random r). </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">e</td><td>Result of G1.exp(P1, random r). </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">counter</td><td>A value associated with the random r. Should be initialized with zero.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl> </div> </div> <a id="ga11a523e65eee3c7ad1ab21239329ce3e"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga11a523e65eee3c7ad1ab21239329ce3e">◆ </a></span>Tpm2CreateContext()</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> Tpm2CreateContext </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_member_params.html">MemberParams</a> const * </td> <td class="paramname"><em>params</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">Epid2Params_ const * </td> <td class="paramname"><em>epid2_params</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">const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> ** </td> <td class="paramname"><em>f</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> <td class="paramname"><em>ctx</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Creates a new Tpm context. </p> <p>Must be called to create the TPM context that is used by other TPM APIs.</p> <p>You need to use a cryptographically secure random number generator to create a TPM context. The <a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c" title="Generates random data. ">BitSupplier</a> is provided as a function prototype for your own implementation of the random number generator.</p> <p><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4" title="Deletes an existing Tpm context. ">Tpm2DeleteContext</a> must be called to safely release the TPM context.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">params</td><td>member parameters to initialize rnd_func, rnd_param, ff_elem, ctx.</td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">epid2_params</td><td>The field and group parameters.</td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">rnd_func</td><td>random function if exists in MemberParms</td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">rnd_param</td><td>random parameters if exists in MemberParms</td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">f</td><td>seed f if exists in <a class="el" href="struct_member_params.html" title="Software only specific member parameters. ">MemberParams</a></td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>Newly constructed TPM context.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga38f47cba4c26320db06aa50a77590ef4" title="Deletes an existing Tpm context. ">Tpm2DeleteContext</a> </dd></dl> </div> </div> <a id="ga38f47cba4c26320db06aa50a77590ef4"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga38f47cba4c26320db06aa50a77590ef4">◆ </a></span>Tpm2DeleteContext()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Tpm2DeleteContext </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Deletes an existing Tpm context. </p> <p>Must be called to safely release a TPM context created using <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a>.</p> <p>De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl> </div> </div> <a id="gae7f35aaf9045e4e21bc2ec56e384fcf6"></a> <h2 class="memtitle"><span class="permalink"><a href="#gae7f35aaf9045e4e21bc2ec56e384fcf6">◆ </a></span>Tpm2GetRandom()</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> Tpm2GetRandom </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int const </td> <td class="paramname"><em>num_bits</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"><em>random_data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Get random data. </p> <p>This command returns the next num_bits from the random number generator (RNG).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">num_bits</td><td>Number of bits to return.</td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">random_data</td><td>Output random bits.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl> </div> </div> <a id="gac2507260f635a9c7abd9113cda6918f9"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac2507260f635a9c7abd9113cda6918f9">◆ </a></span>Tpm2LoadExternal()</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> Tpm2LoadExternal </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const * </td> <td class="paramname"><em>f_str</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Invokes TPM2_LoadExternal command. </p> <p>This command is used to load an object that is not a Protected Object into the TPM. The command allows loading of a public area or both a public and sensitive area.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">f_str</td><td>The f value of the member private key.</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> </div> </div> <a id="gadee3a48d63f03d55ea5f02e48d169326"></a> <h2 class="memtitle"><span class="permalink"><a href="#gadee3a48d63f03d55ea5f02e48d169326">◆ </a></span>Tpm2NvDefineSpace()</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> Tpm2NvDefineSpace </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"><em>nv_index</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_NV_DefineSpace TPM command. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of the data area.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga2ec34e65adaf46a14a78f24a7fd0e4dd" title="Performs TPM2_NV_Read TPM command. ">Tpm2NvRead</a> </dd> <dd> <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc" title="Performs TPM2_NV_Write TPM command. ">Tpm2NvWrite</a> </dd></dl> </div> </div> <a id="ga2ec34e65adaf46a14a78f24a7fd0e4dd"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga2ec34e65adaf46a14a78f24a7fd0e4dd">◆ </a></span>Tpm2NvRead()</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> Tpm2NvRead </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"><em>nv_index</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"><em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"><em>data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_NV_Read TPM command. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be read. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to read. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Data read.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc" title="Performs TPM2_NV_Write TPM command. ">Tpm2NvWrite</a> </dd></dl> </div> </div> <a id="ga38ca781a9a0126223456e677f40e1d22"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga38ca781a9a0126223456e677f40e1d22">◆ </a></span>Tpm2NvUndefineSpace()</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> Tpm2NvUndefineSpace </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"><em>nv_index</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_NV_UndefineSpace TPM command. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area to undefine.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326" title="Performs TPM2_NV_DefineSpace TPM command. ">Tpm2NvDefineSpace</a> </dd></dl> </div> </div> <a id="gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"></a> <h2 class="memtitle"><span class="permalink"><a href="#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">◆ </a></span>Tpm2NvWrite()</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> Tpm2NvWrite </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t </td> <td class="paramname"><em>nv_index</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>size</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"><em>offset</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void const * </td> <td class="paramname"><em>data</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_NV_Write TPM command. </p> <p>An area in NV memory must be defined prior writing.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be write. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to write. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Data to write.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#gadee3a48d63f03d55ea5f02e48d169326" title="Performs TPM2_NV_DefineSpace TPM command. ">Tpm2NvDefineSpace</a> </dd></dl> </div> </div> <a id="gac3735163276efa0da4b793ba935513bb"></a> <h2 class="memtitle"><span class="permalink"><a href="#gac3735163276efa0da4b793ba935513bb">◆ </a></span>Tpm2ReleaseCounter()</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> Tpm2ReleaseCounter </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"><em>counter</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Erases random r value assosiated with counter. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">counter</td><td>To be released value associated with the random r generated during TPM2_Commit.</td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>This function should be used if Tpm2Sign wasn't called after Tpm2Commit which created counter.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9" title="Performs TPM2_Commit TPM operation. ">Tpm2Commit</a> </dd></dl> </div> </div> <a id="ga8ee4fed3e1a4dd0c910102430fca8c81"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga8ee4fed3e1a4dd0c910102430fca8c81">◆ </a></span>Tpm2ResetContext()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void Tpm2ResetContext </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> <td class="paramname"><em>ctx</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>Reset an existing Tpm context. </p> <p>Must be called to reset a TPM context created using <a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a>.</p> <p>Re-initializes the context, reset memory used for primary key.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr> </table> </dd> </dl> <dl class="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd></dl> </div> </div> <a id="ga11cc131debbca60c0de7e53d48330b69"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga11cc131debbca60c0de7e53d48330b69">◆ </a></span>Tpm2SetHashAlg()</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> Tpm2SetHashAlg </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> </td> <td class="paramname"><em>hash_alg</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Sets the hash algorithm to be used by a TPM2. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM2 context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>The hash algorithm to use.</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> </div> </div> <a id="ga035c8ffba3182ba75a38131e23bb31c7"></a> <h2 class="memtitle"><span class="permalink"><a href="#ga035c8ffba3182ba75a38131e23bb31c7">◆ </a></span>Tpm2Sign()</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> Tpm2Sign </td> <td>(</td> <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> <td class="paramname"><em>ctx</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void const * </td> <td class="paramname"><em>digest</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">size_t </td> <td class="paramname"><em>digest_len</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint16_t </td> <td class="paramname"><em>counter</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> * </td> <td class="paramname"><em>k</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> * </td> <td class="paramname"><em>s</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Performs TPM2_Sign TPM command. </p> <p>Calculate a pair (k, s) an ECDAA signature.</p> <p>Private key f must exist in the TPM context.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">digest</td><td>Digest to be signed. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">digest_len</td><td>The size of digest in bytes. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">counter</td><td>A value associated with the random r generated during TPM2_Commit. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">k</td><td>The ECDAA signature k value. Nonce produced by the TPM during signing. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">s</td><td>The ECDAA signature s value.</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="section see"><dt>See also</dt><dd><a class="el" href="group___tpm2_module.html#ga11a523e65eee3c7ad1ab21239329ce3e" title="Creates a new Tpm context. ">Tpm2CreateContext</a> </dd> <dd> <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9" title="Performs TPM2_Commit TPM operation. ">Tpm2Commit</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>