-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmac_8h_source.html
More file actions
96 lines (94 loc) · 19.3 KB
/
Copy pathcmac_8h_source.html
File metadata and controls
96 lines (94 loc) · 19.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<!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.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MiniMouse Stack: C:/GITEXT/githubdoc/LoRaWanMiniMouse.github.io/MMstack/MinimouseSrc/cmac.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="projectlogo"><img alt="Logo" src="lora.bmp"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">MiniMouse Stack
 <span id="projectnumber">V1.0.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&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&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_4479a50ac3338962579017839c6d11ac.html">GITEXT</a></li><li class="navelem"><a class="el" href="dir_313566ed96e2d68b7746be4483e9b217.html">githubdoc</a></li><li class="navelem"><a class="el" href="dir_a1fe12ccd40675146f9c8376113c041e.html">LoRaWanMiniMouse.github.io</a></li><li class="navelem"><a class="el" href="dir_502a2e6a450cda7c1e5931c413e42c70.html">MMstack</a></li><li class="navelem"><a class="el" href="dir_5b21abe8128a6a1751494d478df76c40.html">MinimouseSrc</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">cmac.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="cmac_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> <span class="comment">/**************************************************************************</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright (C) 2009 Lander Casado, Philippas Tsigas</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"></span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">Permission is hereby granted, free of charge, to any person obtaining</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">a copy of this software and associated documentation files </span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">(the "Software"), to deal with the Software without restriction, including</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">without limitation the rights to use, copy, modify, merge, publish, </span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">distribute, sublicense, and/or sell copies of the Software, and to</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">permit persons to whom the Software is furnished to do so, subject to</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">the following conditions: </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">Redistributions of source code must retain the above copyright notice, </span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">this list of conditions and the following disclaimers. Redistributions in</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">binary form must reproduce the above copyright notice, this list of</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">conditions and the following disclaimers in the documentation and/or </span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">other materials provided with the distribution.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">In no event shall the authors or copyright holders be liable for any special,</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">incidental, indirect or consequential damages of any kind, or any damages </span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">whatsoever resulting from loss of use, data or profits, whether or not </span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">advised of the possibility of damage, and on any theory of liability, </span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment">arising out of or in connection with the use or performance of this software.</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment"> </span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment">FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING </span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER </span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">DEALINGS WITH THE SOFTWARE</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment"></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment">*****************************************************************************/</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#ifndef _CMAC_H_</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#define _CMAC_H_</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#include "<a class="code" href="aes_8h.html">aes.h</a>"</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  </div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="cmac_8h.html#a8391095f8961b29bdf0818f764d0d66a"> 41</a></span> <span class="preprocessor">#define AES_CMAC_KEY_LENGTH 16</span></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="cmac_8h.html#a9d43ce8be9e275dc33b7992c5cf6623f"> 42</a></span> <span class="preprocessor">#define AES_CMAC_DIGEST_LENGTH 16</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"><a class="line" href="struct___a_e_s___c_m_a_c___c_t_x.html"> 44</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html">_AES_CMAC_CTX</a> {</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="struct___a_e_s___c_m_a_c___c_t_x.html#a111583eab419917697a4ed96963f293c"> 45</a></span>  <a class="code" href="structaes__context.html">aes_context</a> <a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html#a111583eab419917697a4ed96963f293c">rijndael</a>;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="struct___a_e_s___c_m_a_c___c_t_x.html#a3be115a420dc4da7db29666a2ca6d850"> 46</a></span>  uint8_t <a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html#a3be115a420dc4da7db29666a2ca6d850">X</a>[16];</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="struct___a_e_s___c_m_a_c___c_t_x.html#ac2ab3afeba7a78b17fe98404b15c4ad0"> 47</a></span>  uint8_t <a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html#ac2ab3afeba7a78b17fe98404b15c4ad0">M_last</a>[16];</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="struct___a_e_s___c_m_a_c___c_t_x.html#a2c48607df1e9c1847d3e4ff11612124b"> 48</a></span>  uint32_t <a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html#a2c48607df1e9c1847d3e4ff11612124b">M_n</a>;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  } <a class="code" href="cmac_8h.html#af41c475ab2b2b5fdf68252112c391434">AES_CMAC_CTX</a>;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="comment">//#include <sys/cdefs.h></span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <span class="comment">//__BEGIN_DECLS</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">void</span> <a class="code" href="cmac_8h.html#a0344ba56e27c8029332069892af08737">AES_CMAC_Init</a>(<a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html">AES_CMAC_CTX</a> * ctx);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">void</span> <a class="code" href="cmac_8h.html#a0cbe43f8858ba5fbf5bbd5f03e362170">AES_CMAC_SetKey</a>(<a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html">AES_CMAC_CTX</a> * ctx, <span class="keyword">const</span> uint8_t key[<a class="code" href="cmac_8h.html#a8391095f8961b29bdf0818f764d0d66a">AES_CMAC_KEY_LENGTH</a>]);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">void</span> <a class="code" href="cmac_8h.html#ad1be03bf3df1635dd5cbf8943f4d04f6">AES_CMAC_Update</a>(<a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html">AES_CMAC_CTX</a> * ctx, <span class="keyword">const</span> uint8_t * data, uint32_t len);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="comment">// __attribute__((__bounded__(__string__,2,3)));</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">void</span> <a class="code" href="cmac_8h.html#a8ea4da33d50984199d8a91bc0ab86b15">AES_CMAC_Final</a>(uint8_t digest[<a class="code" href="cmac_8h.html#a9d43ce8be9e275dc33b7992c5cf6623f">AES_CMAC_DIGEST_LENGTH</a>], <a class="code" href="struct___a_e_s___c_m_a_c___c_t_x.html">AES_CMAC_CTX</a> * ctx);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="comment">// __attribute__((__bounded__(__minbytes__,1,AES_CMAC_DIGEST_LENGTH)));</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="comment">//__END_DECLS</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="preprocessor">#endif </span><span class="comment">/* _CMAC_H_ */</span><span class="preprocessor"></span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="ttc" id="cmac_8h_html_a9d43ce8be9e275dc33b7992c5cf6623f"><div class="ttname"><a href="cmac_8h.html#a9d43ce8be9e275dc33b7992c5cf6623f">AES_CMAC_DIGEST_LENGTH</a></div><div class="ttdeci">#define AES_CMAC_DIGEST_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00042">cmac.h:42</a></div></div>
