NASFAQ/CRS_CC/doc/html/binary__trees_8h.html
2022-02-15 15:01:37 +01:00

412 lines
21 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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=11"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CRS: /home/steaky/git/CRS/src/Polynomials/binary_trees.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="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.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="projectlogo"><img alt="Logo" src="475805_1_En_14_Fig2_HTML.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">CRS
</div>
<div id="projectbrief">Isogeny-based post-quantum Diffie-Hellman protocol.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_9d9d47b06e607e5b7bab055102566395.html">Polynomials</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle"><div class="title">binary_trees.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;gmp.h&gt;</code><br />
<code>#include &lt;flint/fmpz.h&gt;</code><br />
<code>#include &lt;flint/fq.h&gt;</code><br />
<code>#include &lt;flint/fq_poly.h&gt;</code><br />
</div>
<p><a href="binary__trees_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ae75a586c98a189f3687913f1f20ef194"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#ae75a586c98a189f3687913f1f20ef194">fq_poly_bcell_t</a></td></tr>
<tr class="separator:ae75a586c98a189f3687913f1f20ef194"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa6dffffb56a9116df27894c7390170f3"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#aa6dffffb56a9116df27894c7390170f3">fq_poly_btree_t</a></td></tr>
<tr class="separator:aa6dffffb56a9116df27894c7390170f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a4e5d1867ea409ed1e34a4a299ee34141"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a4e5d1867ea409ed1e34a4a299ee34141">fq_poly_bcell_init</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, const fq_ctx_t *)</td></tr>
<tr class="separator:a4e5d1867ea409ed1e34a4a299ee34141"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae247e88d41cbb2f660c2fbf7b48de15c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#ae247e88d41cbb2f660c2fbf7b48de15c">fq_poly_bcell_set</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, fq_poly_t)</td></tr>
<tr class="separator:ae247e88d41cbb2f660c2fbf7b48de15c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0b7281007d79b0511910f7ed8f86c986"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a0b7281007d79b0511910f7ed8f86c986">fq_poly_bcell_set_</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, fq_poly_t)</td></tr>
<tr class="separator:a0b7281007d79b0511910f7ed8f86c986"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac73d4bb393bcd261e7309d8d5e83a696"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#ac73d4bb393bcd261e7309d8d5e83a696">fq_poly_bcell_set_right</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *)</td></tr>
<tr class="separator:ac73d4bb393bcd261e7309d8d5e83a696"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32ce1cdd3712aea854e541d01ee6ac36"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a32ce1cdd3712aea854e541d01ee6ac36">fq_poly_bcell_set_left</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *, <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *)</td></tr>
<tr class="separator:a32ce1cdd3712aea854e541d01ee6ac36"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f77a311cca885ec1cf98b495ee8e87f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a1f77a311cca885ec1cf98b495ee8e87f">fq_poly_bcell_clear</a> (<a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *)</td></tr>
<tr class="separator:a1f77a311cca885ec1cf98b495ee8e87f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e794b69bd0cf14ddc000daed4c29dd8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a3e794b69bd0cf14ddc000daed4c29dd8">fq_poly_btree_init</a> (<a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *, const fq_ctx_t *)</td></tr>
<tr class="separator:a3e794b69bd0cf14ddc000daed4c29dd8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a8917c8e2a16d64afe8c487f6eb365c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a9a8917c8e2a16d64afe8c487f6eb365c">fq_poly_btree_set</a> (<a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *, <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *)</td></tr>
<tr class="separator:a9a8917c8e2a16d64afe8c487f6eb365c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f2af1f102f06a345f4701f4f1a598a5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="binary__trees_8h.html#a2f2af1f102f06a345f4701f4f1a598a5">fq_poly_btree_clear</a> (<a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *)</td></tr>
<tr class="separator:a2f2af1f102f06a345f4701f4f1a598a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ae75a586c98a189f3687913f1f20ef194" name="ae75a586c98a189f3687913f1f20ef194"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae75a586c98a189f3687913f1f20ef194">&#9670;&nbsp;</a></span>fq_poly_bcell_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p >Representation of binary links with fq_poly as nodes. </p>
</div>
</div>
<a id="aa6dffffb56a9116df27894c7390170f3" name="aa6dffffb56a9116df27894c7390170f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa6dffffb56a9116df27894c7390170f3">&#9670;&nbsp;</a></span>fq_poly_btree_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> <a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p >Representation of binary tree with <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> nodes. </p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a1f77a311cca885ec1cf98b495ee8e87f" name="a1f77a311cca885ec1cf98b495ee8e87f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1f77a311cca885ec1cf98b495ee8e87f">&#9670;&nbsp;</a></span>fq_poly_bcell_clear()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_bcell_clear </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Recursively clears the given bcell, releasing any memory used. It must be reinitialised in order to be used again. </p>
</div>
</div>
<a id="a4e5d1867ea409ed1e34a4a299ee34141" name="a4e5d1867ea409ed1e34a4a299ee34141"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4e5d1867ea409ed1e34a4a299ee34141">&#9670;&nbsp;</a></span>fq_poly_bcell_init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_bcell_init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const fq_ctx_t *&#160;</td>
<td class="paramname"><em>F</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Initializes b for use, with context F, and setting its childs to NULL. A corresponding call to <a class="el" href="binary__trees_8c.html#a429a740be5fa4442e79ff1194bc744cd">fq_poly_bcell_clear()</a> must be made after finishing with the <a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> to free the memory used by the cell. </p>
</div>
</div>
<a id="ae247e88d41cbb2f660c2fbf7b48de15c" name="ae247e88d41cbb2f660c2fbf7b48de15c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae247e88d41cbb2f660c2fbf7b48de15c">&#9670;&nbsp;</a></span>fq_poly_bcell_set()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_bcell_set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">fq_poly_t&#160;</td>
<td class="paramname"><em>p</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Sets b to bcell with data p. </p>
</div>
</div>
<a id="a0b7281007d79b0511910f7ed8f86c986" name="a0b7281007d79b0511910f7ed8f86c986"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0b7281007d79b0511910f7ed8f86c986">&#9670;&nbsp;</a></span>fq_poly_bcell_set_()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_bcell_set_ </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>right</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">fq_poly_t&#160;</td>
<td class="paramname"><em>p</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Sets b to bcell with data p and childs left/right. </p>
</div>
</div>
<a id="a32ce1cdd3712aea854e541d01ee6ac36" name="a32ce1cdd3712aea854e541d01ee6ac36"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a32ce1cdd3712aea854e541d01ee6ac36">&#9670;&nbsp;</a></span>fq_poly_bcell_set_left()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int fq_poly_bcell_set_left </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Sets left child of b1 to b2. Returns -1 if b1 already has a left child. </p>
</div>
</div>
<a id="ac73d4bb393bcd261e7309d8d5e83a696" name="ac73d4bb393bcd261e7309d8d5e83a696"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac73d4bb393bcd261e7309d8d5e83a696">&#9670;&nbsp;</a></span>fq_poly_bcell_set_right()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int fq_poly_bcell_set_right </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Sets right child of b1 to b2. Returns -1 if b1 already has a right child. </p>
</div>
</div>
<a id="a2f2af1f102f06a345f4701f4f1a598a5" name="a2f2af1f102f06a345f4701f4f1a598a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f2af1f102f06a345f4701f4f1a598a5">&#9670;&nbsp;</a></span>fq_poly_btree_clear()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_btree_clear </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *&#160;</td>
<td class="paramname"><em>t</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Recursively clears the given tree and its bcells, releasing any memory used. It must be reinitialised in order to be used again. </p>
</div>
</div>
<a id="a3e794b69bd0cf14ddc000daed4c29dd8" name="a3e794b69bd0cf14ddc000daed4c29dd8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e794b69bd0cf14ddc000daed4c29dd8">&#9670;&nbsp;</a></span>fq_poly_btree_init()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_btree_init </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *&#160;</td>
<td class="paramname"><em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const fq_ctx_t *&#160;</td>
<td class="paramname"><em>F</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Initializes t for use, with context F. A corresponding call to <a class="el" href="binary__trees_8c.html#ad4f461907c7a5161bd9198456fe678a6">fq_poly_btree_clear()</a> must be made after finishing with the <a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> to free the memory used by the tree. </p>
</div>
</div>
<a id="a9a8917c8e2a16d64afe8c487f6eb365c" name="a9a8917c8e2a16d64afe8c487f6eb365c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9a8917c8e2a16d64afe8c487f6eb365c">&#9670;&nbsp;</a></span>fq_poly_btree_set()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void fq_poly_btree_set </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structfq__poly__btree__t.html">fq_poly_btree_t</a> *&#160;</td>
<td class="paramname"><em>t</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structfq__poly__bcell__t.html">fq_poly_bcell_t</a> *&#160;</td>
<td class="paramname"><em>b</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p >Sets t to tree with head bcell b. TODO: check ctx </p>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.2
</small></address>
</body>
</html>