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: tpm2</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___tpm2_module.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">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> 66 </div><!--header--> 67 <div class="contents"> 68 69 <p>Internal interface that models TPM 2.0 interfaces. 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: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> 75 <tr class="memdesc:ga750e38b6d6cea1b05f605e476df065d9"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_Commit TPM operation. <a href="#ga750e38b6d6cea1b05f605e476df065d9">More...</a><br /></td></tr> 76 <tr class="separator:ga750e38b6d6cea1b05f605e476df065d9"><td class="memSeparator" colspan="2"> </td></tr> 77 <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> 78 <tr class="memdesc:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="mdescLeft"> </td><td class="mdescRight">Creates a new Tpm context. <a href="#ga11a523e65eee3c7ad1ab21239329ce3e">More...</a><br /></td></tr> 79 <tr class="separator:ga11a523e65eee3c7ad1ab21239329ce3e"><td class="memSeparator" colspan="2"> </td></tr> 80 <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> 81 <tr class="memdesc:ga38f47cba4c26320db06aa50a77590ef4"><td class="mdescLeft"> </td><td class="mdescRight">Deletes an existing Tpm context. <a href="#ga38f47cba4c26320db06aa50a77590ef4">More...</a><br /></td></tr> 82 <tr class="separator:ga38f47cba4c26320db06aa50a77590ef4"><td class="memSeparator" colspan="2"> </td></tr> 83 <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> 84 <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> 85 <tr class="separator:ga11cc131debbca60c0de7e53d48330b69"><td class="memSeparator" colspan="2"> </td></tr> 86 <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> 87 <tr class="memdesc:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="mdescLeft"> </td><td class="mdescRight">Reset an existing Tpm context. <a href="#ga8ee4fed3e1a4dd0c910102430fca8c81">More...</a><br /></td></tr> 88 <tr class="separator:ga8ee4fed3e1a4dd0c910102430fca8c81"><td class="memSeparator" colspan="2"> </td></tr> 89 <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> 90 <tr class="memdesc:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="mdescLeft"> </td><td class="mdescRight">Get random data. <a href="#gae7f35aaf9045e4e21bc2ec56e384fcf6">More...</a><br /></td></tr> 91 <tr class="separator:gae7f35aaf9045e4e21bc2ec56e384fcf6"><td class="memSeparator" colspan="2"> </td></tr> 92 <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> 93 <tr class="memdesc:gac2507260f635a9c7abd9113cda6918f9"><td class="mdescLeft"> </td><td class="mdescRight">Invokes TPM2_LoadExternal command. <a href="#gac2507260f635a9c7abd9113cda6918f9">More...</a><br /></td></tr> 94 <tr class="separator:gac2507260f635a9c7abd9113cda6918f9"><td class="memSeparator" colspan="2"> </td></tr> 95 <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> 96 <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> 97 <tr class="separator:gadee3a48d63f03d55ea5f02e48d169326"><td class="memSeparator" colspan="2"> </td></tr> 98 <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> 99 <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> 100 <tr class="separator:ga38ca781a9a0126223456e677f40e1d22"><td class="memSeparator" colspan="2"> </td></tr> 101 <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> 102 <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> 103 <tr class="separator:gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"><td class="memSeparator" colspan="2"> </td></tr> 104 <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> 105 <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> 106 <tr class="separator:ga2ec34e65adaf46a14a78f24a7fd0e4dd"><td class="memSeparator" colspan="2"> </td></tr> 107 <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> 108 <tr class="memdesc:ga035c8ffba3182ba75a38131e23bb31c7"><td class="mdescLeft"> </td><td class="mdescRight">Performs TPM2_Sign TPM command. <a href="#ga035c8ffba3182ba75a38131e23bb31c7">More...</a><br /></td></tr> 109 <tr class="separator:ga035c8ffba3182ba75a38131e23bb31c7"><td class="memSeparator" colspan="2"> </td></tr> 110 <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> 111 <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> 112 <tr class="separator:gac3735163276efa0da4b793ba935513bb"><td class="memSeparator" colspan="2"> </td></tr> 113 </table> 114 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 115 <p>Internal interface that models TPM 2.0 interfaces. </p> 116 <p>Provides an interface that represents operations that can be directly translated to operations on TPM 2.0 devices. </p> 117 <h2 class="groupheader">Function Documentation</h2> 118 <a id="ga750e38b6d6cea1b05f605e476df065d9"></a> 119 <h2 class="memtitle"><span class="permalink"><a href="#ga750e38b6d6cea1b05f605e476df065d9">◆ </a></span>Tpm2Commit()</h2> 120 121 <div class="memitem"> 122 <div class="memproto"> 123 <table class="memname"> 124 <tr> 125 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2Commit </td> 126 <td>(</td> 127 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 128 <td class="paramname"><em>ctx</em>, </td> 129 </tr> 130 <tr> 131 <td class="paramkey"></td> 132 <td></td> 133 <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const * </td> 134 <td class="paramname"><em>p1</em>, </td> 135 </tr> 136 <tr> 137 <td class="paramkey"></td> 138 <td></td> 139 <td class="paramtype">void const * </td> 140 <td class="paramname"><em>s2</em>, </td> 141 </tr> 142 <tr> 143 <td class="paramkey"></td> 144 <td></td> 145 <td class="paramtype">size_t </td> 146 <td class="paramname"><em>s2_len</em>, </td> 147 </tr> 148 <tr> 149 <td class="paramkey"></td> 150 <td></td> 151 <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const * </td> 152 <td class="paramname"><em>y2</em>, </td> 153 </tr> 154 <tr> 155 <td class="paramkey"></td> 156 <td></td> 157 <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> 158 <td class="paramname"><em>k</em>, </td> 159 </tr> 160 <tr> 161 <td class="paramkey"></td> 162 <td></td> 163 <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> 164 <td class="paramname"><em>l</em>, </td> 165 </tr> 166 <tr> 167 <td class="paramkey"></td> 168 <td></td> 169 <td class="paramtype"><a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> * </td> 170 <td class="paramname"><em>e</em>, </td> 171 </tr> 172 <tr> 173 <td class="paramkey"></td> 174 <td></td> 175 <td class="paramtype">uint16_t * </td> 176 <td class="paramname"><em>counter</em> </td> 177 </tr> 178 <tr> 179 <td></td> 180 <td>)</td> 181 <td></td><td></td> 182 </tr> 183 </table> 184 </div><div class="memdoc"> 185 186 <p>Performs TPM2_Commit TPM operation. </p> 187 <p>Generates random r and compute K, L and E points.</p> 188 <dl class="params"><dt>Parameters</dt><dd> 189 <table class="params"> 190 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 191 <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>A point P1 on G1 curve. </td></tr> 192 <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> 193 <tr><td class="paramdir">[in]</td><td class="paramname">s2_len</td><td>Length of s2 buffer. </td></tr> 194 <tr><td class="paramdir">[in]</td><td class="paramname">y2</td><td>y coordinate of the point associated with s2. </td></tr> 195 <tr><td class="paramdir">[out]</td><td class="paramname">k</td><td>Result of G1.exp(P2, private key f). </td></tr> 196 <tr><td class="paramdir">[out]</td><td class="paramname">l</td><td>Result of G1.exp(P2, random r). </td></tr> 197 <tr><td class="paramdir">[out]</td><td class="paramname">e</td><td>Result of G1.exp(P1, random r). </td></tr> 198 <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> 199 </table> 200 </dd> 201 </dl> 202 <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> 203 <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> 204 205 </div> 206 </div> 207 <a id="ga11a523e65eee3c7ad1ab21239329ce3e"></a> 208 <h2 class="memtitle"><span class="permalink"><a href="#ga11a523e65eee3c7ad1ab21239329ce3e">◆ </a></span>Tpm2CreateContext()</h2> 209 210 <div class="memitem"> 211 <div class="memproto"> 212 <table class="memname"> 213 <tr> 214 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2CreateContext </td> 215 <td>(</td> 216 <td class="paramtype"><a class="el" href="struct_member_params.html">MemberParams</a> const * </td> 217 <td class="paramname"><em>params</em>, </td> 218 </tr> 219 <tr> 220 <td class="paramkey"></td> 221 <td></td> 222 <td class="paramtype">Epid2Params_ const * </td> 223 <td class="paramname"><em>epid2_params</em>, </td> 224 </tr> 225 <tr> 226 <td class="paramkey"></td> 227 <td></td> 228 <td class="paramtype"><a class="el" href="group___epid_common.html#ga6119a2c0323a3fca9e502b24bc378c2c">BitSupplier</a> * </td> 229 <td class="paramname"><em>rnd_func</em>, </td> 230 </tr> 231 <tr> 232 <td class="paramkey"></td> 233 <td></td> 234 <td class="paramtype">void ** </td> 235 <td class="paramname"><em>rnd_param</em>, </td> 236 </tr> 237 <tr> 238 <td class="paramkey"></td> 239 <td></td> 240 <td class="paramtype">const <a class="el" href="struct_fp_elem_str.html">FpElemStr</a> ** </td> 241 <td class="paramname"><em>f</em>, </td> 242 </tr> 243 <tr> 244 <td class="paramkey"></td> 245 <td></td> 246 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> 247 <td class="paramname"><em>ctx</em> </td> 248 </tr> 249 <tr> 250 <td></td> 251 <td>)</td> 252 <td></td><td></td> 253 </tr> 254 </table> 255 </div><div class="memdoc"> 256 257 <p>Creates a new Tpm context. </p> 258 <p>Must be called to create the TPM context that is used by other TPM APIs.</p> 259 <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> 260 <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> 261 <dl class="params"><dt>Parameters</dt><dd> 262 <table class="params"> 263 <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> 264 <tr><td class="paramdir">[in]</td><td class="paramname">epid2_params</td><td>The field and group parameters.</td></tr> 265 <tr><td class="paramdir">[out]</td><td class="paramname">rnd_func</td><td>random function if exists in MemberParms</td></tr> 266 <tr><td class="paramdir">[out]</td><td class="paramname">rnd_param</td><td>random parameters if exists in MemberParms</td></tr> 267 <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> 268 <tr><td class="paramdir">[out]</td><td class="paramname">ctx</td><td>Newly constructed TPM context.</td></tr> 269 </table> 270 </dd> 271 </dl> 272 <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> 273 <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> 274 275 </div> 276 </div> 277 <a id="ga38f47cba4c26320db06aa50a77590ef4"></a> 278 <h2 class="memtitle"><span class="permalink"><a href="#ga38f47cba4c26320db06aa50a77590ef4">◆ </a></span>Tpm2DeleteContext()</h2> 279 280 <div class="memitem"> 281 <div class="memproto"> 282 <table class="memname"> 283 <tr> 284 <td class="memname">void Tpm2DeleteContext </td> 285 <td>(</td> 286 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> 287 <td class="paramname"><em>ctx</em></td><td>)</td> 288 <td></td> 289 </tr> 290 </table> 291 </div><div class="memdoc"> 292 293 <p>Deletes an existing Tpm context. </p> 294 <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> 295 <p>De-initializes the context, frees memory used by the context, and sets the context pointer to NULL.</p> 296 <dl class="params"><dt>Parameters</dt><dd> 297 <table class="params"> 298 <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr> 299 </table> 300 </dd> 301 </dl> 302 <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> 303 304 </div> 305 </div> 306 <a id="gae7f35aaf9045e4e21bc2ec56e384fcf6"></a> 307 <h2 class="memtitle"><span class="permalink"><a href="#gae7f35aaf9045e4e21bc2ec56e384fcf6">◆ </a></span>Tpm2GetRandom()</h2> 308 309 <div class="memitem"> 310 <div class="memproto"> 311 <table class="memname"> 312 <tr> 313 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2GetRandom </td> 314 <td>(</td> 315 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 316 <td class="paramname"><em>ctx</em>, </td> 317 </tr> 318 <tr> 319 <td class="paramkey"></td> 320 <td></td> 321 <td class="paramtype">int const </td> 322 <td class="paramname"><em>num_bits</em>, </td> 323 </tr> 324 <tr> 325 <td class="paramkey"></td> 326 <td></td> 327 <td class="paramtype">void * </td> 328 <td class="paramname"><em>random_data</em> </td> 329 </tr> 330 <tr> 331 <td></td> 332 <td>)</td> 333 <td></td><td></td> 334 </tr> 335 </table> 336 </div><div class="memdoc"> 337 338 <p>Get random data. </p> 339 <p>This command returns the next num_bits from the random number generator (RNG).</p> 340 <dl class="params"><dt>Parameters</dt><dd> 341 <table class="params"> 342 <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr> 343 <tr><td class="paramdir">[in]</td><td class="paramname">num_bits</td><td>Number of bits to return.</td></tr> 344 <tr><td class="paramdir">[out]</td><td class="paramname">random_data</td><td>Output random bits.</td></tr> 345 </table> 346 </dd> 347 </dl> 348 <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> 349 <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> 350 351 </div> 352 </div> 353 <a id="gac2507260f635a9c7abd9113cda6918f9"></a> 354 <h2 class="memtitle"><span class="permalink"><a href="#gac2507260f635a9c7abd9113cda6918f9">◆ </a></span>Tpm2LoadExternal()</h2> 355 356 <div class="memitem"> 357 <div class="memproto"> 358 <table class="memname"> 359 <tr> 360 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2LoadExternal </td> 361 <td>(</td> 362 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 363 <td class="paramname"><em>ctx</em>, </td> 364 </tr> 365 <tr> 366 <td class="paramkey"></td> 367 <td></td> 368 <td class="paramtype"><a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const * </td> 369 <td class="paramname"><em>f_str</em> </td> 370 </tr> 371 <tr> 372 <td></td> 373 <td>)</td> 374 <td></td><td></td> 375 </tr> 376 </table> 377 </div><div class="memdoc"> 378 379 <p>Invokes TPM2_LoadExternal command. </p> 380 <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> 381 <dl class="params"><dt>Parameters</dt><dd> 382 <table class="params"> 383 <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>TPM context.</td></tr> 384 <tr><td class="paramdir">[in]</td><td class="paramname">f_str</td><td>The f value of the member private key.</td></tr> 385 </table> 386 </dd> 387 </dl> 388 <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> 389 390 </div> 391 </div> 392 <a id="gadee3a48d63f03d55ea5f02e48d169326"></a> 393 <h2 class="memtitle"><span class="permalink"><a href="#gadee3a48d63f03d55ea5f02e48d169326">◆ </a></span>Tpm2NvDefineSpace()</h2> 394 395 <div class="memitem"> 396 <div class="memproto"> 397 <table class="memname"> 398 <tr> 399 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvDefineSpace </td> 400 <td>(</td> 401 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 402 <td class="paramname"><em>ctx</em>, </td> 403 </tr> 404 <tr> 405 <td class="paramkey"></td> 406 <td></td> 407 <td class="paramtype">uint32_t </td> 408 <td class="paramname"><em>nv_index</em>, </td> 409 </tr> 410 <tr> 411 <td class="paramkey"></td> 412 <td></td> 413 <td class="paramtype">size_t </td> 414 <td class="paramname"><em>size</em> </td> 415 </tr> 416 <tr> 417 <td></td> 418 <td>)</td> 419 <td></td><td></td> 420 </tr> 421 </table> 422 </div><div class="memdoc"> 423 424 <p>Performs TPM2_NV_DefineSpace TPM command. </p> 425 <dl class="params"><dt>Parameters</dt><dd> 426 <table class="params"> 427 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 428 <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area. </td></tr> 429 <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of the data area.</td></tr> 430 </table> 431 </dd> 432 </dl> 433 <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> 434 <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> 435 <dd> 436 <a class="el" href="group___tpm2_module.html#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc" title="Performs TPM2_NV_Write TPM command. ">Tpm2NvWrite</a> </dd></dl> 437 438 </div> 439 </div> 440 <a id="ga2ec34e65adaf46a14a78f24a7fd0e4dd"></a> 441 <h2 class="memtitle"><span class="permalink"><a href="#ga2ec34e65adaf46a14a78f24a7fd0e4dd">◆ </a></span>Tpm2NvRead()</h2> 442 443 <div class="memitem"> 444 <div class="memproto"> 445 <table class="memname"> 446 <tr> 447 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvRead </td> 448 <td>(</td> 449 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 450 <td class="paramname"><em>ctx</em>, </td> 451 </tr> 452 <tr> 453 <td class="paramkey"></td> 454 <td></td> 455 <td class="paramtype">uint32_t </td> 456 <td class="paramname"><em>nv_index</em>, </td> 457 </tr> 458 <tr> 459 <td class="paramkey"></td> 460 <td></td> 461 <td class="paramtype">size_t </td> 462 <td class="paramname"><em>size</em>, </td> 463 </tr> 464 <tr> 465 <td class="paramkey"></td> 466 <td></td> 467 <td class="paramtype">uint16_t </td> 468 <td class="paramname"><em>offset</em>, </td> 469 </tr> 470 <tr> 471 <td class="paramkey"></td> 472 <td></td> 473 <td class="paramtype">void * </td> 474 <td class="paramname"><em>data</em> </td> 475 </tr> 476 <tr> 477 <td></td> 478 <td>)</td> 479 <td></td><td></td> 480 </tr> 481 </table> 482 </div><div class="memdoc"> 483 484 <p>Performs TPM2_NV_Read TPM command. </p> 485 <dl class="params"><dt>Parameters</dt><dd> 486 <table class="params"> 487 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 488 <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be read. </td></tr> 489 <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to read. </td></tr> 490 <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr> 491 <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>Data read.</td></tr> 492 </table> 493 </dd> 494 </dl> 495 <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> 496 <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> 497 498 </div> 499 </div> 500 <a id="ga38ca781a9a0126223456e677f40e1d22"></a> 501 <h2 class="memtitle"><span class="permalink"><a href="#ga38ca781a9a0126223456e677f40e1d22">◆ </a></span>Tpm2NvUndefineSpace()</h2> 502 503 <div class="memitem"> 504 <div class="memproto"> 505 <table class="memname"> 506 <tr> 507 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvUndefineSpace </td> 508 <td>(</td> 509 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 510 <td class="paramname"><em>ctx</em>, </td> 511 </tr> 512 <tr> 513 <td class="paramkey"></td> 514 <td></td> 515 <td class="paramtype">uint32_t </td> 516 <td class="paramname"><em>nv_index</em> </td> 517 </tr> 518 <tr> 519 <td></td> 520 <td>)</td> 521 <td></td><td></td> 522 </tr> 523 </table> 524 </div><div class="memdoc"> 525 526 <p>Performs TPM2_NV_UndefineSpace TPM command. </p> 527 <dl class="params"><dt>Parameters</dt><dd> 528 <table class="params"> 529 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 530 <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>Handle of the data area to undefine.</td></tr> 531 </table> 532 </dd> 533 </dl> 534 <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> 535 <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> 536 537 </div> 538 </div> 539 <a id="gabfe5ccf53b8ecb8e2f2b367a39f6e5cc"></a> 540 <h2 class="memtitle"><span class="permalink"><a href="#gabfe5ccf53b8ecb8e2f2b367a39f6e5cc">◆ </a></span>Tpm2NvWrite()</h2> 541 542 <div class="memitem"> 543 <div class="memproto"> 544 <table class="memname"> 545 <tr> 546 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2NvWrite </td> 547 <td>(</td> 548 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 549 <td class="paramname"><em>ctx</em>, </td> 550 </tr> 551 <tr> 552 <td class="paramkey"></td> 553 <td></td> 554 <td class="paramtype">uint32_t </td> 555 <td class="paramname"><em>nv_index</em>, </td> 556 </tr> 557 <tr> 558 <td class="paramkey"></td> 559 <td></td> 560 <td class="paramtype">size_t </td> 561 <td class="paramname"><em>size</em>, </td> 562 </tr> 563 <tr> 564 <td class="paramkey"></td> 565 <td></td> 566 <td class="paramtype">uint16_t </td> 567 <td class="paramname"><em>offset</em>, </td> 568 </tr> 569 <tr> 570 <td class="paramkey"></td> 571 <td></td> 572 <td class="paramtype">void const * </td> 573 <td class="paramname"><em>data</em> </td> 574 </tr> 575 <tr> 576 <td></td> 577 <td>)</td> 578 <td></td><td></td> 579 </tr> 580 </table> 581 </div><div class="memdoc"> 582 583 <p>Performs TPM2_NV_Write TPM command. </p> 584 <p>An area in NV memory must be defined prior writing.</p> 585 <dl class="params"><dt>Parameters</dt><dd> 586 <table class="params"> 587 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 588 <tr><td class="paramdir">[in]</td><td class="paramname">nv_index</td><td>NV Index to be write. </td></tr> 589 <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Number of bytes to write. </td></tr> 590 <tr><td class="paramdir">[in]</td><td class="paramname">offset</td><td>Offset into the area. </td></tr> 591 <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>Data to write.</td></tr> 592 </table> 593 </dd> 594 </dl> 595 <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> 596 <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> 597 598 </div> 599 </div> 600 <a id="gac3735163276efa0da4b793ba935513bb"></a> 601 <h2 class="memtitle"><span class="permalink"><a href="#gac3735163276efa0da4b793ba935513bb">◆ </a></span>Tpm2ReleaseCounter()</h2> 602 603 <div class="memitem"> 604 <div class="memproto"> 605 <table class="memname"> 606 <tr> 607 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2ReleaseCounter </td> 608 <td>(</td> 609 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 610 <td class="paramname"><em>ctx</em>, </td> 611 </tr> 612 <tr> 613 <td class="paramkey"></td> 614 <td></td> 615 <td class="paramtype">uint16_t </td> 616 <td class="paramname"><em>counter</em> </td> 617 </tr> 618 <tr> 619 <td></td> 620 <td>)</td> 621 <td></td><td></td> 622 </tr> 623 </table> 624 </div><div class="memdoc"> 625 626 <p>Erases random r value assosiated with counter. </p> 627 <dl class="params"><dt>Parameters</dt><dd> 628 <table class="params"> 629 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 630 <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> 631 </table> 632 </dd> 633 </dl> 634 <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> 635 <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> 636 <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> 637 638 </div> 639 </div> 640 <a id="ga8ee4fed3e1a4dd0c910102430fca8c81"></a> 641 <h2 class="memtitle"><span class="permalink"><a href="#ga8ee4fed3e1a4dd0c910102430fca8c81">◆ </a></span>Tpm2ResetContext()</h2> 642 643 <div class="memitem"> 644 <div class="memproto"> 645 <table class="memname"> 646 <tr> 647 <td class="memname">void Tpm2ResetContext </td> 648 <td>(</td> 649 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> ** </td> 650 <td class="paramname"><em>ctx</em></td><td>)</td> 651 <td></td> 652 </tr> 653 </table> 654 </div><div class="memdoc"> 655 656 <p>Reset an existing Tpm context. </p> 657 <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> 658 <p>Re-initializes the context, reset memory used for primary key.</p> 659 <dl class="params"><dt>Parameters</dt><dd> 660 <table class="params"> 661 <tr><td class="paramdir">[in,out]</td><td class="paramname">ctx</td><td>The TPM context. Can be NULL.</td></tr> 662 </table> 663 </dd> 664 </dl> 665 <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> 666 667 </div> 668 </div> 669 <a id="ga11cc131debbca60c0de7e53d48330b69"></a> 670 <h2 class="memtitle"><span class="permalink"><a href="#ga11cc131debbca60c0de7e53d48330b69">◆ </a></span>Tpm2SetHashAlg()</h2> 671 672 <div class="memitem"> 673 <div class="memproto"> 674 <table class="memname"> 675 <tr> 676 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2SetHashAlg </td> 677 <td>(</td> 678 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 679 <td class="paramname"><em>ctx</em>, </td> 680 </tr> 681 <tr> 682 <td class="paramkey"></td> 683 <td></td> 684 <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> </td> 685 <td class="paramname"><em>hash_alg</em> </td> 686 </tr> 687 <tr> 688 <td></td> 689 <td>)</td> 690 <td></td><td></td> 691 </tr> 692 </table> 693 </div><div class="memdoc"> 694 695 <p>Sets the hash algorithm to be used by a TPM2. </p> 696 <dl class="params"><dt>Parameters</dt><dd> 697 <table class="params"> 698 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM2 context. </td></tr> 699 <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>The hash algorithm to use.</td></tr> 700 </table> 701 </dd> 702 </dl> 703 <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> 704 705 </div> 706 </div> 707 <a id="ga035c8ffba3182ba75a38131e23bb31c7"></a> 708 <h2 class="memtitle"><span class="permalink"><a href="#ga035c8ffba3182ba75a38131e23bb31c7">◆ </a></span>Tpm2Sign()</h2> 709 710 <div class="memitem"> 711 <div class="memproto"> 712 <table class="memname"> 713 <tr> 714 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> Tpm2Sign </td> 715 <td>(</td> 716 <td class="paramtype"><a class="el" href="struct_tpm2_ctx.html">Tpm2Ctx</a> * </td> 717 <td class="paramname"><em>ctx</em>, </td> 718 </tr> 719 <tr> 720 <td class="paramkey"></td> 721 <td></td> 722 <td class="paramtype">void const * </td> 723 <td class="paramname"><em>digest</em>, </td> 724 </tr> 725 <tr> 726 <td class="paramkey"></td> 727 <td></td> 728 <td class="paramtype">size_t </td> 729 <td class="paramname"><em>digest_len</em>, </td> 730 </tr> 731 <tr> 732 <td class="paramkey"></td> 733 <td></td> 734 <td class="paramtype">uint16_t </td> 735 <td class="paramname"><em>counter</em>, </td> 736 </tr> 737 <tr> 738 <td class="paramkey"></td> 739 <td></td> 740 <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> * </td> 741 <td class="paramname"><em>k</em>, </td> 742 </tr> 743 <tr> 744 <td class="paramkey"></td> 745 <td></td> 746 <td class="paramtype"><a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> * </td> 747 <td class="paramname"><em>s</em> </td> 748 </tr> 749 <tr> 750 <td></td> 751 <td>)</td> 752 <td></td><td></td> 753 </tr> 754 </table> 755 </div><div class="memdoc"> 756 757 <p>Performs TPM2_Sign TPM command. </p> 758 <p>Calculate a pair (k, s) an ECDAA signature.</p> 759 <p>Private key f must exist in the TPM context.</p> 760 <dl class="params"><dt>Parameters</dt><dd> 761 <table class="params"> 762 <tr><td class="paramdir">[in]</td><td class="paramname">ctx</td><td>The TPM context. </td></tr> 763 <tr><td class="paramdir">[in]</td><td class="paramname">digest</td><td>Digest to be signed. </td></tr> 764 <tr><td class="paramdir">[in]</td><td class="paramname">digest_len</td><td>The size of digest in bytes. </td></tr> 765 <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> 766 <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> 767 <tr><td class="paramdir">[out]</td><td class="paramname">s</td><td>The ECDAA signature s value.</td></tr> 768 </table> 769 </dd> 770 </dl> 771 <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> 772 <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> 773 <dd> 774 <a class="el" href="group___tpm2_module.html#ga750e38b6d6cea1b05f605e476df065d9" title="Performs TPM2_Commit TPM operation. ">Tpm2Commit</a> </dd></dl> 775 776 </div> 777 </div> 778 </div><!-- contents --> 779 </div><!-- doc-content --> 780 <!-- HTML footer for doxygen 1.8.10--> 781 <!-- start footer part --> 782 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 783 <ul> 784 <li class="footer"> 785 © 2016-2017 Intel Corporation 786 </li> 787 </ul> 788 </div> 789 </body> 790 </html> 791