blob: 4d65d4187c45d70781bd2decd69002961d6a0a76 [file] [log] [blame]
<!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=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AMCL: amcl.h Source File</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="projectalign" style="padding-left: 0.5em;">
<div id="projectname">AMCL
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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_df7310d1a865926cc859bcfb1880083f.html">include</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">amcl.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> distributed with this work for additional information</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment"> to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment"> &quot;License&quot;); you may not use this file except in compliance</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment"> Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<span class="comment"> software distributed under the License is distributed on an</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment"> &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> specific language governing permissions and limitations</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> under the License.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#ifndef AMCL_H</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#define AMCL_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;stdbool.h&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;inttypes.h&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="arch_8h.html">arch.h</a>&quot;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#ifdef CMAKE</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#define AMCL_VERSION_MAJOR 0 </span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#define AMCL_VERSION_MINOR 1 </span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#define AMCL_VERSION_PATCH 0 </span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#define OS &quot;Windows&quot; </span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="comment">/* modulus types */</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#define NOT_SPECIAL 0 </span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#define PSEUDO_MERSENNE 1 </span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#define MONTGOMERY_FRIENDLY 3 </span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor">#define GENERALISED_MERSENNE 2 </span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor"></span><span class="comment">/* Curve types */</span><span class="preprocessor"></span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="preprocessor">#define WEIERSTRASS 0 </span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="preprocessor">#define EDWARDS 1 </span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="preprocessor">#define MONTGOMERY 2 </span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="preprocessor"></span><span class="comment">/* Pairing-Friendly types */</span><span class="preprocessor"></span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;<span class="preprocessor">#define NOT 0</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="preprocessor">#define BN 1</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="preprocessor">#define BLS 2</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="preprocessor">#define D_TYPE 0</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="preprocessor">#define M_TYPE 1</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="preprocessor">#define AMCL_FP_ZERO 0</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="preprocessor">#define AMCL_FP_UNITY 1</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="preprocessor">#define AMCL_FP_SPARSER 2</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="preprocessor">#define AMCL_FP_SPARSE 3</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160;<span class="preprocessor">#define AMCL_FP_DENSE 4</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structhash256.html"> 69</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;{</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structhash256.html#aed90ef35ddc8f515e666596360090338"> 71</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> length[2]; </div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structhash256.html#a7a5eb377b3767a3adc72cdd837776008"> 72</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> h[8]; </div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structhash256.html#a2b99f192248cb4808b4803bdf5480b37"> 73</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> w[80]; </div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structhash256.html#ab4db96c3d30dce3db80bfbc92ca0aecf"> 74</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structhash256.html#ab4db96c3d30dce3db80bfbc92ca0aecf">hlen</a>; </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160;} <a class="code" href="structhash256.html">hash256</a>;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structhash512.html"> 79</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;{</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structhash512.html#a71f1b748d99be6cd676fc5a7b3f291c9"> 81</a></span>&#160; <a class="code" href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a> length[2]; </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structhash512.html#aad724a08b633ae81394287a4c7348141"> 82</a></span>&#160; <a class="code" href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a> h[8]; </div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structhash512.html#a8a75674186c356439504762c753c9f14"> 83</a></span>&#160; <a class="code" href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a> w[80]; </div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structhash512.html#a56689ae69347d42cf0fa4a424e789832"> 84</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structhash512.html#a56689ae69347d42cf0fa4a424e789832">hlen</a>; </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;} <a class="code" href="structhash512.html">hash512</a>;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="keyword">typedef</span> <a class="code" href="structhash512.html">hash512</a> <a class="code" href="structhash512.html">hash384</a>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="structsha3.html"> 93</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;{</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="structsha3.html#a73902f518f7a5d7db0f40b71b2d52f09"> 95</a></span>&#160; <a class="code" href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a> <a class="code" href="structsha3.html#a73902f518f7a5d7db0f40b71b2d52f09">length</a>; </div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="structsha3.html#aa755ca9fd19e01f6181c7833188cb48e"> 96</a></span>&#160; <a class="code" href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a> S[5][5]; </div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="structsha3.html#a495b3f25ef3e600507845be265f87dee"> 97</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structsha3.html#a495b3f25ef3e600507845be265f87dee">rate</a>; </div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="structsha3.html#a826b7a50820b159656a017354dbfc3d7"> 98</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structsha3.html#a826b7a50820b159656a017354dbfc3d7">len</a>; </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160;} <a class="code" href="structsha3.html">sha3</a>;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="preprocessor">#define SHA256 32 </span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160;<span class="preprocessor">#define SHA384 48 </span></div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor">#define SHA512 64 </span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160;<span class="preprocessor">#define SHA3_HASH224 28 </span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="preprocessor">#define SHA3_HASH256 32 </span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;<span class="preprocessor">#define SHA3_HASH384 48 </span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="preprocessor">#define SHA3_HASH512 64 </span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="preprocessor">#define SHAKE128 16 </span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="preprocessor">#define SHAKE256 32 </span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="preprocessor"></span><span class="comment">/* NewHope parameters */</span><span class="preprocessor"></span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment">//q= 12289</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="preprocessor">#define RLWE_PRIME 0x3001 // q in Hex</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="preprocessor">#define RLWE_LGN 10 // Degree n=2^LGN</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="preprocessor">#define RLWE_ND 0xF7002FFF // 1/(R-q) mod R</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="preprocessor">#define RLWE_ONE 0x2AC8 // R mod q</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="preprocessor">#define RLWE_R2MODP 0x1620 // R^2 mod q</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="comment">/* Symmetric Encryption AES structure */</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="preprocessor">#define ECB 0 </span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="preprocessor">#define CBC 1 </span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;<span class="preprocessor">#define CFB1 2 </span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160;<span class="preprocessor">#define CFB2 3 </span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;<span class="preprocessor">#define CFB4 5 </span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160;<span class="preprocessor">#define OFB1 14 </span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160;<span class="preprocessor">#define OFB2 15 </span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;<span class="preprocessor">#define OFB4 17 </span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160;<span class="preprocessor">#define OFB8 21 </span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;<span class="preprocessor">#define OFB16 29 </span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160;<span class="preprocessor">#define CTR1 30 </span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="preprocessor">#define CTR2 31 </span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160;<span class="preprocessor">#define CTR4 33 </span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;<span class="preprocessor">#define CTR8 37 </span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160;<span class="preprocessor">#define CTR16 45 </span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160;<span class="preprocessor">#define uchar unsigned char </span></div><div class="line"><a name="l00149"></a><span class="lineno"><a class="line" href="structamcl__aes.html"> 149</a></span>&#160;<span class="preprocessor">typedef struct</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;{</div><div class="line"><a name="l00151"></a><span class="lineno"><a class="line" href="structamcl__aes.html#a9b3c86f641f2a16c92a68268811708c6"> 151</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structamcl__aes.html#a9b3c86f641f2a16c92a68268811708c6">Nk</a>; </div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="structamcl__aes.html#ad9bc7bd0b4cf5f9aa28b11306b1ef982"> 152</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structamcl__aes.html#ad9bc7bd0b4cf5f9aa28b11306b1ef982">Nr</a>; </div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="structamcl__aes.html#afcfd230897e7a79882b5ebcfecd6f363"> 153</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structamcl__aes.html#afcfd230897e7a79882b5ebcfecd6f363">mode</a>; </div><div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="structamcl__aes.html#aaaa606697b758b3185a2685d99deae0b"> 154</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> fkey[60]; </div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="structamcl__aes.html#a956e83d4f4acd4ba68610f73c9ddbe07"> 155</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> rkey[60]; </div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="structamcl__aes.html#aa6043d7c4791ba650ed67bcf46cdb7e7"> 156</a></span>&#160; <span class="keywordtype">char</span> f[16]; </div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160;} <a class="code" href="structamcl__aes.html">amcl_aes</a>;</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;<span class="comment">/* AES-GCM suppport. */</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160;<span class="preprocessor">#define GCM_ACCEPTING_HEADER 0 </span></div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160;<span class="preprocessor">#define GCM_ACCEPTING_CIPHER 1 </span></div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160;<span class="preprocessor">#define GCM_NOT_ACCEPTING_MORE 2 </span></div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160;<span class="preprocessor">#define GCM_FINISHED 3 </span></div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160;<span class="preprocessor">#define GCM_ENCRYPTING 0 </span></div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160;<span class="preprocessor">#define GCM_DECRYPTING 1 </span></div><div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="structgcm.html"> 173</a></span>&#160;<span class="preprocessor">typedef struct</span></div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;{</div><div class="line"><a name="l00175"></a><span class="lineno"><a class="line" href="structgcm.html#ad99ccb50a1022e937f9297198d44ab75"> 175</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> table[128][4]; </div><div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="structgcm.html#a6d96d37eb27ff5d03ab977473f157b21"> 176</a></span>&#160; <a class="code" href="arch_8h.html#aa8ddf20cdd716b652e76e23e5e700893">uchar</a> stateX[16]; </div><div class="line"><a name="l00177"></a><span class="lineno"><a class="line" href="structgcm.html#ab563f98721cb4bc12047849582f296c9"> 177</a></span>&#160; <a class="code" href="arch_8h.html#aa8ddf20cdd716b652e76e23e5e700893">uchar</a> Y_0[16]; </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="structgcm.html#a1884ba7add128b711fec4270eeb17daf"> 178</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> lenA[2]; </div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="structgcm.html#a1bd72fc4a946169be6734d6f1776bb7c"> 179</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> lenC[2]; </div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="structgcm.html#ad41a374b5dcb99633c068765d1f801ee"> 180</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structgcm.html#ad41a374b5dcb99633c068765d1f801ee">status</a>; </div><div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="structgcm.html#ab0fe1c4736959492b5ffbefa12458cf9"> 181</a></span>&#160; <a class="code" href="structamcl__aes.html">amcl_aes</a> <a class="code" href="structgcm.html#ab0fe1c4736959492b5ffbefa12458cf9">a</a>; </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;} <a class="code" href="structgcm.html">gcm</a>;</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="comment">/* Marsaglia &amp; Zaman Random number generator constants */</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="preprocessor">#define NK 21 </span></div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;<span class="preprocessor">#define NJ 6 </span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="preprocessor">#define NV 8 </span></div><div class="line"><a name="l00195"></a><span class="lineno"><a class="line" href="structcsprng.html"> 195</a></span>&#160;<span class="preprocessor">typedef struct</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;{</div><div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="structcsprng.html#a7995ef3e74e5d34984d4d0eb38dffd9e"> 197</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> ira[NK]; </div><div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="structcsprng.html#a2a97b45585ee7203d10337938c1f782c"> 198</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structcsprng.html#a2a97b45585ee7203d10337938c1f782c">rndptr</a>; </div><div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="structcsprng.html#a821053dc129bedb1717b4b224bd6354b"> 199</a></span>&#160; <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> <a class="code" href="structcsprng.html#a821053dc129bedb1717b4b224bd6354b">borrow</a>; </div><div class="line"><a name="l00200"></a><span class="lineno"><a class="line" href="structcsprng.html#a3848c543582da2ccacfc910f3644a3b4"> 200</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structcsprng.html#a3848c543582da2ccacfc910f3644a3b4">pool_ptr</a>; </div><div class="line"><a name="l00201"></a><span class="lineno"><a class="line" href="structcsprng.html#a2ac19b58bd7c9bab6fbc9ad394c41d2a"> 201</a></span>&#160; <span class="keywordtype">char</span> pool[32]; </div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;} <a class="code" href="structcsprng.html">csprng</a>;</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;</div><div class="line"><a name="l00209"></a><span class="lineno"><a class="line" href="structoctet.html"> 209</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160;{</div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="structoctet.html#aac7aa1ab827fcb609e3c557b27ca8ac4"> 211</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structoctet.html#aac7aa1ab827fcb609e3c557b27ca8ac4">len</a>; </div><div class="line"><a name="l00212"></a><span class="lineno"><a class="line" href="structoctet.html#a84f60e49fa04f7f0fba171374af1d167"> 212</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="structoctet.html#a84f60e49fa04f7f0fba171374af1d167">max</a>; </div><div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="structoctet.html#a2cb4746b64e9e31af123be91c0733e67"> 213</a></span>&#160; <span class="keywordtype">char</span> *<a class="code" href="structoctet.html#a2cb4746b64e9e31af123be91c0733e67">val</a>; </div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160;} <a class="code" href="structoctet.html">octet</a>;</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160;</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160;<span class="comment">/* Octet string handlers */</span></div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_output(<a class="code" href="structoctet.html">octet</a> *O);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_output_string(<a class="code" href="structoctet.html">octet</a> *O);</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_clear(<a class="code" href="structoctet.html">octet</a> *O);</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> OCT_comp(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P);</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> OCT_ncomp(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_jstring(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">char</span> *s);</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_jbytes(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">char</span> *s,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_jbyte(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">int</span> b,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_joctet(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P);</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_xor(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P);</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_empty(<a class="code" href="structoctet.html">octet</a> *O);</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> OCT_pad(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_tobase64(<span class="keywordtype">char</span> *b,<a class="code" href="structoctet.html">octet</a> *O);</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_frombase64(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">char</span> *b);</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_copy(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P);</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_xorbyte(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">int</span> m);</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_chop(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structoctet.html">octet</a> *P,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_jint(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">int</span> m,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_rand(<a class="code" href="structoctet.html">octet</a> *O,<a class="code" href="structcsprng.html">csprng</a> *R,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_shl(<a class="code" href="structoctet.html">octet</a> *O,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_fromHex(<a class="code" href="structoctet.html">octet</a> *dst,<span class="keywordtype">char</span> *src);</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_toHex(<a class="code" href="structoctet.html">octet</a> *src,<span class="keywordtype">char</span> *dst);</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> OCT_toStr(<a class="code" href="structoctet.html">octet</a> *src,<span class="keywordtype">char</span> *dst);</div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160;</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160;</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160;<span class="comment">/* Hash function */</span></div><div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH256_init(<a class="code" href="structhash256.html">hash256</a> *H);</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH256_process(<a class="code" href="structhash256.html">hash256</a> *H,<span class="keywordtype">int</span> b);</div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH256_hash(<a class="code" href="structhash256.html">hash256</a> *H,<span class="keywordtype">char</span> *h);</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160;</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160;</div><div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH384_init(<a class="code" href="structhash512.html">hash384</a> *H);</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH384_process(<a class="code" href="structhash512.html">hash384</a> *H,<span class="keywordtype">int</span> b);</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH384_hash(<a class="code" href="structhash512.html">hash384</a> *H,<span class="keywordtype">char</span> *h);</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160;</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH512_init(<a class="code" href="structhash512.html">hash512</a> *H);</div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH512_process(<a class="code" href="structhash512.html">hash512</a> *H,<span class="keywordtype">int</span> b);</div><div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> HASH512_hash(<a class="code" href="structhash512.html">hash512</a> *H,<span class="keywordtype">char</span> *h);</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160;</div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> SHA3_init(<a class="code" href="structsha3.html">sha3</a> *H,<span class="keywordtype">int</span> t);</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> SHA3_process(<a class="code" href="structsha3.html">sha3</a> *H,<span class="keywordtype">int</span> b);</div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> SHA3_hash(<a class="code" href="structsha3.html">sha3</a> *H,<span class="keywordtype">char</span> *h);</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> SHA3_shake(<a class="code" href="structsha3.html">sha3</a> *H,<span class="keywordtype">char</span> *h,<span class="keywordtype">int</span> len);</div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> SHA3_squeeze(<a class="code" href="structsha3.html">sha3</a> *H,<span class="keywordtype">char</span> *h,<span class="keywordtype">int</span> len);</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;</div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160;</div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;</div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;<span class="comment">/* AES functions */</span></div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> AES_reset(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<span class="keywordtype">int</span> m,<span class="keywordtype">char</span> *iv);</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> AES_getreg(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<span class="keywordtype">char</span> * f);</div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> AES_init(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<span class="keywordtype">int</span> m,<span class="keywordtype">int</span> n,<span class="keywordtype">char</span> *k,<span class="keywordtype">char</span> *iv);</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> AES_ecb_encrypt(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<a class="code" href="arch_8h.html#aa8ddf20cdd716b652e76e23e5e700893">uchar</a> * b);</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> AES_ecb_decrypt(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<a class="code" href="arch_8h.html#aa8ddf20cdd716b652e76e23e5e700893">uchar</a> * b);</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;<span class="keyword">extern</span> <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> AES_encrypt(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<span class="keywordtype">char</span> *b );</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="keyword">extern</span> <a class="code" href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a> AES_decrypt(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A,<span class="keywordtype">char</span> *b);</div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> AES_end(<a class="code" href="structamcl__aes.html">amcl_aes</a> *A);</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160;</div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160;</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;<span class="comment">/* AES-GCM functions */</span></div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> GCM_init(<a class="code" href="structgcm.html">gcm</a> *G,<span class="keywordtype">int</span> nk,<span class="keywordtype">char</span> *k,<span class="keywordtype">int</span> n,<span class="keywordtype">char</span> *iv);</div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> GCM_add_header(<a class="code" href="structgcm.html">gcm</a> *G,<span class="keywordtype">char</span> *b,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> GCM_add_plain(<a class="code" href="structgcm.html">gcm</a> *G,<span class="keywordtype">char</span> *c,<span class="keywordtype">char</span> *p,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> GCM_add_cipher(<a class="code" href="structgcm.html">gcm</a> *G,<span class="keywordtype">char</span> *p,<span class="keywordtype">char</span> *c,<span class="keywordtype">int</span> n);</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> GCM_finish(<a class="code" href="structgcm.html">gcm</a> *G,<span class="keywordtype">char</span> *t);</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160;</div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160;</div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160;</div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160;<span class="comment">/* random numbers */</span></div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> RAND_seed(<a class="code" href="structcsprng.html">csprng</a> *R,<span class="keywordtype">int</span> n,<span class="keywordtype">char</span> *b);</div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">void</span> RAND_clean(<a class="code" href="structcsprng.html">csprng</a> *R);</div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160;<span class="keyword">extern</span> <span class="keywordtype">int</span> RAND_byte(<a class="code" href="structcsprng.html">csprng</a> *R);</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160;</div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160;</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160;</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160;<span class="preprocessor">#endif</span></div><div class="ttc" id="structgcm_html"><div class="ttname"><a href="structgcm.html">gcm</a></div><div class="ttdoc">GCM mode instance, using AES internally.</div><div class="ttdef"><b>Definition:</b> amcl.h:173</div></div>
<div class="ttc" id="structoctet_html_a84f60e49fa04f7f0fba171374af1d167"><div class="ttname"><a href="structoctet.html#a84f60e49fa04f7f0fba171374af1d167">octet::max</a></div><div class="ttdeci">int max</div><div class="ttdef"><b>Definition:</b> amcl.h:212</div></div>
<div class="ttc" id="structhash256_html"><div class="ttname"><a href="structhash256.html">hash256</a></div><div class="ttdoc">SHA256 hash function instance.</div><div class="ttdef"><b>Definition:</b> amcl.h:69</div></div>
<div class="ttc" id="structcsprng_html_a2a97b45585ee7203d10337938c1f782c"><div class="ttname"><a href="structcsprng.html#a2a97b45585ee7203d10337938c1f782c">csprng::rndptr</a></div><div class="ttdeci">int rndptr</div><div class="ttdef"><b>Definition:</b> amcl.h:198</div></div>
<div class="ttc" id="structsha3_html_a826b7a50820b159656a017354dbfc3d7"><div class="ttname"><a href="structsha3.html#a826b7a50820b159656a017354dbfc3d7">sha3::len</a></div><div class="ttdeci">int len</div><div class="ttdef"><b>Definition:</b> amcl.h:98</div></div>
<div class="ttc" id="structamcl__aes_html_a9b3c86f641f2a16c92a68268811708c6"><div class="ttname"><a href="structamcl__aes.html#a9b3c86f641f2a16c92a68268811708c6">amcl_aes::Nk</a></div><div class="ttdeci">int Nk</div><div class="ttdef"><b>Definition:</b> amcl.h:151</div></div>
<div class="ttc" id="structoctet_html"><div class="ttname"><a href="structoctet.html">octet</a></div><div class="ttdoc">Portable representation of a big positive number.</div><div class="ttdef"><b>Definition:</b> amcl.h:209</div></div>
<div class="ttc" id="structhash256_html_ab4db96c3d30dce3db80bfbc92ca0aecf"><div class="ttname"><a href="structhash256.html#ab4db96c3d30dce3db80bfbc92ca0aecf">hash256::hlen</a></div><div class="ttdeci">int hlen</div><div class="ttdef"><b>Definition:</b> amcl.h:74</div></div>
<div class="ttc" id="structhash512_html_a56689ae69347d42cf0fa4a424e789832"><div class="ttname"><a href="structhash512.html#a56689ae69347d42cf0fa4a424e789832">hash512::hlen</a></div><div class="ttdeci">int hlen</div><div class="ttdef"><b>Definition:</b> amcl.h:84</div></div>
<div class="ttc" id="arch_8h_html_aa8ddf20cdd716b652e76e23e5e700893"><div class="ttname"><a href="arch_8h.html#aa8ddf20cdd716b652e76e23e5e700893">uchar</a></div><div class="ttdeci">#define uchar</div><div class="ttdef"><b>Definition:</b> arch.h:79</div></div>
<div class="ttc" id="structsha3_html_a495b3f25ef3e600507845be265f87dee"><div class="ttname"><a href="structsha3.html#a495b3f25ef3e600507845be265f87dee">sha3::rate</a></div><div class="ttdeci">int rate</div><div class="ttdef"><b>Definition:</b> amcl.h:97</div></div>
<div class="ttc" id="structcsprng_html_a3848c543582da2ccacfc910f3644a3b4"><div class="ttname"><a href="structcsprng.html#a3848c543582da2ccacfc910f3644a3b4">csprng::pool_ptr</a></div><div class="ttdeci">int pool_ptr</div><div class="ttdef"><b>Definition:</b> amcl.h:200</div></div>
<div class="ttc" id="structamcl__aes_html_ad9bc7bd0b4cf5f9aa28b11306b1ef982"><div class="ttname"><a href="structamcl__aes.html#ad9bc7bd0b4cf5f9aa28b11306b1ef982">amcl_aes::Nr</a></div><div class="ttdeci">int Nr</div><div class="ttdef"><b>Definition:</b> amcl.h:152</div></div>
<div class="ttc" id="structsha3_html_a73902f518f7a5d7db0f40b71b2d52f09"><div class="ttname"><a href="structsha3.html#a73902f518f7a5d7db0f40b71b2d52f09">sha3::length</a></div><div class="ttdeci">unsign64 length</div><div class="ttdef"><b>Definition:</b> amcl.h:95</div></div>
<div class="ttc" id="arch_8h_html_a88e152b3d86c9e2106240fa6cc1cbd9c"><div class="ttname"><a href="arch_8h.html#a88e152b3d86c9e2106240fa6cc1cbd9c">unsign64</a></div><div class="ttdeci">#define unsign64</div><div class="ttdef"><b>Definition:</b> arch.h:67</div></div>
<div class="ttc" id="structoctet_html_aac7aa1ab827fcb609e3c557b27ca8ac4"><div class="ttname"><a href="structoctet.html#aac7aa1ab827fcb609e3c557b27ca8ac4">octet::len</a></div><div class="ttdeci">int len</div><div class="ttdef"><b>Definition:</b> amcl.h:211</div></div>
<div class="ttc" id="structhash512_html"><div class="ttname"><a href="structhash512.html">hash512</a></div><div class="ttdoc">SHA384-512 hash function instance.</div><div class="ttdef"><b>Definition:</b> amcl.h:79</div></div>
<div class="ttc" id="arch_8h_html"><div class="ttname"><a href="arch_8h.html">arch.h</a></div><div class="ttdoc">Architecture Header File.</div></div>
<div class="ttc" id="structgcm_html_ad41a374b5dcb99633c068765d1f801ee"><div class="ttname"><a href="structgcm.html#ad41a374b5dcb99633c068765d1f801ee">gcm::status</a></div><div class="ttdeci">int status</div><div class="ttdef"><b>Definition:</b> amcl.h:180</div></div>
<div class="ttc" id="structamcl__aes_html"><div class="ttname"><a href="structamcl__aes.html">amcl_aes</a></div><div class="ttdoc">AES instance.</div><div class="ttdef"><b>Definition:</b> amcl.h:149</div></div>
<div class="ttc" id="structcsprng_html"><div class="ttname"><a href="structcsprng.html">csprng</a></div><div class="ttdoc">Cryptographically secure pseudo-random number generator instance.</div><div class="ttdef"><b>Definition:</b> amcl.h:195</div></div>
<div class="ttc" id="structamcl__aes_html_afcfd230897e7a79882b5ebcfecd6f363"><div class="ttname"><a href="structamcl__aes.html#afcfd230897e7a79882b5ebcfecd6f363">amcl_aes::mode</a></div><div class="ttdeci">int mode</div><div class="ttdef"><b>Definition:</b> amcl.h:153</div></div>
<div class="ttc" id="structgcm_html_ab0fe1c4736959492b5ffbefa12458cf9"><div class="ttname"><a href="structgcm.html#ab0fe1c4736959492b5ffbefa12458cf9">gcm::a</a></div><div class="ttdeci">amcl_aes a</div><div class="ttdef"><b>Definition:</b> amcl.h:181</div></div>
<div class="ttc" id="arch_8h_html_a59582c63ae040d9b1a47f17b0ac03db0"><div class="ttname"><a href="arch_8h.html#a59582c63ae040d9b1a47f17b0ac03db0">unsign32</a></div><div class="ttdeci">#define unsign32</div><div class="ttdef"><b>Definition:</b> arch.h:66</div></div>
<div class="ttc" id="structcsprng_html_a821053dc129bedb1717b4b224bd6354b"><div class="ttname"><a href="structcsprng.html#a821053dc129bedb1717b4b224bd6354b">csprng::borrow</a></div><div class="ttdeci">unsign32 borrow</div><div class="ttdef"><b>Definition:</b> amcl.h:199</div></div>
<div class="ttc" id="structoctet_html_a2cb4746b64e9e31af123be91c0733e67"><div class="ttname"><a href="structoctet.html#a2cb4746b64e9e31af123be91c0733e67">octet::val</a></div><div class="ttdeci">char * val</div><div class="ttdef"><b>Definition:</b> amcl.h:213</div></div>
<div class="ttc" id="structsha3_html"><div class="ttname"><a href="structsha3.html">sha3</a></div><div class="ttdoc">SHA3 hash function instance.</div><div class="ttdef"><b>Definition:</b> amcl.h:93</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>