<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.13"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>mbed TLS v2.7.8: ecjpake.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="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">mbed TLS v2.7.8 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.13 --> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> $(function() { initMenu('',false,false,'search.php','Search'); }); </script> <div id="main-nav"></div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_b4d146e9a6d8dd56ed4afb2480a97fd3.html">mbedtls</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">ecjpake.h</div> </div> </div><!--header--> <div class="contents"> <a href="ecjpake_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> </div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">/*</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * SPDX-License-Identifier: Apache-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License"); you may</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * not use this file except in compliance with the License.</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> *</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment"> *</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment"> * This file is part of mbed TLS (https://tls.mbed.org)</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> */</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef MBEDTLS_ECJPAKE_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define MBEDTLS_ECJPAKE_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">/*</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment"> * J-PAKE is a password-authenticated key exchange that allows deriving a</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment"> * strong shared secret from a (potentially low entropy) pre-shared</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment"> * passphrase, with forward secrecy and mutual authentication.</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment"> * https://en.wikipedia.org/wiki/Password_Authenticated_Key_Exchange_by_Juggling</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment"> *</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"> * This file implements the Elliptic Curve variant of J-PAKE,</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment"> * as defined in Chapter 7.4 of the Thread v1.0 Specification,</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment"> * available to members of the Thread Group http://threadgroup.org/</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment"> *</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> * As the J-PAKE algorithm is inherently symmetric, so is our API.</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> * Each party needs to send its first round message, in any order, to the</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment"> * other party, then each sends its second round message, in any order.</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment"> * The payloads are serialized in a way suitable for use in TLS, but could</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment"> * also be use outside TLS.</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment"> */</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#include "<a class="code" href="ecp_8h.html">ecp.h</a>"</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="preprocessor">#include "<a class="code" href="md_8h.html">md.h</a>"</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="preprocessor">#if !defined(MBEDTLS_ECJPAKE_ALT)</span></div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3f"> 56</a></span> <span class="keyword">typedef</span> <span class="keyword">enum</span> {</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fa965b21512e945d609eecf10c59f5df94"> 57</a></span>  <a class="code" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fa965b21512e945d609eecf10c59f5df94">MBEDTLS_ECJPAKE_CLIENT</a> = 0, </div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fae43795d8e4d6eb2484d706620cdc582f"> 58</a></span>  <a class="code" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fae43795d8e4d6eb2484d706620cdc582f">MBEDTLS_ECJPAKE_SERVER</a>, </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> } <a class="code" href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3f">mbedtls_ecjpake_role</a>;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html"> 72</a></span> <span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> {</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a2c8920999ae02d5742f4dcfd0a36e02c"> 74</a></span>  <span class="keyword">const</span> <a class="code" href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a> *<a class="code" href="structmbedtls__ecjpake__context.html#a2c8920999ae02d5742f4dcfd0a36e02c">md_info</a>; </div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#ac2604256267f50b4bd75f17655c6299a"> 75</a></span>  <a class="code" href="structmbedtls__ecp__group.html">mbedtls_ecp_group</a> <a class="code" href="structmbedtls__ecjpake__context.html#ac2604256267f50b4bd75f17655c6299a">grp</a>; </div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a50dc89b5a0871cdee0e1e78d5848b364"> 76</a></span>  mbedtls_ecjpake_role <a class="code" href="structmbedtls__ecjpake__context.html#a50dc89b5a0871cdee0e1e78d5848b364">role</a>; </div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#acf904eb3228525b6b74117b2c9686fd3"> 77</a></span>  <span class="keywordtype">int</span> <a class="code" href="structmbedtls__ecjpake__context.html#acf904eb3228525b6b74117b2c9686fd3">point_format</a>; </div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#af48836057581977acd52e7bf079a3368"> 79</a></span>  <a class="code" href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a> <a class="code" href="structmbedtls__ecjpake__context.html#af48836057581977acd52e7bf079a3368">Xm1</a>; </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a55676584cea41d167008b594748ca0d5"> 80</a></span>  <a class="code" href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a> <a class="code" href="structmbedtls__ecjpake__context.html#a55676584cea41d167008b594748ca0d5">Xm2</a>; </div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a3278c6093f4ef2bfd90984fc3d4cf773"> 81</a></span>  <a class="code" href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a> <a class="code" href="structmbedtls__ecjpake__context.html#a3278c6093f4ef2bfd90984fc3d4cf773">Xp1</a>; </div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a586f1c91152f57b4398b5e9711b93c46"> 82</a></span>  <a class="code" href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a> <a class="code" href="structmbedtls__ecjpake__context.html#a586f1c91152f57b4398b5e9711b93c46">Xp2</a>; </div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a8f830784980935408a08b5a7e37f7a88"> 83</a></span>  <a class="code" href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a> <a class="code" href="structmbedtls__ecjpake__context.html#a8f830784980935408a08b5a7e37f7a88">Xp</a>; </div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#adb90dac8428128ad65d595fc9904fdd3"> 85</a></span>  <a class="code" href="structmbedtls__mpi.html">mbedtls_mpi</a> <a class="code" href="structmbedtls__ecjpake__context.html#adb90dac8428128ad65d595fc9904fdd3">xm1</a>; </div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#ae1769cd75e437d673b4a49fc0d01bafc"> 86</a></span>  <a class="code" href="structmbedtls__mpi.html">mbedtls_mpi</a> <a class="code" href="structmbedtls__ecjpake__context.html#ae1769cd75e437d673b4a49fc0d01bafc">xm2</a>; </div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="structmbedtls__ecjpake__context.html#a532bce70f1a6652df129e28e7193357a"> 88</a></span>  <a class="code" href="structmbedtls__mpi.html">mbedtls_mpi</a> <a class="code" href="structmbedtls__ecjpake__context.html#a532bce70f1a6652df129e28e7193357a">s</a>; </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> } <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> <span class="keywordtype">void</span> <a class="code" href="ecjpake_8h.html#a8183ac817fb64ecf6d2bff0d0b8225ca">mbedtls_ecjpake_init</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx );</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#a58ba29c4014a666fa8875898d2e9d156">mbedtls_ecjpake_setup</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  mbedtls_ecjpake_role role,</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <a class="code" href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a> hash,</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <a class="code" href="ecp_8h.html#af79e530ea8f8416480f805baa20b1a2d">mbedtls_ecp_group_id</a> curve,</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *secret,</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordtype">size_t</span> len );</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#ae2fea3d7011f93328d588c9a2e8e1443">mbedtls_ecjpake_check</a>( <span class="keyword">const</span> <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx );</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#a284b3e0e437d0f360f10c4039d1ffc57">mbedtls_ecjpake_write_round_one</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> len, <span class="keywordtype">size_t</span> *olen,</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="keywordtype">int</span> (*f_rng)(<span class="keywordtype">void</span> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>),</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordtype">void</span> *p_rng );</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> </div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#af6d2da7aef8edb18aead91fe74f43dbb">mbedtls_ecjpake_read_round_one</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf,</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  <span class="keywordtype">size_t</span> len );</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span> </div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#a84967d4406d8a46b97adfa60b3cd751c">mbedtls_ecjpake_write_round_two</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> len, <span class="keywordtype">size_t</span> *olen,</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordtype">int</span> (*f_rng)(<span class="keywordtype">void</span> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>),</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordtype">void</span> *p_rng );</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#a139d891face474638d8664b5823fdacf">mbedtls_ecjpake_read_round_two</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf,</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keywordtype">size_t</span> len );</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> </div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#a9b20729f22dbcd91ae6f42489c5cd11b">mbedtls_ecjpake_derive_secret</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx,</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">size_t</span> len, <span class="keywordtype">size_t</span> *olen,</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordtype">int</span> (*f_rng)(<span class="keywordtype">void</span> *, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *, <span class="keywordtype">size_t</span>),</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordtype">void</span> *p_rng );</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span> </div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span> <span class="keywordtype">void</span> <a class="code" href="ecjpake_8h.html#af962a58646228b3a80a4c27ac344d3cb">mbedtls_ecjpake_free</a>( <a class="code" href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a> *ctx );</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> </div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span> }</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> </div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span> <span class="preprocessor">#else </span><span class="comment">/* MBEDTLS_ECJPAKE_ALT */</span><span class="preprocessor"></span></div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> <span class="preprocessor">#include "ecjpake_alt.h"</span></div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span> <span class="preprocessor">#endif </span><span class="comment">/* MBEDTLS_ECJPAKE_ALT */</span><span class="preprocessor"></span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span> </div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> <span class="preprocessor">#if defined(MBEDTLS_SELF_TEST)</span></div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span> </div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> <span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> </div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> <span class="keywordtype">int</span> <a class="code" href="ecjpake_8h.html#aac147a4eaa68fda6bf38a064398c6135">mbedtls_ecjpake_self_test</a>( <span class="keywordtype">int</span> verbose );</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> </div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> <span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span> }</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> </div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span> <span class="preprocessor">#endif </span><span class="comment">/* MBEDTLS_SELF_TEST */</span><span class="preprocessor"></span></div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> </div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span> <span class="preprocessor">#endif </span><span class="comment">/* ecjpake.h */</span><span class="preprocessor"></span></div><div class="ttc" id="structmbedtls__ecjpake__context_html_adb90dac8428128ad65d595fc9904fdd3"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#adb90dac8428128ad65d595fc9904fdd3">mbedtls_ecjpake_context::xm1</a></div><div class="ttdeci">mbedtls_mpi xm1</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00085">ecjpake.h:85</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a586f1c91152f57b4398b5e9711b93c46"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a586f1c91152f57b4398b5e9711b93c46">mbedtls_ecjpake_context::Xp2</a></div><div class="ttdeci">mbedtls_ecp_point Xp2</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00082">ecjpake.h:82</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a3278c6093f4ef2bfd90984fc3d4cf773"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a3278c6093f4ef2bfd90984fc3d4cf773">mbedtls_ecjpake_context::Xp1</a></div><div class="ttdeci">mbedtls_ecp_point Xp1</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00081">ecjpake.h:81</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_af48836057581977acd52e7bf079a3368"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#af48836057581977acd52e7bf079a3368">mbedtls_ecjpake_context::Xm1</a></div><div class="ttdeci">mbedtls_ecp_point Xm1</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00079">ecjpake.h:79</a></div></div> <div class="ttc" id="ecjpake_8h_html_ae2fea3d7011f93328d588c9a2e8e1443"><div class="ttname"><a href="ecjpake_8h.html#ae2fea3d7011f93328d588c9a2e8e1443">mbedtls_ecjpake_check</a></div><div class="ttdeci">int mbedtls_ecjpake_check(const mbedtls_ecjpake_context *ctx)</div><div class="ttdoc">Check if a context is ready for use. </div></div> <div class="ttc" id="ecp_8h_html"><div class="ttname"><a href="ecp_8h.html">ecp.h</a></div><div class="ttdoc">Elliptic curves over GF(p) </div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a2c8920999ae02d5742f4dcfd0a36e02c"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a2c8920999ae02d5742f4dcfd0a36e02c">mbedtls_ecjpake_context::md_info</a></div><div class="ttdeci">const mbedtls_md_info_t * md_info</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00074">ecjpake.h:74</a></div></div> <div class="ttc" id="ecjpake_8h_html_a58ba29c4014a666fa8875898d2e9d156"><div class="ttname"><a href="ecjpake_8h.html#a58ba29c4014a666fa8875898d2e9d156">mbedtls_ecjpake_setup</a></div><div class="ttdeci">int mbedtls_ecjpake_setup(mbedtls_ecjpake_context *ctx, mbedtls_ecjpake_role role, mbedtls_md_type_t hash, mbedtls_ecp_group_id curve, const unsigned char *secret, size_t len)</div><div class="ttdoc">Set up a context for use. </div></div> <div class="ttc" id="ecjpake_8h_html_a3f1fa77b9cda6a2540b9bd6b84fb9f3fae43795d8e4d6eb2484d706620cdc582f"><div class="ttname"><a href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fae43795d8e4d6eb2484d706620cdc582f">MBEDTLS_ECJPAKE_SERVER</a></div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00058">ecjpake.h:58</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_acf904eb3228525b6b74117b2c9686fd3"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#acf904eb3228525b6b74117b2c9686fd3">mbedtls_ecjpake_context::point_format</a></div><div class="ttdeci">int point_format</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00077">ecjpake.h:77</a></div></div> <div class="ttc" id="structmbedtls__ecp__group_html"><div class="ttname"><a href="structmbedtls__ecp__group.html">mbedtls_ecp_group</a></div><div class="ttdoc">ECP group structure. </div><div class="ttdef"><b>Definition:</b> <a href="ecp_8h_source.html#l00140">ecp.h:140</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a8f830784980935408a08b5a7e37f7a88"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a8f830784980935408a08b5a7e37f7a88">mbedtls_ecjpake_context::Xp</a></div><div class="ttdeci">mbedtls_ecp_point Xp</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00083">ecjpake.h:83</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a55676584cea41d167008b594748ca0d5"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a55676584cea41d167008b594748ca0d5">mbedtls_ecjpake_context::Xm2</a></div><div class="ttdeci">mbedtls_ecp_point Xm2</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00080">ecjpake.h:80</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_ac2604256267f50b4bd75f17655c6299a"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#ac2604256267f50b4bd75f17655c6299a">mbedtls_ecjpake_context::grp</a></div><div class="ttdeci">mbedtls_ecp_group grp</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00075">ecjpake.h:75</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_ae1769cd75e437d673b4a49fc0d01bafc"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#ae1769cd75e437d673b4a49fc0d01bafc">mbedtls_ecjpake_context::xm2</a></div><div class="ttdeci">mbedtls_mpi xm2</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00086">ecjpake.h:86</a></div></div> <div class="ttc" id="ecjpake_8h_html_af962a58646228b3a80a4c27ac344d3cb"><div class="ttname"><a href="ecjpake_8h.html#af962a58646228b3a80a4c27ac344d3cb">mbedtls_ecjpake_free</a></div><div class="ttdeci">void mbedtls_ecjpake_free(mbedtls_ecjpake_context *ctx)</div><div class="ttdoc">Free a context&#39;s content. </div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a532bce70f1a6652df129e28e7193357a"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a532bce70f1a6652df129e28e7193357a">mbedtls_ecjpake_context::s</a></div><div class="ttdeci">mbedtls_mpi s</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00088">ecjpake.h:88</a></div></div> <div class="ttc" id="ecjpake_8h_html_aac147a4eaa68fda6bf38a064398c6135"><div class="ttname"><a href="ecjpake_8h.html#aac147a4eaa68fda6bf38a064398c6135">mbedtls_ecjpake_self_test</a></div><div class="ttdeci">int mbedtls_ecjpake_self_test(int verbose)</div><div class="ttdoc">Checkup routine. </div></div> <div class="ttc" id="ecjpake_8h_html_a284b3e0e437d0f360f10c4039d1ffc57"><div class="ttname"><a href="ecjpake_8h.html#a284b3e0e437d0f360f10c4039d1ffc57">mbedtls_ecjpake_write_round_one</a></div><div class="ttdeci">int mbedtls_ecjpake_write_round_one(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)</div><div class="ttdoc">Generate and write the first round message (TLS: contents of the Client/ServerHello extension...</div></div> <div class="ttc" id="ecjpake_8h_html_a84967d4406d8a46b97adfa60b3cd751c"><div class="ttname"><a href="ecjpake_8h.html#a84967d4406d8a46b97adfa60b3cd751c">mbedtls_ecjpake_write_round_two</a></div><div class="ttdeci">int mbedtls_ecjpake_write_round_two(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)</div><div class="ttdoc">Generate and write the second round message (TLS: contents of the Client/ServerKeyExchange) ...</div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html_a50dc89b5a0871cdee0e1e78d5848b364"><div class="ttname"><a href="structmbedtls__ecjpake__context.html#a50dc89b5a0871cdee0e1e78d5848b364">mbedtls_ecjpake_context::role</a></div><div class="ttdeci">mbedtls_ecjpake_role role</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00076">ecjpake.h:76</a></div></div> <div class="ttc" id="ecjpake_8h_html_a8183ac817fb64ecf6d2bff0d0b8225ca"><div class="ttname"><a href="ecjpake_8h.html#a8183ac817fb64ecf6d2bff0d0b8225ca">mbedtls_ecjpake_init</a></div><div class="ttdeci">void mbedtls_ecjpake_init(mbedtls_ecjpake_context *ctx)</div><div class="ttdoc">Initialize a context (just makes it ready for setup() or free()). </div></div> <div class="ttc" id="ecjpake_8h_html_a9b20729f22dbcd91ae6f42489c5cd11b"><div class="ttname"><a href="ecjpake_8h.html#a9b20729f22dbcd91ae6f42489c5cd11b">mbedtls_ecjpake_derive_secret</a></div><div class="ttdeci">int mbedtls_ecjpake_derive_secret(mbedtls_ecjpake_context *ctx, unsigned char *buf, size_t len, size_t *olen, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng)</div><div class="ttdoc">Derive the shared secret (TLS: Pre-Master Secret) </div></div> <div class="ttc" id="ecp_8h_html_af79e530ea8f8416480f805baa20b1a2d"><div class="ttname"><a href="ecp_8h.html#af79e530ea8f8416480f805baa20b1a2d">mbedtls_ecp_group_id</a></div><div class="ttdeci">mbedtls_ecp_group_id</div><div class="ttdef"><b>Definition:</b> <a href="ecp_8h_source.html#l00064">ecp.h:64</a></div></div> <div class="ttc" id="ecjpake_8h_html_a3f1fa77b9cda6a2540b9bd6b84fb9f3f"><div class="ttname"><a href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3f">mbedtls_ecjpake_role</a></div><div class="ttdeci">mbedtls_ecjpake_role</div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00056">ecjpake.h:56</a></div></div> <div class="ttc" id="md_8h_html"><div class="ttname"><a href="md_8h.html">md.h</a></div><div class="ttdoc">The generic message-digest wrapper. </div></div> <div class="ttc" id="ecjpake_8h_html_af6d2da7aef8edb18aead91fe74f43dbb"><div class="ttname"><a href="ecjpake_8h.html#af6d2da7aef8edb18aead91fe74f43dbb">mbedtls_ecjpake_read_round_one</a></div><div class="ttdeci">int mbedtls_ecjpake_read_round_one(mbedtls_ecjpake_context *ctx, const unsigned char *buf, size_t len)</div><div class="ttdoc">Read and process the first round message (TLS: contents of the Client/ServerHello extension...</div></div> <div class="ttc" id="structmbedtls__mpi_html"><div class="ttname"><a href="structmbedtls__mpi.html">mbedtls_mpi</a></div><div class="ttdoc">MPI structure. </div><div class="ttdef"><b>Definition:</b> <a href="bignum_8h_source.html#l00180">bignum.h:180</a></div></div> <div class="ttc" id="md_8h_html_a496e73a6f229eba89b4abd9955822adb"><div class="ttname"><a href="md_8h.html#a496e73a6f229eba89b4abd9955822adb">mbedtls_md_info_t</a></div><div class="ttdeci">struct mbedtls_md_info_t mbedtls_md_info_t</div><div class="ttdef"><b>Definition:</b> <a href="md_8h_source.html#l00078">md.h:78</a></div></div> <div class="ttc" id="structmbedtls__ecp__point_html"><div class="ttname"><a href="structmbedtls__ecp__point.html">mbedtls_ecp_point</a></div><div class="ttdoc">ECP point structure (jacobian coordinates) </div><div class="ttdef"><b>Definition:</b> <a href="ecp_8h_source.html#l00108">ecp.h:108</a></div></div> <div class="ttc" id="structmbedtls__ecjpake__context_html"><div class="ttname"><a href="structmbedtls__ecjpake__context.html">mbedtls_ecjpake_context</a></div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00072">ecjpake.h:72</a></div></div> <div class="ttc" id="ecjpake_8h_html_a139d891face474638d8664b5823fdacf"><div class="ttname"><a href="ecjpake_8h.html#a139d891face474638d8664b5823fdacf">mbedtls_ecjpake_read_round_two</a></div><div class="ttdeci">int mbedtls_ecjpake_read_round_two(mbedtls_ecjpake_context *ctx, const unsigned char *buf, size_t len)</div><div class="ttdoc">Read and process the second round message (TLS: contents of the Client/ServerKeyExchange) ...</div></div> <div class="ttc" id="md_8h_html_a219313cb40503ec3e34a857ab98b2296"><div class="ttname"><a href="md_8h.html#a219313cb40503ec3e34a857ab98b2296">mbedtls_md_type_t</a></div><div class="ttdeci">mbedtls_md_type_t</div><div class="ttdoc">Enumeration of supported message digests. </div><div class="ttdef"><b>Definition:</b> <a href="md_8h_source.html#l00056">md.h:56</a></div></div> <div class="ttc" id="ecjpake_8h_html_a3f1fa77b9cda6a2540b9bd6b84fb9f3fa965b21512e945d609eecf10c59f5df94"><div class="ttname"><a href="ecjpake_8h.html#a3f1fa77b9cda6a2540b9bd6b84fb9f3fa965b21512e945d609eecf10c59f5df94">MBEDTLS_ECJPAKE_CLIENT</a></div><div class="ttdef"><b>Definition:</b> <a href="ecjpake_8h_source.html#l00057">ecjpake.h:57</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Jan 1 2019 18:27:17 for mbed TLS v2.7.8 by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.13 </small></address> </body> </html>