printutils_8c.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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.11"/>
  8. <title>Intel&reg; Enhanced Privacy ID SDK: epid/common/math/printutils.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. $(document).ready(initResizable);
  18. $(window).load(resizeHeight);
  19. </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&reg; Enhanced Privacy ID SDK</a>
  35. &#160;<span id="projectnumber">2.0.0</span>
  36. </div>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. <!-- end header part -->
  43. <!-- Generated by Doxygen 1.8.11 -->
  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. $(document).ready(function(){initNavTree('printutils_8c.html','');});
  57. </script>
  58. <div id="doc-content">
  59. <div class="header">
  60. <div class="summary">
  61. <a href="#define-members">Macros</a> &#124;
  62. <a href="#func-members">Functions</a> </div>
  63. <div class="headertitle">
  64. <div class="title">printutils.c File Reference</div> </div>
  65. </div><!--header-->
  66. <div class="contents">
  67. <p>Print helper implementation.
  68. <a href="#details">More...</a></p>
  69. <div class="textblock"><code>#include &quot;<a class="el" href="printutils_8h.html">epid/common/math/printutils.h</a>&quot;</code><br />
  70. <code>#include &lt;stdio.h&gt;</code><br />
  71. <code>#include &lt;string.h&gt;</code><br />
  72. <code>#include &quot;ext/ipp/include/ippcp.h&quot;</code><br />
  73. <code>#include &quot;epid/common/math/bignum-internal.h&quot;</code><br />
  74. <code>#include &quot;epid/common/math/ecgroup-internal.h&quot;</code><br />
  75. <code>#include &quot;epid/common/math/finitefield-internal.h&quot;</code><br />
  76. <code>#include &quot;<a class="el" href="memory_8h.html">epid/common/memory.h</a>&quot;</code><br />
  77. </div><table class="memberdecls">
  78. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
  79. Macros</h2></td></tr>
  80. <tr class="memitem:a241aeeb764887ae5e3de58b98f04b16d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a241aeeb764887ae5e3de58b98f04b16d"></a>
  81. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#a241aeeb764887ae5e3de58b98f04b16d">WIDTH</a>&#160;&#160;&#160;49</td></tr>
  82. <tr class="memdesc:a241aeeb764887ae5e3de58b98f04b16d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allowed number of characters printed in one line. <br /></td></tr>
  83. <tr class="separator:a241aeeb764887ae5e3de58b98f04b16d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  84. <tr class="memitem:a502b06aa5ad25116c775d201326bad52"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a502b06aa5ad25116c775d201326bad52"></a>
  85. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#a502b06aa5ad25116c775d201326bad52">INDENT</a>&#160;&#160;&#160;2</td></tr>
  86. <tr class="memdesc:a502b06aa5ad25116c775d201326bad52"><td class="mdescLeft">&#160;</td><td class="mdescRight">Amount of identation added in the beginning of each line. <br /></td></tr>
  87. <tr class="separator:a502b06aa5ad25116c775d201326bad52"><td class="memSeparator" colspan="2">&#160;</td></tr>
  88. <tr class="memitem:aa9b6652aabab4e1adadd19b5366d1f69"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa9b6652aabab4e1adadd19b5366d1f69"></a>
  89. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#aa9b6652aabab4e1adadd19b5366d1f69">BYTE_LENGTH</a>&#160;&#160;&#160;2</td></tr>
  90. <tr class="memdesc:aa9b6652aabab4e1adadd19b5366d1f69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Number of charaters used to represent one byte. For example, "ab" or "05". <br /></td></tr>
  91. <tr class="separator:aa9b6652aabab4e1adadd19b5366d1f69"><td class="memSeparator" colspan="2">&#160;</td></tr>
  92. <tr class="memitem:af68c3a5ad6ffce6c97fff154856a823d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af68c3a5ad6ffce6c97fff154856a823d"></a>
  93. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#af68c3a5ad6ffce6c97fff154856a823d">SEPARATOR</a>&#160;&#160;&#160;(&quot; &quot;)</td></tr>
  94. <tr class="memdesc:af68c3a5ad6ffce6c97fff154856a823d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Separator. <br /></td></tr>
  95. <tr class="separator:af68c3a5ad6ffce6c97fff154856a823d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:a91e2eeae06fcf21c3fa4fc0eadf6b0cd"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#a91e2eeae06fcf21c3fa4fc0eadf6b0cd">MAKE_INDENT</a>() </td></tr>
  97. <tr class="memdesc:a91e2eeae06fcf21c3fa4fc0eadf6b0cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Make configured number of identation. <a href="#a91e2eeae06fcf21c3fa4fc0eadf6b0cd">More...</a><br /></td></tr>
  98. <tr class="separator:a91e2eeae06fcf21c3fa4fc0eadf6b0cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a15bb631053a1fce9c5470701900984c7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a15bb631053a1fce9c5470701900984c7"></a>
  100. #define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="printutils_8c.html#a15bb631053a1fce9c5470701900984c7">PRINT</a>(...)&#160;&#160;&#160;fprintf(stdout, __VA_ARGS__)</td></tr>
  101. <tr class="memdesc:a15bb631053a1fce9c5470701900984c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Print to specified stream. <br /></td></tr>
  102. <tr class="separator:a15bb631053a1fce9c5470701900984c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. </table><table class="memberdecls">
  104. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  105. Functions</h2></td></tr>
  106. <tr class="memitem:ga45a933b44fc1dfe926e3af89c198070a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a">PrintBigNum</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *big_num, char const *var_name)</td></tr>
  107. <tr class="memdesc:ga45a933b44fc1dfe926e3af89c198070a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints BigNum. <a href="group___epid_print.html#ga45a933b44fc1dfe926e3af89c198070a">More...</a><br /></td></tr>
  108. <tr class="separator:ga45a933b44fc1dfe926e3af89c198070a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  109. <tr class="memitem:gaa3b1cbbfc6f78562658953113e5798cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf">PrintFfElement</a> (<a class="el" href="group___finite_field_primitives.html#gab281b24e336a8b3d7d90079d862d969e">FiniteField</a> const *ff, <a class="el" href="group___finite_field_primitives.html#ga6cff5c7c06b07a87442b810ccc0a86fa">FfElement</a> const *ff_element, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  110. <tr class="memdesc:gaa3b1cbbfc6f78562658953113e5798cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints finite field element. <a href="group___epid_print.html#gaa3b1cbbfc6f78562658953113e5798cf">More...</a><br /></td></tr>
  111. <tr class="separator:gaa3b1cbbfc6f78562658953113e5798cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  112. <tr class="memitem:ga0d6377d9c1651d0101ec6b61feaa78ca"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca">PrintEcPoint</a> (<a class="el" href="group___ec_group_primitives.html#gac91c5a7623c17a868dd15b2e9aaf7159">EcGroup</a> const *g, <a class="el" href="group___ec_group_primitives.html#ga85c1d5e106031b385a6e23e598ac98fa">EcPoint</a> const *ec_point, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  113. <tr class="memdesc:ga0d6377d9c1651d0101ec6b61feaa78ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints elliptic curve group element. <a href="group___epid_print.html#ga0d6377d9c1651d0101ec6b61feaa78ca">More...</a><br /></td></tr>
  114. <tr class="separator:ga0d6377d9c1651d0101ec6b61feaa78ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
  115. <tr class="memitem:ga5f249c594ed12e4a9b11b7bc101da85d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d">PrintBigNumStr</a> (<a class="el" href="struct_big_num_str.html">BigNumStr</a> const *big_num_str, char const *var_name)</td></tr>
  116. <tr class="memdesc:ga5f249c594ed12e4a9b11b7bc101da85d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized BigNum. <a href="group___epid_print.html#ga5f249c594ed12e4a9b11b7bc101da85d">More...</a><br /></td></tr>
  117. <tr class="separator:ga5f249c594ed12e4a9b11b7bc101da85d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  118. <tr class="memitem:gae553c3a156a0e4968b89635ab0757580"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#gae553c3a156a0e4968b89635ab0757580">PrintFpElemStr</a> (<a class="el" href="struct_fp_elem_str.html">FpElemStr</a> const *fp_elem_str, char const *var_name)</td></tr>
  119. <tr class="memdesc:gae553c3a156a0e4968b89635ab0757580"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Fp element. <a href="group___epid_print.html#gae553c3a156a0e4968b89635ab0757580">More...</a><br /></td></tr>
  120. <tr class="separator:gae553c3a156a0e4968b89635ab0757580"><td class="memSeparator" colspan="2">&#160;</td></tr>
  121. <tr class="memitem:ga6c9fea48fa0477f4a98abb50f891a5e4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4">PrintFqElemStr</a> (<a class="el" href="struct_fq_elem_str.html">FqElemStr</a> const *fq_elem_str, char const *var_name)</td></tr>
  122. <tr class="memdesc:ga6c9fea48fa0477f4a98abb50f891a5e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Fq element. <a href="group___epid_print.html#ga6c9fea48fa0477f4a98abb50f891a5e4">More...</a><br /></td></tr>
  123. <tr class="separator:ga6c9fea48fa0477f4a98abb50f891a5e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  124. <tr class="memitem:ga883a834ab1703365bb0bca4abd3104de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de">PrintFq2ElemStr</a> (<a class="el" href="struct_fq2_elem_str.html">Fq2ElemStr</a> const *fq2_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  125. <tr class="memdesc:ga883a834ab1703365bb0bca4abd3104de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Fq2 element. <a href="group___epid_print.html#ga883a834ab1703365bb0bca4abd3104de">More...</a><br /></td></tr>
  126. <tr class="separator:ga883a834ab1703365bb0bca4abd3104de"><td class="memSeparator" colspan="2">&#160;</td></tr>
  127. <tr class="memitem:ga3f2961ef6b4c44a6205d422d8a293476"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476">PrintFq6ElemStr</a> (<a class="el" href="struct_fq6_elem_str.html">Fq6ElemStr</a> const *fq6_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  128. <tr class="memdesc:ga3f2961ef6b4c44a6205d422d8a293476"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Fq6 element. <a href="group___epid_print.html#ga3f2961ef6b4c44a6205d422d8a293476">More...</a><br /></td></tr>
  129. <tr class="separator:ga3f2961ef6b4c44a6205d422d8a293476"><td class="memSeparator" colspan="2">&#160;</td></tr>
  130. <tr class="memitem:gaf185fe3df270cd8b4a2969bf3cfc5d5f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f">PrintFq12ElemStr</a> (<a class="el" href="struct_fq12_elem_str.html">Fq12ElemStr</a> const *fq12_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  131. <tr class="memdesc:gaf185fe3df270cd8b4a2969bf3cfc5d5f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Fq12 element. <a href="group___epid_print.html#gaf185fe3df270cd8b4a2969bf3cfc5d5f">More...</a><br /></td></tr>
  132. <tr class="separator:gaf185fe3df270cd8b4a2969bf3cfc5d5f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  133. <tr class="memitem:ga87168a3ce5306f9839b8e8d6c9a5f84f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f">PrintG1ElemStr</a> (<a class="el" href="struct_g1_elem_str.html">G1ElemStr</a> const *g1_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  134. <tr class="memdesc:ga87168a3ce5306f9839b8e8d6c9a5f84f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized G1 element. <a href="group___epid_print.html#ga87168a3ce5306f9839b8e8d6c9a5f84f">More...</a><br /></td></tr>
  135. <tr class="separator:ga87168a3ce5306f9839b8e8d6c9a5f84f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  136. <tr class="memitem:gab76a4cf0385dc4a76bb56ee9f0e3e87a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a">PrintG2ElemStr</a> (<a class="el" href="struct_g2_elem_str.html">G2ElemStr</a> const *g2_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  137. <tr class="memdesc:gab76a4cf0385dc4a76bb56ee9f0e3e87a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized G2 element. <a href="group___epid_print.html#gab76a4cf0385dc4a76bb56ee9f0e3e87a">More...</a><br /></td></tr>
  138. <tr class="separator:gab76a4cf0385dc4a76bb56ee9f0e3e87a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  139. <tr class="memitem:ga138cd388247a58680d4701d59d6976d2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___epid_print.html#ga138cd388247a58680d4701d59d6976d2">PrintGtElemStr</a> (<a class="el" href="struct_gt_elem_str.html">GtElemStr</a> const *gt_elem_str, char const *var_name, <a class="el" href="group___epid_print.html#ga3e215d157eb205ad596bb84bce694a83">PrintUtilFormat</a> format)</td></tr>
  140. <tr class="memdesc:ga138cd388247a58680d4701d59d6976d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Prints serialized Gt element. <a href="group___epid_print.html#ga138cd388247a58680d4701d59d6976d2">More...</a><br /></td></tr>
  141. <tr class="separator:ga138cd388247a58680d4701d59d6976d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
  142. </table>
  143. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  144. <div class="textblock"><p>Print helper implementation. </p>
  145. </div><h2 class="groupheader">Macro Definition Documentation</h2>
  146. <a class="anchor" id="a91e2eeae06fcf21c3fa4fc0eadf6b0cd"></a>
  147. <div class="memitem">
  148. <div class="memproto">
  149. <table class="memname">
  150. <tr>
  151. <td class="memname">#define MAKE_INDENT</td>
  152. <td>(</td>
  153. <td class="paramname"></td><td>)</td>
  154. <td></td>
  155. </tr>
  156. </table>
  157. </div><div class="memdoc">
  158. <b>Value:</b><div class="fragment"><div class="line">{ \</div><div class="line"> uint8_t ind = 0; \</div><div class="line"> for (ind = 0; ind &lt; <a class="code" href="printutils_8c.html#a502b06aa5ad25116c775d201326bad52">INDENT</a>; ind++) { \</div><div class="line"> PRINT(<span class="stringliteral">&quot; &quot;</span>); \</div><div class="line"> } \</div><div class="line"> }</div><div class="ttc" id="printutils_8c_html_a502b06aa5ad25116c775d201326bad52"><div class="ttname"><a href="printutils_8c.html#a502b06aa5ad25116c775d201326bad52">INDENT</a></div><div class="ttdeci">#define INDENT</div><div class="ttdoc">Amount of identation added in the beginning of each line. </div><div class="ttdef"><b>Definition:</b> printutils.c:40</div></div>
  159. </div><!-- fragment -->
  160. <p>Make configured number of identation. </p>
  161. </div>
  162. </div>
  163. </div><!-- contents -->
  164. </div><!-- doc-content -->
  165. <!-- HTML footer for doxygen 1.8.10-->
  166. <!-- start footer part -->
  167. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  168. <ul>
  169. <li class="navelem"><a class="el" href="dir_12b90d9c027aaf878a834df729679a56.html">epid</a></li><li class="navelem"><a class="el" href="dir_f6bef457d5f671b6e774bfccc16651f6.html">common</a></li><li class="navelem"><a class="el" href="dir_f169ebf8da29290a918fa4b3f7151050.html">math</a></li><li class="navelem"><a class="el" href="printutils_8c.html">printutils.c</a></li>
  170. <li class="footer">
  171. &copy; 2016 Intel Corporation
  172. </li>
  173. </ul>
  174. </div>
  175. </body>
  176. </html>