Html程序  |  341行  |  19.35 KB

<!-- 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&reg; Enhanced Privacy ID SDK: epid/member/tpm2/ibm_tss/conversion.h File Reference</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&amp;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&reg; Enhanced Privacy ID SDK</a>
&#160;<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&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('conversion_8h.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">conversion.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>TPM-SDK data conversion interface.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;tss2/TPM_Types.h&gt;</code><br />
<code>#include &quot;<a class="el" href="errors_8h.html">epid/common/errors.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="types_8h.html">epid/common/types.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ae9c66465b8109d648704268fee8cf66b"><td class="memItemLeft" align="right" valign="top"><a id="ae9c66465b8109d648704268fee8cf66b"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#ae9c66465b8109d648704268fee8cf66b">TPM_ALG_SHA256</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000B)</td></tr>
<tr class="memdesc:ae9c66465b8109d648704268fee8cf66b"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 256 algorithm. <br /></td></tr>
<tr class="separator:ae9c66465b8109d648704268fee8cf66b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85ee45736d112c61495faad4fea3dbbc"><td class="memItemLeft" align="right" valign="top"><a id="a85ee45736d112c61495faad4fea3dbbc"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a85ee45736d112c61495faad4fea3dbbc">TPM_ALG_SHA384</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000C)</td></tr>
<tr class="memdesc:a85ee45736d112c61495faad4fea3dbbc"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 384 algorithm. <br /></td></tr>
<tr class="separator:a85ee45736d112c61495faad4fea3dbbc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="memItemLeft" align="right" valign="top"><a id="a8aecd28504c6511c02da2e78ecaaf5bd"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a8aecd28504c6511c02da2e78ecaaf5bd">TPM_ALG_SHA512</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x000D)</td></tr>
<tr class="memdesc:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of SHA 512 algorithm. <br /></td></tr>
<tr class="separator:a8aecd28504c6511c02da2e78ecaaf5bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3622ddd0080bf63059d26887b6ee90ac"><td class="memItemLeft" align="right" valign="top"><a id="a3622ddd0080bf63059d26887b6ee90ac"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a3622ddd0080bf63059d26887b6ee90ac">TPM_ALG_NULL</a>&#160;&#160;&#160;(TPM_ALG_ID)(0x0010)</td></tr>
<tr class="memdesc:a3622ddd0080bf63059d26887b6ee90ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">TPM code of Null algorithm. <br /></td></tr>
<tr class="separator:a3622ddd0080bf63059d26887b6ee90ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad08628a6bf33154c1029a32e8b83325f"><td class="memItemLeft" align="right" valign="top">TPMI_ALG_HASH&#160;</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>
<tr class="memdesc:ad08628a6bf33154c1029a32e8b83325f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps HashAlg to TPM type.  <a href="#ad08628a6bf33154c1029a32e8b83325f">More...</a><br /></td></tr>
<tr class="separator:ad08628a6bf33154c1029a32e8b83325f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="conversion_8h.html#a51507a6be8d7dfa167c9e6fb70e5ee57">Tpm2toEpidHashAlg</a> (TPMI_ALG_HASH tpm_hash_alg)</td></tr>
<tr class="memdesc:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Maps TPMI_ALG_HASH to HashAlg.  <a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">More...</a><br /></td></tr>
<tr class="separator:a51507a6be8d7dfa167c9e6fb70e5ee57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8243faa9ef46d90b936c7dace421e10e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</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>
<tr class="memdesc:a8243faa9ef46d90b936c7dace421e10e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts serialized FfElement into TPM type.  <a href="#a8243faa9ef46d90b936c7dace421e10e">More...</a><br /></td></tr>
<tr class="separator:a8243faa9ef46d90b936c7dace421e10e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f6a2b44857c038a2f90c12959640dea"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</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>
<tr class="memdesc:a9f6a2b44857c038a2f90c12959640dea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts TPM finite field element types into serialized FfElement.  <a href="#a9f6a2b44857c038a2f90c12959640dea">More...</a><br /></td></tr>
<tr class="separator:a9f6a2b44857c038a2f90c12959640dea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</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>
<tr class="memdesc:acff82e14f6287ec2d4676a3f8cd38a57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Converts ECPoint string to TMP ECPoint structure.  <a href="#acff82e14f6287ec2d4676a3f8cd38a57">More...</a><br /></td></tr>
<tr class="separator:acff82e14f6287ec2d4676a3f8cd38a57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15e859e04c4b9c32a0970565846bdba3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a>&#160;</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>
<tr class="memdesc:a15e859e04c4b9c32a0970565846bdba3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serializes TMP ECPoint to ECPoint string.  <a href="#a15e859e04c4b9c32a0970565846bdba3">More...</a><br /></td></tr>
<tr class="separator:a15e859e04c4b9c32a0970565846bdba3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>TPM-SDK data conversion interface. </p>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="ad08628a6bf33154c1029a32e8b83325f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad08628a6bf33154c1029a32e8b83325f">&#9670;&nbsp;</a></span>EpidtoTpm2HashAlg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TPMI_ALG_HASH EpidtoTpm2HashAlg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a>&#160;</td>
          <td class="paramname"><em>hash_alg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Maps HashAlg to TPM type. </p>
