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