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: epid/member/tpm2/ibm_tss/conversion.c File Reference</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('conversion_8c.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">conversion.c File Reference</div> </div> 66 </div><!--header--> 67 <div class="contents"> 68 69 <p>TPM-SDK data conversion implementation. 70 <a href="#details">More...</a></p> 71 <div class="textblock"><code>#include "<a class="el" href="conversion_8h.html">epid/member/tpm2/ibm_tss/conversion.h</a>"</code><br /> 72 <code>#include <string.h></code><br /> 73 <code>#include <tss2/TPM_Types.h></code><br /> 74 <code>#include "<a class="el" href="ecgroup_8h.html">epid/common/math/ecgroup.h</a>"</code><br /> 75 <code>#include "epid/common/src/memory.h"</code><br /> 76 <code>#include "<a class="el" href="types_8h.html">epid/common/types.h</a>"</code><br /> 77 </div><table class="memberdecls"> 78 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 79 Functions</h2></td></tr> 80 <tr class="memitem:ad08628a6bf33154c1029a32e8b83325f"><td class="memItemLeft" align="right" valign="top">TPMI_ALG_HASH </td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#ad08628a6bf33154c1029a32e8b83325f">EpidtoTpm2HashAlg</a> (<a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> hash_alg)</td></tr> 81 <tr class="memdesc:ad08628a6bf33154c1029a32e8b83325f"><td class="mdescLeft"> </td><td class="mdescRight">Maps HashAlg to TPM type. <a href="#ad08628a6bf33154c1029a32e8b83325f">More...</a><br /></td></tr> 82 <tr class="separator:ad08628a6bf33154c1029a32e8b83325f"><td class="memSeparator" colspan="2"> </td></tr> 83 <tr class="memitem:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8c.html#a51507a6be8d7dfa167c9e6fb70e5ee57">Tpm2toEpidHashAlg</a> (TPMI_ALG_HASH tpm_hash_alg)</td></tr> 84 <tr class="memdesc:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="mdescLeft"> </td><td class="mdescRight">Maps TPMI_ALG_HASH to HashAlg. <a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">More...</a><br /></td></tr> 85 <tr class="separator:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memSeparator" colspan="2"> </td></tr> 86 <tr class="memitem:a8243faa9ef46d90b936c7dace421e10e"><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="conversion_8c.html#a8243faa9ef46d90b936c7dace421e10e">ReadTpm2FfElement</a> (<a class="el" href="struct_oct_str256.html">OctStr256</a> const *str, TPM2B_ECC_PARAMETER *tpm_data)</td></tr> 87 <tr class="memdesc:a8243faa9ef46d90b936c7dace421e10e"><td class="mdescLeft"> </td><td class="mdescRight">Converts serialized FfElement into TPM type. <a href="#a8243faa9ef46d90b936c7dace421e10e">More...</a><br /></td></tr> 88 <tr class="separator:a8243faa9ef46d90b936c7dace421e10e"><td class="memSeparator" colspan="2"> </td></tr> 89 <tr class="memitem:a9f6a2b44857c038a2f90c12959640dea"><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="conversion_8c.html#a9f6a2b44857c038a2f90c12959640dea">WriteTpm2FfElement</a> (TPM2B_ECC_PARAMETER const *tpm_data, <a class="el" href="struct_oct_str256.html">OctStr256</a> *str)</td></tr> 90 <tr class="memdesc:a9f6a2b44857c038a2f90c12959640dea"><td class="mdescLeft"> </td><td class="mdescRight">Converts TPM finite field element types into serialized FfElement. <a href="#a9f6a2b44857c038a2f90c12959640dea">More...</a><br /></td></tr> 91 <tr class="separator:a9f6a2b44857c038a2f90c12959640dea"><td class="memSeparator" colspan="2"> </td></tr> 92 <tr class="memitem:acff82e14f6287ec2d4676a3f8cd38a57"><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="conversion_8c.html#acff82e14f6287ec2d4676a3f8cd38a57">ReadTpm2EcPoint</a> (<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *p_str, TPM2B_ECC_POINT *tpm_point)</td></tr> 93 <tr class="memdesc:acff82e14f6287ec2d4676a3f8cd38a57"><td class="mdescLeft"> </td><td class="mdescRight">Converts ECPoint string to TMP ECPoint structure. <a href="#acff82e14f6287ec2d4676a3f8cd38a57">More...</a><br /></td></tr> 94 <tr class="separator:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memSeparator" colspan="2"> </td></tr> 95 <tr class="memitem:a15e859e04c4b9c32a0970565846bdba3"><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="conversion_8c.html#a15e859e04c4b9c32a0970565846bdba3">WriteTpm2EcPoint</a> (TPM2B_ECC_POINT const *tpm_point, <a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *p_str)</td></tr> 96 <tr class="memdesc:a15e859e04c4b9c32a0970565846bdba3"><td class="mdescLeft"> </td><td class="mdescRight">Serializes TMP ECPoint to ECPoint string. <a href="#a15e859e04c4b9c32a0970565846bdba3">More...</a><br /></td></tr> 97 <tr class="separator:a15e859e04c4b9c32a0970565846bdba3"><td class="memSeparator" colspan="2"> </td></tr> 98 </table> 99 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 100 <div class="textblock"><p>TPM-SDK data conversion implementation. </p> 101 </div><h2 class="groupheader">Function Documentation</h2> 102 <a id="ad08628a6bf33154c1029a32e8b83325f"></a> 103 <h2 class="memtitle"><span class="permalink"><a href="#ad08628a6bf33154c1029a32e8b83325f">◆ </a></span>EpidtoTpm2HashAlg()</h2> 104 105 <div class="memitem"> 106 <div class="memproto"> 107 <table class="memname"> 108 <tr> 109 <td class="memname">TPMI_ALG_HASH EpidtoTpm2HashAlg </td> 110 <td>(</td> 111 <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> </td> 112 <td class="paramname"><em>hash_alg</em></td><td>)</td> 113 <td></td> 114 </tr> 115 </table> 116 </div><div class="memdoc"> 117 118 <p>Maps HashAlg to TPM type. </p> 119 <p>Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.</p> 120 <dl class="params"><dt>Parameters</dt><dd> 121 <table class="params"> 122 <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>Code of the hash algorithm </td></tr> 123 </table> 124 </dd> 125 </dl> 126 <dl class="section return"><dt>Returns</dt><dd>TPMI_ALG_HASH </dd></dl> 127 128 </div> 129 </div> 130 <a id="acff82e14f6287ec2d4676a3f8cd38a57"></a> 131 <h2 class="memtitle"><span class="permalink"><a href="#acff82e14f6287ec2d4676a3f8cd38a57">◆ </a></span>ReadTpm2EcPoint()</h2> 132 133 <div class="memitem"> 134 <div class="memproto"> 135 <table class="memname"> 136 <tr> 137 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2EcPoint </td> 138 <td>(</td> 139 <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const * </td> 140 <td class="paramname"><em>p_str</em>, </td> 141 </tr> 142 <tr> 143 <td class="paramkey"></td> 144 <td></td> 145 <td class="paramtype">TPM2B_ECC_POINT * </td> 146 <td class="paramname"><em>tpm_point</em> </td> 147 </tr> 148 <tr> 149 <td></td> 150 <td>)</td> 151 <td></td><td></td> 152 </tr> 153 </table> 154 </div><div class="memdoc"> 155 156 <p>Converts ECPoint string to TMP ECPoint structure. </p> 157 <dl class="params"><dt>Parameters</dt><dd> 158 <table class="params"> 159 <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The serialized EcPoint to convert. </td></tr> 160 <tr><td class="paramdir">[out]</td><td class="paramname">tpm_point</td><td>The TPM EC point representation.</td></tr> 161 </table> 162 </dd> 163 </dl> 164 <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> 165 166 </div> 167 </div> 168 <a id="a8243faa9ef46d90b936c7dace421e10e"></a> 169 <h2 class="memtitle"><span class="permalink"><a href="#a8243faa9ef46d90b936c7dace421e10e">◆ </a></span>ReadTpm2FfElement()</h2> 170 171 <div class="memitem"> 172 <div class="memproto"> 173 <table class="memname"> 174 <tr> 175 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadTpm2FfElement </td> 176 <td>(</td> 177 <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> const * </td> 178 <td class="paramname"><em>str</em>, </td> 179 </tr> 180 <tr> 181 <td class="paramkey"></td> 182 <td></td> 183 <td class="paramtype">TPM2B_ECC_PARAMETER * </td> 184 <td class="paramname"><em>tpm_data</em> </td> 185 </tr> 186 <tr> 187 <td></td> 188 <td>)</td> 189 <td></td><td></td> 190 </tr> 191 </table> 192 </div><div class="memdoc"> 193 194 <p>Converts serialized FfElement into TPM type. </p> 195 <dl class="params"><dt>Parameters</dt><dd> 196 <table class="params"> 197 <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Serialized Intel(R) EPID SDK FfElement </td></tr> 198 <tr><td class="paramdir">[out]</td><td class="paramname">tpm_data</td><td>tpm type data. </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 204 </div> 205 </div> 206 <a id="a51507a6be8d7dfa167c9e6fb70e5ee57"></a> 207 <h2 class="memtitle"><span class="permalink"><a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">◆ </a></span>Tpm2toEpidHashAlg()</h2> 208 209 <div class="memitem"> 210 <div class="memproto"> 211 <table class="memname"> 212 <tr> 213 <td class="memname"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> Tpm2toEpidHashAlg </td> 214 <td>(</td> 215 <td class="paramtype">TPMI_ALG_HASH </td> 216 <td class="paramname"><em>tpm_hash_alg</em></td><td>)</td> 217 <td></td> 218 </tr> 219 </table> 220 </div><div class="memdoc"> 221 222 <p>Maps TPMI_ALG_HASH to HashAlg. </p> 223 <p>Maps TPM hash code TPMI_ALG_HASH into HashAlg.</p> 224 <dl class="params"><dt>Parameters</dt><dd> 225 <table class="params"> 226 <tr><td class="paramdir">[in]</td><td class="paramname">tpm_hash_alg</td><td>Code of the hash algorithm in TPM</td></tr> 227 </table> 228 </dd> 229 </dl> 230 <dl class="section return"><dt>Returns</dt><dd>HashAlg </dd></dl> 231 232 </div> 233 </div> 234 <a id="a15e859e04c4b9c32a0970565846bdba3"></a> 235 <h2 class="memtitle"><span class="permalink"><a href="#a15e859e04c4b9c32a0970565846bdba3">◆ </a></span>WriteTpm2EcPoint()</h2> 236 237 <div class="memitem"> 238 <div class="memproto"> 239 <table class="memname"> 240 <tr> 241 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2EcPoint </td> 242 <td>(</td> 243 <td class="paramtype">TPM2B_ECC_POINT const * </td> 244 <td class="paramname"><em>tpm_point</em>, </td> 245 </tr> 246 <tr> 247 <td class="paramkey"></td> 248 <td></td> 249 <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> * </td> 250 <td class="paramname"><em>p_str</em> </td> 251 </tr> 252 <tr> 253 <td></td> 254 <td>)</td> 255 <td></td><td></td> 256 </tr> 257 </table> 258 </div><div class="memdoc"> 259 260 <p>Serializes TMP ECPoint to ECPoint string. </p> 261 <dl class="params"><dt>Parameters</dt><dd> 262 <table class="params"> 263 <tr><td class="paramdir">[in]</td><td class="paramname">tpm_point</td><td>The TPM EC point to convert. </td></tr> 264 <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The target string.</td></tr> 265 </table> 266 </dd> 267 </dl> 268 <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> 269 270 </div> 271 </div> 272 <a id="a9f6a2b44857c038a2f90c12959640dea"></a> 273 <h2 class="memtitle"><span class="permalink"><a href="#a9f6a2b44857c038a2f90c12959640dea">◆ </a></span>WriteTpm2FfElement()</h2> 274 275 <div class="memitem"> 276 <div class="memproto"> 277 <table class="memname"> 278 <tr> 279 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteTpm2FfElement </td> 280 <td>(</td> 281 <td class="paramtype">TPM2B_ECC_PARAMETER const * </td> 282 <td class="paramname"><em>tpm_data</em>, </td> 283 </tr> 284 <tr> 285 <td class="paramkey"></td> 286 <td></td> 287 <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> * </td> 288 <td class="paramname"><em>str</em> </td> 289 </tr> 290 <tr> 291 <td></td> 292 <td>)</td> 293 <td></td><td></td> 294 </tr> 295 </table> 296 </div><div class="memdoc"> 297 298 <p>Converts TPM finite field element types into serialized FfElement. </p> 299 <dl class="params"><dt>Parameters</dt><dd> 300 <table class="params"> 301 <tr><td class="paramdir">[in]</td><td class="paramname">tpm_data</td><td>The TPM finite field data, typically TPM2B_DIGEST or TPM2B_ECC_PARAMETER. </td></tr> 302 <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>The target buffer.</td></tr> 303 </table> 304 </dd> 305 </dl> 306 <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> 307 308 </div> 309 </div> 310 </div><!-- contents --> 311 </div><!-- doc-content --> 312 <!-- HTML footer for doxygen 1.8.10--> 313 <!-- start footer part --> 314 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 315 <ul> 316 <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_512d3e62841a8535b716ec4cf8b9e950.html">member</a></li><li class="navelem"><a class="el" href="dir_0d59f1b8006345e373e07b4691e0da76.html">tpm2</a></li><li class="navelem"><a class="el" href="dir_b7525369f2fbc378c6814b573b9a2bc3.html">ibm_tss</a></li><li class="navelem"><a class="el" href="conversion_8c.html">conversion.c</a></li> 317 <li class="footer"> 318 © 2016-2017 Intel Corporation 319 </li> 320 </ul> 321 </div> 322 </body> 323 </html> 324