<p>Maps Intel(R) EPID SDK HashAlg into TPMI_ALG_HASH.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">hash_alg</td><td>Code of the hash algorithm </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>TPMI_ALG_HASH </dd></dl>

</div>
</div>
<a id="acff82e14f6287ec2d4676a3f8cd38a57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acff82e14f6287ec2d4676a3f8cd38a57">&#9670;&nbsp;</a></span>ReadTpm2EcPoint()</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> ReadTpm2EcPoint </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *&#160;</td>
          <td class="paramname"><em>p_str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TPM2B_ECC_POINT *&#160;</td>
          <td class="paramname"><em>tpm_point</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts ECPoint string to TMP ECPoint structure. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The serialized EcPoint to convert. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tpm_point</td><td>The TPM EC point representation.</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="a8243faa9ef46d90b936c7dace421e10e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8243faa9ef46d90b936c7dace421e10e">&#9670;&nbsp;</a></span>ReadTpm2FfElement()</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> ReadTpm2FfElement </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> const *&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">TPM2B_ECC_PARAMETER *&#160;</td>
          <td class="paramname"><em>tpm_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts serialized FfElement into TPM type. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">str</td><td>Serialized Intel(R) EPID SDK FfElement </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">tpm_data</td><td>tpm type data. </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="a51507a6be8d7dfa167c9e6fb70e5ee57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51507a6be8d7dfa167c9e6fb70e5ee57">&#9670;&nbsp;</a></span>Tpm2toEpidHashAlg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___epid_types.html#ga5e450438f6f9a5eacd0cf5ce354ec890">HashAlg</a> Tpm2toEpidHashAlg </td>
          <td>(</td>
          <td class="paramtype">TPMI_ALG_HASH&#160;</td>
          <td class="paramname"><em>tpm_hash_alg</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Maps TPMI_ALG_HASH to HashAlg. </p>
<p>Maps TPM hash code TPMI_ALG_HASH into HashAlg.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tpm_hash_alg</td><td>Code of the hash algorithm in TPM</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>HashAlg </dd></dl>

</div>
</div>
<a id="a15e859e04c4b9c32a0970565846bdba3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a15e859e04c4b9c32a0970565846bdba3">&#9670;&nbsp;</a></span>WriteTpm2EcPoint()</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> WriteTpm2EcPoint </td>
          <td>(</td>
          <td class="paramtype">TPM2B_ECC_POINT const *&#160;</td>
          <td class="paramname"><em>tpm_point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> *&#160;</td>
          <td class="paramname"><em>p_str</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Serializes TMP ECPoint to ECPoint string. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">tpm_point</td><td>The TPM EC point to convert. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p_str</td><td>The target string.</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="a9f6a2b44857c038a2f90c12959640dea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f6a2b44857c038a2f90c12959640dea">&#9670;&nbsp;</a></span>WriteTpm2FfElement()</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> WriteTpm2FfElement </td>
          <td>(</td>
          <td class="paramtype">TPM2B_ECC_PARAMETER const *&#160;</td>
          <td class="paramname"><em>tpm_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_oct_str256.html">OctStr256</a> *&#160;</td>
          <td class="paramname"><em>str</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Converts TPM finite field element types into serialized FfElement. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <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>
    <tr><td class="paramdir">[out]</td><td class="paramname">str</td><td>The target buffer.</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>
</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="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>
    <li class="footer">
      &copy; 2016-2017 Intel Corporation
    </li>
  </ul>
</div>
</body>
</html>