<div class="ttc" id="struct___a_e_s___c_m_a_c___c_t_x_html_a2c48607df1e9c1847d3e4ff11612124b"><div class="ttname"><a href="struct___a_e_s___c_m_a_c___c_t_x.html#a2c48607df1e9c1847d3e4ff11612124b">_AES_CMAC_CTX::M_n</a></div><div class="ttdeci">uint32_t M_n</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00048">cmac.h:48</a></div></div>
<div class="ttc" id="structaes__context_html"><div class="ttname"><a href="structaes__context.html">aes_context</a></div><div class="ttdef"><b>Definition:</b> <a href="aes_8h_source.html#l00069">aes.h:69</a></div></div>
<div class="ttc" id="cmac_8h_html_a0344ba56e27c8029332069892af08737"><div class="ttname"><a href="cmac_8h.html#a0344ba56e27c8029332069892af08737">AES_CMAC_Init</a></div><div class="ttdeci">void AES_CMAC_Init(AES_CMAC_CTX *ctx)</div><div class="ttdef"><b>Definition:</b> <a href="_mini_mouse_cmac_8cpp_source.html#l00058">MiniMouseCmac.cpp:58</a></div></div>
<div class="ttc" id="struct___a_e_s___c_m_a_c___c_t_x_html_a111583eab419917697a4ed96963f293c"><div class="ttname"><a href="struct___a_e_s___c_m_a_c___c_t_x.html#a111583eab419917697a4ed96963f293c">_AES_CMAC_CTX::rijndael</a></div><div class="ttdeci">aes_context rijndael</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00045">cmac.h:45</a></div></div>
<div class="ttc" id="cmac_8h_html_a0cbe43f8858ba5fbf5bbd5f03e362170"><div class="ttname"><a href="cmac_8h.html#a0cbe43f8858ba5fbf5bbd5f03e362170">AES_CMAC_SetKey</a></div><div class="ttdeci">void AES_CMAC_SetKey(AES_CMAC_CTX *ctx, const uint8_t key[AES_CMAC_KEY_LENGTH])</div><div class="ttdef"><b>Definition:</b> <a href="_mini_mouse_cmac_8cpp_source.html#l00065">MiniMouseCmac.cpp:65</a></div></div>
<div class="ttc" id="struct___a_e_s___c_m_a_c___c_t_x_html_ac2ab3afeba7a78b17fe98404b15c4ad0"><div class="ttname"><a href="struct___a_e_s___c_m_a_c___c_t_x.html#ac2ab3afeba7a78b17fe98404b15c4ad0">_AES_CMAC_CTX::M_last</a></div><div class="ttdeci">uint8_t M_last[16]</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00047">cmac.h:47</a></div></div>
<div class="ttc" id="cmac_8h_html_a8ea4da33d50984199d8a91bc0ab86b15"><div class="ttname"><a href="cmac_8h.html#a8ea4da33d50984199d8a91bc0ab86b15">AES_CMAC_Final</a></div><div class="ttdeci">void AES_CMAC_Final(uint8_t digest[AES_CMAC_DIGEST_LENGTH], AES_CMAC_CTX *ctx)</div><div class="ttdef"><b>Definition:</b> <a href="_mini_mouse_cmac_8cpp_source.html#l00105">MiniMouseCmac.cpp:105</a></div></div>
<div class="ttc" id="aes_8h_html"><div class="ttname"><a href="aes_8h.html">aes.h</a></div></div>
<div class="ttc" id="struct___a_e_s___c_m_a_c___c_t_x_html_a3be115a420dc4da7db29666a2ca6d850"><div class="ttname"><a href="struct___a_e_s___c_m_a_c___c_t_x.html#a3be115a420dc4da7db29666a2ca6d850">_AES_CMAC_CTX::X</a></div><div class="ttdeci">uint8_t X[16]</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00046">cmac.h:46</a></div></div>
<div class="ttc" id="cmac_8h_html_af41c475ab2b2b5fdf68252112c391434"><div class="ttname"><a href="cmac_8h.html#af41c475ab2b2b5fdf68252112c391434">AES_CMAC_CTX</a></div><div class="ttdeci">struct _AES_CMAC_CTX AES_CMAC_CTX</div></div>
<div class="ttc" id="cmac_8h_html_a8391095f8961b29bdf0818f764d0d66a"><div class="ttname"><a href="cmac_8h.html#a8391095f8961b29bdf0818f764d0d66a">AES_CMAC_KEY_LENGTH</a></div><div class="ttdeci">#define AES_CMAC_KEY_LENGTH</div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00041">cmac.h:41</a></div></div>
<div class="ttc" id="struct___a_e_s___c_m_a_c___c_t_x_html"><div class="ttname"><a href="struct___a_e_s___c_m_a_c___c_t_x.html">_AES_CMAC_CTX</a></div><div class="ttdef"><b>Definition:</b> <a href="cmac_8h_source.html#l00044">cmac.h:44</a></div></div>
<div class="ttc" id="cmac_8h_html_ad1be03bf3df1635dd5cbf8943f4d04f6"><div class="ttname"><a href="cmac_8h.html#ad1be03bf3df1635dd5cbf8943f4d04f6">AES_CMAC_Update</a></div><div class="ttdeci">void AES_CMAC_Update(AES_CMAC_CTX *ctx, const uint8_t *data, uint32_t len)</div><div class="ttdef"><b>Definition:</b> <a href="_mini_mouse_cmac_8cpp_source.html#l00071">MiniMouseCmac.cpp:71</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>