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: bignum</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___big_num_primitives.html','');}); 58/* @license-end */ 59</script> 60<div id="doc-content"> 61<div class="header"> 62 <div class="summary"> 63<a href="#typedef-members">Typedefs</a> | 64<a href="#func-members">Functions</a> </div> 65 <div class="headertitle"> 66<div class="title">bignum<div class="ingroups"><a class="el" href="group___epid_module.html">epid&nbsp;</a> » <a class="el" href="group___epid_common.html">common</a> » <a class="el" href="group___epid_math.html">math</a></div></div> </div> 67</div><!--header--> 68<div class="contents"> 69 70<p>Big number operations. 71<a href="#details">More...</a></p> 72<table class="memberdecls"> 73<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> 74Typedefs</h2></td></tr> 75<tr class="memitem:ga2bf153e27be2683f0fb26f0f7ff1f718"><td class="memItemLeft" align="right" valign="top"><a id="ga2bf153e27be2683f0fb26f0f7ff1f718"></a> 76typedef struct <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a></td></tr> 77<tr class="memdesc:ga2bf153e27be2683f0fb26f0f7ff1f718"><td class="mdescLeft"> </td><td class="mdescRight">Internal representation of large numbers. <br /></td></tr> 78<tr class="separator:ga2bf153e27be2683f0fb26f0f7ff1f718"><td class="memSeparator" colspan="2"> </td></tr> 79</table><table class="memberdecls"> 80<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 81Functions</h2></td></tr> 82<tr class="memitem:gad5f6f262bfd780fed3678bcee16f0aed"><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___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed">NewBigNum</a> (size_t data_size_bytes, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> **bignum)</td></tr> 83<tr class="memdesc:gad5f6f262bfd780fed3678bcee16f0aed"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a new BigNum. <a href="#gad5f6f262bfd780fed3678bcee16f0aed">More...</a><br /></td></tr> 84<tr class="separator:gad5f6f262bfd780fed3678bcee16f0aed"><td class="memSeparator" colspan="2"> </td></tr> 85<tr class="memitem:ga2d17600068b1d94000635c6644258a03"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03">DeleteBigNum</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> **bignum)</td></tr> 86<tr class="memdesc:ga2d17600068b1d94000635c6644258a03"><td class="mdescLeft"> </td><td class="mdescRight">Deletes a previously allocated BigNum. <a href="#ga2d17600068b1d94000635c6644258a03">More...</a><br /></td></tr> 87<tr class="separator:ga2d17600068b1d94000635c6644258a03"><td class="memSeparator" colspan="2"> </td></tr> 88<tr class="memitem:gabe8e39d5788423f41770a71a4c911fbe"><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___big_num_primitives.html#gabe8e39d5788423f41770a71a4c911fbe">ReadBigNum</a> (<a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> bn_str, size_t strlen, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *bn)</td></tr> 89<tr class="memdesc:gabe8e39d5788423f41770a71a4c911fbe"><td class="mdescLeft"> </td><td class="mdescRight">Deserializes a BigNum from a string. <a href="#gabe8e39d5788423f41770a71a4c911fbe">More...</a><br /></td></tr> 90<tr class="separator:gabe8e39d5788423f41770a71a4c911fbe"><td class="memSeparator" colspan="2"> </td></tr> 91<tr class="memitem:ga904c16cc020e7196f22ac9abdc31b41f"><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___big_num_primitives.html#ga904c16cc020e7196f22ac9abdc31b41f">WriteBigNum</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *bn, size_t strlen, <a class="el" href="group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0">OctStr</a> bn_str)</td></tr> 92<tr class="memdesc:ga904c16cc020e7196f22ac9abdc31b41f"><td class="mdescLeft"> </td><td class="mdescRight">Serializes a BigNum to a string. <a href="#ga904c16cc020e7196f22ac9abdc31b41f">More...</a><br /></td></tr> 93<tr class="separator:ga904c16cc020e7196f22ac9abdc31b41f"><td class="memSeparator" colspan="2"> </td></tr> 94<tr class="memitem:gae70fd9b3026f0ab3c7e9601d0a3186b8"><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___big_num_primitives.html#gae70fd9b3026f0ab3c7e9601d0a3186b8">BigNumAdd</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *b, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 95<tr class="memdesc:gae70fd9b3026f0ab3c7e9601d0a3186b8"><td class="mdescLeft"> </td><td class="mdescRight">Adds two BigNum values. <a href="#gae70fd9b3026f0ab3c7e9601d0a3186b8">More...</a><br /></td></tr> 96<tr class="separator:gae70fd9b3026f0ab3c7e9601d0a3186b8"><td class="memSeparator" colspan="2"> </td></tr> 97<tr class="memitem:gacbec9669ab0fe768e2be74dcaca397ea"><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___big_num_primitives.html#gacbec9669ab0fe768e2be74dcaca397ea">BigNumSub</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *b, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 98<tr class="memdesc:gacbec9669ab0fe768e2be74dcaca397ea"><td class="mdescLeft"> </td><td class="mdescRight">Subtracts two BigNum values. <a href="#gacbec9669ab0fe768e2be74dcaca397ea">More...</a><br /></td></tr> 99<tr class="separator:gacbec9669ab0fe768e2be74dcaca397ea"><td class="memSeparator" colspan="2"> </td></tr> 100<tr class="memitem:ga03c89b8b8dd87de2c0f4b5822145d317"><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___big_num_primitives.html#ga03c89b8b8dd87de2c0f4b5822145d317">BigNumMul</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *b, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 101<tr class="memdesc:ga03c89b8b8dd87de2c0f4b5822145d317"><td class="mdescLeft"> </td><td class="mdescRight">Multiplies two BigNum values. <a href="#ga03c89b8b8dd87de2c0f4b5822145d317">More...</a><br /></td></tr> 102<tr class="separator:ga03c89b8b8dd87de2c0f4b5822145d317"><td class="memSeparator" colspan="2"> </td></tr> 103<tr class="memitem:ga166134085464b0df2c8efcfccf8ec573"><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___big_num_primitives.html#ga166134085464b0df2c8efcfccf8ec573">BigNumDiv</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *b, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *q, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 104<tr class="memdesc:ga166134085464b0df2c8efcfccf8ec573"><td class="mdescLeft"> </td><td class="mdescRight">Divides two BigNum values. <a href="#ga166134085464b0df2c8efcfccf8ec573">More...</a><br /></td></tr> 105<tr class="separator:ga166134085464b0df2c8efcfccf8ec573"><td class="memSeparator" colspan="2"> </td></tr> 106<tr class="memitem:ga7dd6038987210d10bf843602fef0c929"><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___big_num_primitives.html#ga7dd6038987210d10bf843602fef0c929">BigNumMod</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *b, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 107<tr class="memdesc:ga7dd6038987210d10bf843602fef0c929"><td class="mdescLeft"> </td><td class="mdescRight">Computes modular reduction for BigNum value by specified modulus. <a href="#ga7dd6038987210d10bf843602fef0c929">More...</a><br /></td></tr> 108<tr class="separator:ga7dd6038987210d10bf843602fef0c929"><td class="memSeparator" colspan="2"> </td></tr> 109<tr class="memitem:gaf0366e47226563b17fcbc8e3ed766084"><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___big_num_primitives.html#gaf0366e47226563b17fcbc8e3ed766084">BigNumIsEven</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> *is_even)</td></tr> 110<tr class="memdesc:gaf0366e47226563b17fcbc8e3ed766084"><td class="mdescLeft"> </td><td class="mdescRight">Checks if a BigNum is even. <a href="#gaf0366e47226563b17fcbc8e3ed766084">More...</a><br /></td></tr> 111<tr class="separator:gaf0366e47226563b17fcbc8e3ed766084"><td class="memSeparator" colspan="2"> </td></tr> 112<tr class="memitem:gacde6564a814617a96985b379be0dfabb"><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___big_num_primitives.html#gacde6564a814617a96985b379be0dfabb">BigNumIsZero</a> (<a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const *a, <a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> *is_zero)</td></tr> 113<tr class="memdesc:gacde6564a814617a96985b379be0dfabb"><td class="mdescLeft"> </td><td class="mdescRight">Checks if a BigNum is zero. <a href="#gacde6564a814617a96985b379be0dfabb">More...</a><br /></td></tr> 114<tr class="separator:gacde6564a814617a96985b379be0dfabb"><td class="memSeparator" colspan="2"> </td></tr> 115<tr class="memitem:gafd64b66fc85dab0005f4a1bb67bdf7b4"><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___big_num_primitives.html#gafd64b66fc85dab0005f4a1bb67bdf7b4">BigNumPow2N</a> (unsigned int n, <a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> *r)</td></tr> 116<tr class="memdesc:gafd64b66fc85dab0005f4a1bb67bdf7b4"><td class="mdescLeft"> </td><td class="mdescRight">Raises 2 to the given power. <a href="#gafd64b66fc85dab0005f4a1bb67bdf7b4">More...</a><br /></td></tr> 117<tr class="separator:gafd64b66fc85dab0005f4a1bb67bdf7b4"><td class="memSeparator" colspan="2"> </td></tr> 118</table> 119<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 120<p>Big number operations. </p> 121<p>This module provides an API for working with large numbers. BigNums represent non-negative integers.</p> 122<p>Each BigNum variable represents a number of a byte-size set when the variable was created. BigNum variables cannot be re-sized after they are created. </p> 123<h2 class="groupheader">Function Documentation</h2> 124<a id="gae70fd9b3026f0ab3c7e9601d0a3186b8"></a> 125<h2 class="memtitle"><span class="permalink"><a href="#gae70fd9b3026f0ab3c7e9601d0a3186b8">◆ </a></span>BigNumAdd()</h2> 126 127<div class="memitem"> 128<div class="memproto"> 129 <table class="memname"> 130 <tr> 131 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumAdd </td> 132 <td>(</td> 133 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 134 <td class="paramname"><em>a</em>, </td> 135 </tr> 136 <tr> 137 <td class="paramkey"></td> 138 <td></td> 139 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 140 <td class="paramname"><em>b</em>, </td> 141 </tr> 142 <tr> 143 <td class="paramkey"></td> 144 <td></td> 145 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 146 <td class="paramname"><em>r</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>Adds two BigNum values. </p> 157<dl class="params"><dt>Parameters</dt><dd> 158 <table class="params"> 159 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The first operand to be added. </td></tr> 160 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>The second operand to be added. </td></tr> 161 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The result of adding a and b.</td></tr> 162 </table> 163 </dd> 164</dl> 165<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> 166 167</div> 168</div> 169<a id="ga166134085464b0df2c8efcfccf8ec573"></a> 170<h2 class="memtitle"><span class="permalink"><a href="#ga166134085464b0df2c8efcfccf8ec573">◆ </a></span>BigNumDiv()</h2> 171 172<div class="memitem"> 173<div class="memproto"> 174 <table class="memname"> 175 <tr> 176 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumDiv </td> 177 <td>(</td> 178 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 179 <td class="paramname"><em>a</em>, </td> 180 </tr> 181 <tr> 182 <td class="paramkey"></td> 183 <td></td> 184 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 185 <td class="paramname"><em>b</em>, </td> 186 </tr> 187 <tr> 188 <td class="paramkey"></td> 189 <td></td> 190 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 191 <td class="paramname"><em>q</em>, </td> 192 </tr> 193 <tr> 194 <td class="paramkey"></td> 195 <td></td> 196 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 197 <td class="paramname"><em>r</em> </td> 198 </tr> 199 <tr> 200 <td></td> 201 <td>)</td> 202 <td></td><td></td> 203 </tr> 204 </table> 205</div><div class="memdoc"> 206 207<p>Divides two BigNum values. </p> 208<dl class="section note"><dt>Note</dt><dd>Only needed for Intel(R) EPID 1.1 verification.</dd></dl> 209<dl class="params"><dt>Parameters</dt><dd> 210 <table class="params"> 211 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>Dividend parameter. </td></tr> 212 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>Divisor parameter. </td></tr> 213 <tr><td class="paramdir">[out]</td><td class="paramname">q</td><td>Quotient of result. </td></tr> 214 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>Remainder of result.</td></tr> 215 </table> 216 </dd> 217</dl> 218<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> 219 220</div> 221</div> 222<a id="gaf0366e47226563b17fcbc8e3ed766084"></a> 223<h2 class="memtitle"><span class="permalink"><a href="#gaf0366e47226563b17fcbc8e3ed766084">◆ </a></span>BigNumIsEven()</h2> 224 225<div class="memitem"> 226<div class="memproto"> 227 <table class="memname"> 228 <tr> 229 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumIsEven </td> 230 <td>(</td> 231 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 232 <td class="paramname"><em>a</em>, </td> 233 </tr> 234 <tr> 235 <td class="paramkey"></td> 236 <td></td> 237 <td class="paramtype"><a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> * </td> 238 <td class="paramname"><em>is_even</em> </td> 239 </tr> 240 <tr> 241 <td></td> 242 <td>)</td> 243 <td></td><td></td> 244 </tr> 245 </table> 246</div><div class="memdoc"> 247 248<p>Checks if a BigNum is even. </p> 249<dl class="params"><dt>Parameters</dt><dd> 250 <table class="params"> 251 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The BigNum to check. </td></tr> 252 <tr><td class="paramdir">[out]</td><td class="paramname">is_even</td><td>The result of the check.</td></tr> 253 </table> 254 </dd> 255</dl> 256<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> 257 258</div> 259</div> 260<a id="gacde6564a814617a96985b379be0dfabb"></a> 261<h2 class="memtitle"><span class="permalink"><a href="#gacde6564a814617a96985b379be0dfabb">◆ </a></span>BigNumIsZero()</h2> 262 263<div class="memitem"> 264<div class="memproto"> 265 <table class="memname"> 266 <tr> 267 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumIsZero </td> 268 <td>(</td> 269 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 270 <td class="paramname"><em>a</em>, </td> 271 </tr> 272 <tr> 273 <td class="paramkey"></td> 274 <td></td> 275 <td class="paramtype"><a class="el" href="stdtypes_8h.html#ad5c9d4ba3dc37783a528b0925dc981a0">bool</a> * </td> 276 <td class="paramname"><em>is_zero</em> </td> 277 </tr> 278 <tr> 279 <td></td> 280 <td>)</td> 281 <td></td><td></td> 282 </tr> 283 </table> 284</div><div class="memdoc"> 285 286<p>Checks if a BigNum is zero. </p> 287<dl class="params"><dt>Parameters</dt><dd> 288 <table class="params"> 289 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The BigNum to check. </td></tr> 290 <tr><td class="paramdir">[out]</td><td class="paramname">is_zero</td><td>The result of the check.</td></tr> 291 </table> 292 </dd> 293</dl> 294<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> 295 296</div> 297</div> 298<a id="ga7dd6038987210d10bf843602fef0c929"></a> 299<h2 class="memtitle"><span class="permalink"><a href="#ga7dd6038987210d10bf843602fef0c929">◆ </a></span>BigNumMod()</h2> 300 301<div class="memitem"> 302<div class="memproto"> 303 <table class="memname"> 304 <tr> 305 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumMod </td> 306 <td>(</td> 307 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 308 <td class="paramname"><em>a</em>, </td> 309 </tr> 310 <tr> 311 <td class="paramkey"></td> 312 <td></td> 313 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 314 <td class="paramname"><em>b</em>, </td> 315 </tr> 316 <tr> 317 <td class="paramkey"></td> 318 <td></td> 319 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 320 <td class="paramname"><em>r</em> </td> 321 </tr> 322 <tr> 323 <td></td> 324 <td>)</td> 325 <td></td><td></td> 326 </tr> 327 </table> 328</div><div class="memdoc"> 329 330<p>Computes modular reduction for BigNum value by specified modulus. </p> 331<dl class="params"><dt>Parameters</dt><dd> 332 <table class="params"> 333 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The BigNum value. </td></tr> 334 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>The modulus. </td></tr> 335 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>Modular reduction result.</td></tr> 336 </table> 337 </dd> 338</dl> 339<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> 340 341</div> 342</div> 343<a id="ga03c89b8b8dd87de2c0f4b5822145d317"></a> 344<h2 class="memtitle"><span class="permalink"><a href="#ga03c89b8b8dd87de2c0f4b5822145d317">◆ </a></span>BigNumMul()</h2> 345 346<div class="memitem"> 347<div class="memproto"> 348 <table class="memname"> 349 <tr> 350 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumMul </td> 351 <td>(</td> 352 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 353 <td class="paramname"><em>a</em>, </td> 354 </tr> 355 <tr> 356 <td class="paramkey"></td> 357 <td></td> 358 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 359 <td class="paramname"><em>b</em>, </td> 360 </tr> 361 <tr> 362 <td class="paramkey"></td> 363 <td></td> 364 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 365 <td class="paramname"><em>r</em> </td> 366 </tr> 367 <tr> 368 <td></td> 369 <td>)</td> 370 <td></td><td></td> 371 </tr> 372 </table> 373</div><div class="memdoc"> 374 375<p>Multiplies two BigNum values. </p> 376<dl class="params"><dt>Parameters</dt><dd> 377 <table class="params"> 378 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The first operand to be multiplied. </td></tr> 379 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>The second operand to be multiplied. </td></tr> 380 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The result of multiplying a and b.</td></tr> 381 </table> 382 </dd> 383</dl> 384<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> 385 386</div> 387</div> 388<a id="gafd64b66fc85dab0005f4a1bb67bdf7b4"></a> 389<h2 class="memtitle"><span class="permalink"><a href="#gafd64b66fc85dab0005f4a1bb67bdf7b4">◆ </a></span>BigNumPow2N()</h2> 390 391<div class="memitem"> 392<div class="memproto"> 393 <table class="memname"> 394 <tr> 395 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumPow2N </td> 396 <td>(</td> 397 <td class="paramtype">unsigned int </td> 398 <td class="paramname"><em>n</em>, </td> 399 </tr> 400 <tr> 401 <td class="paramkey"></td> 402 <td></td> 403 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 404 <td class="paramname"><em>r</em> </td> 405 </tr> 406 <tr> 407 <td></td> 408 <td>)</td> 409 <td></td><td></td> 410 </tr> 411 </table> 412</div><div class="memdoc"> 413 414<p>Raises 2 to the given power. </p> 415<dl class="params"><dt>Parameters</dt><dd> 416 <table class="params"> 417 <tr><td class="paramdir">[in]</td><td class="paramname">n</td><td>The power. </td></tr> 418 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The result of 2^n.</td></tr> 419 </table> 420 </dd> 421</dl> 422<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> 423 424</div> 425</div> 426<a id="gacbec9669ab0fe768e2be74dcaca397ea"></a> 427<h2 class="memtitle"><span class="permalink"><a href="#gacbec9669ab0fe768e2be74dcaca397ea">◆ </a></span>BigNumSub()</h2> 428 429<div class="memitem"> 430<div class="memproto"> 431 <table class="memname"> 432 <tr> 433 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> BigNumSub </td> 434 <td>(</td> 435 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 436 <td class="paramname"><em>a</em>, </td> 437 </tr> 438 <tr> 439 <td class="paramkey"></td> 440 <td></td> 441 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 442 <td class="paramname"><em>b</em>, </td> 443 </tr> 444 <tr> 445 <td class="paramkey"></td> 446 <td></td> 447 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 448 <td class="paramname"><em>r</em> </td> 449 </tr> 450 <tr> 451 <td></td> 452 <td>)</td> 453 <td></td><td></td> 454 </tr> 455 </table> 456</div><div class="memdoc"> 457 458<p>Subtracts two BigNum values. </p> 459<dl class="params"><dt>Parameters</dt><dd> 460 <table class="params"> 461 <tr><td class="paramdir">[in]</td><td class="paramname">a</td><td>The first operand to use in subtraction. </td></tr> 462 <tr><td class="paramdir">[in]</td><td class="paramname">b</td><td>The second operand to use in subtraction. </td></tr> 463 <tr><td class="paramdir">[out]</td><td class="paramname">r</td><td>The result of subtracting a and b.</td></tr> 464 </table> 465 </dd> 466</dl> 467<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> 468 469</div> 470</div> 471<a id="ga2d17600068b1d94000635c6644258a03"></a> 472<h2 class="memtitle"><span class="permalink"><a href="#ga2d17600068b1d94000635c6644258a03">◆ </a></span>DeleteBigNum()</h2> 473 474<div class="memitem"> 475<div class="memproto"> 476 <table class="memname"> 477 <tr> 478 <td class="memname">void DeleteBigNum </td> 479 <td>(</td> 480 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> ** </td> 481 <td class="paramname"><em>bignum</em></td><td>)</td> 482 <td></td> 483 </tr> 484 </table> 485</div><div class="memdoc"> 486 487<p>Deletes a previously allocated BigNum. </p> 488<p>Frees memory pointed to by bignum. Nulls the pointer.</p> 489<dl class="params"><dt>Parameters</dt><dd> 490 <table class="params"> 491 <tr><td class="paramdir">[in]</td><td class="paramname">bignum</td><td>The BigNum. Can be NULL.</td></tr> 492 </table> 493 </dd> 494</dl> 495<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___big_num_primitives.html#gad5f6f262bfd780fed3678bcee16f0aed" title="Constructs a new BigNum. ">NewBigNum</a> </dd></dl> 496 497</div> 498</div> 499<a id="gad5f6f262bfd780fed3678bcee16f0aed"></a> 500<h2 class="memtitle"><span class="permalink"><a href="#gad5f6f262bfd780fed3678bcee16f0aed">◆ </a></span>NewBigNum()</h2> 501 502<div class="memitem"> 503<div class="memproto"> 504 <table class="memname"> 505 <tr> 506 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> NewBigNum </td> 507 <td>(</td> 508 <td class="paramtype">size_t </td> 509 <td class="paramname"><em>data_size_bytes</em>, </td> 510 </tr> 511 <tr> 512 <td class="paramkey"></td> 513 <td></td> 514 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> ** </td> 515 <td class="paramname"><em>bignum</em> </td> 516 </tr> 517 <tr> 518 <td></td> 519 <td>)</td> 520 <td></td><td></td> 521 </tr> 522 </table> 523</div><div class="memdoc"> 524 525<p>Constructs a new BigNum. </p> 526<p>Allocates memory and creates a new BigNum.</p> 527<p>Use <a class="el" href="group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03" title="Deletes a previously allocated BigNum. ">DeleteBigNum()</a> to free memory.</p> 528<dl class="params"><dt>Parameters</dt><dd> 529 <table class="params"> 530 <tr><td class="paramdir">[in]</td><td class="paramname">data_size_bytes</td><td>The size in bytes of the new number. </td></tr> 531 <tr><td class="paramdir">[out]</td><td class="paramname">bignum</td><td>The BigNum.</td></tr> 532 </table> 533 </dd> 534</dl> 535<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> 536<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___big_num_primitives.html#ga2d17600068b1d94000635c6644258a03" title="Deletes a previously allocated BigNum. ">DeleteBigNum</a> </dd></dl> 537 538</div> 539</div> 540<a id="gabe8e39d5788423f41770a71a4c911fbe"></a> 541<h2 class="memtitle"><span class="permalink"><a href="#gabe8e39d5788423f41770a71a4c911fbe">◆ </a></span>ReadBigNum()</h2> 542 543<div class="memitem"> 544<div class="memproto"> 545 <table class="memname"> 546 <tr> 547 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> ReadBigNum </td> 548 <td>(</td> 549 <td class="paramtype"><a class="el" href="group___epid_types.html#gace6876a045f2c2694444b35ccb0844e2">ConstOctStr</a> </td> 550 <td class="paramname"><em>bn_str</em>, </td> 551 </tr> 552 <tr> 553 <td class="paramkey"></td> 554 <td></td> 555 <td class="paramtype">size_t </td> 556 <td class="paramname"><em>strlen</em>, </td> 557 </tr> 558 <tr> 559 <td class="paramkey"></td> 560 <td></td> 561 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> * </td> 562 <td class="paramname"><em>bn</em> </td> 563 </tr> 564 <tr> 565 <td></td> 566 <td>)</td> 567 <td></td><td></td> 568 </tr> 569 </table> 570</div><div class="memdoc"> 571 572<p>Deserializes a BigNum from a string. </p> 573<dl class="params"><dt>Parameters</dt><dd> 574 <table class="params"> 575 <tr><td class="paramdir">[in]</td><td class="paramname">bn_str</td><td>The serialized value. </td></tr> 576 <tr><td class="paramdir">[in]</td><td class="paramname">strlen</td><td>The size of bn_str in bytes. </td></tr> 577 <tr><td class="paramdir">[out]</td><td class="paramname">bn</td><td>The target BigNum.</td></tr> 578 </table> 579 </dd> 580</dl> 581<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> 582 583</div> 584</div> 585<a id="ga904c16cc020e7196f22ac9abdc31b41f"></a> 586<h2 class="memtitle"><span class="permalink"><a href="#ga904c16cc020e7196f22ac9abdc31b41f">◆ </a></span>WriteBigNum()</h2> 587 588<div class="memitem"> 589<div class="memproto"> 590 <table class="memname"> 591 <tr> 592 <td class="memname"><a class="el" href="group___error_codes.html#gafdb27c77c2c4b32c807e326a8a0da360">EpidStatus</a> WriteBigNum </td> 593 <td>(</td> 594 <td class="paramtype"><a class="el" href="group___big_num_primitives.html#ga2bf153e27be2683f0fb26f0f7ff1f718">BigNum</a> const * </td> 595 <td class="paramname"><em>bn</em>, </td> 596 </tr> 597 <tr> 598 <td class="paramkey"></td> 599 <td></td> 600 <td class="paramtype">size_t </td> 601 <td class="paramname"><em>strlen</em>, </td> 602 </tr> 603 <tr> 604 <td class="paramkey"></td> 605 <td></td> 606 <td class="paramtype"><a class="el" href="group___epid_types.html#ga3315fb24f4c5783b6d6eb107933390b0">OctStr</a> </td> 607 <td class="paramname"><em>bn_str</em> </td> 608 </tr> 609 <tr> 610 <td></td> 611 <td>)</td> 612 <td></td><td></td> 613 </tr> 614 </table> 615</div><div class="memdoc"> 616 617<p>Serializes a BigNum to a string. </p> 618<dl class="params"><dt>Parameters</dt><dd> 619 <table class="params"> 620 <tr><td class="paramdir">[in]</td><td class="paramname">bn</td><td>The BigNum to be serialized. </td></tr> 621 <tr><td class="paramdir">[in]</td><td class="paramname">strlen</td><td>The size of bn_str in bytes. </td></tr> 622 <tr><td class="paramdir">[out]</td><td class="paramname">bn_str</td><td>The target string.</td></tr> 623 </table> 624 </dd> 625</dl> 626<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> 627 628</div> 629</div> 630</div><!-- contents --> 631</div><!-- doc-content --> 632<!-- HTML footer for doxygen 1.8.10--> 633<!-- start footer part --> 634<div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> 635 <ul> 636 <li class="footer"> 637 © 2016-2017 Intel Corporation 638 </li> 639 </ul> 640</div> 641</body> 642</html> 643