/
md5__test_8c.html
210 lines (189 loc) · 8.67 KB
/
md5__test_8c.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<html>
<head>
<title>embedded IPsec - IPsec library</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="doxygen.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="98%" border="0" align="center">
<tr>
<td>
<h2 align="left"><img src="logo_small.gif" alt="embedded IPsec"> source
code documentation </h2>
<hr>
<!-- Generated by Doxygen 1.3.4 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>md5_test.c File Reference</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
This module contains all the test functions used to test MD5.
<p>
<dl compact><dt><b>Author:</b></dt><dd>Niklaus Schild <<a href="mailto:n.schild@gmx.ch">n.schild@gmx.ch</a>> <br>
</dd></dl>
<b>OUTLINE:</b> The purpose of this module is to provide structural tests for the MD5 functions. The tests we did here are not how they should be. Because we took over the code from another project (OpenSSL) which is widely used and tested we assume that they work basically (yes I know assumptions are the worst mistakes of programmers).<p>
<b>IMPLEMENTATION:</b> We call the four basic functions used to implement a HMAC and let them do their job. After the function is called we compare the result with the expected output.<p>
Whenever a test fails we print out the INPUT, OUTPUT and the EXPECTED OUTPUT.<p>
<b>NOTES:</b> This test do NOT fully prove the correctness of this code.<p>
This document is part of <em>embedded IPsec<br>
Copyright (c) 2003 Niklaus Schild and Christian Scheurer, HTI Biel/Bienne<br>
All rights reserved.</em><hr>
<p>
Definition in file <a class="el" href="md5__test_8c-source.html">md5_test.c</a>.
<p>
<code>#include <string.h></code><br>
<code>#include "<a class="el" href="util_8h-source.html">ipsec/util.h</a>"</code><br>
<code>#include "<a class="el" href="md5_8h-source.html">ipsec/md5.h</a>"</code><br>
<code>#include "<a class="el" href="debug_8h-source.html">ipsec/debug.h</a>"</code><br>
<code>#include "<a class="el" href="structural__test_8h-source.html">testing/structural/structural_test.h</a>"</code><br>
<p>
<a href="md5__test_8c-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="md5__test_8c.html#a0">DIGEST_SIZE</a> (16)</td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="md5__test_8c.html#a1">md5_test_MD5_Init</a> (void)</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="md5__test_8c.html#a2">md5_test_MD5_Update</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="md5__test_8c.html#a3">md5_test_MD5_Final</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="md5__test_8c.html#a4">md5_test</a> (<a class="el" href="structtest__result__struct.html">test_result</a> *global_results)</td></tr>
</table>
<hr><h2>Define Documentation</h2>
<a class="anchor" name="a0" doxytag="md5_test.c::DIGEST_SIZE" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> #define DIGEST_SIZE (16)
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
</td>
</tr>
</table>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="a4" doxytag="md5_test.c::md5_test" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void md5_test </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="structtest__result__struct.html">test_result</a> * </td>
<td class="mdname1" valign="top" nowrap> <em>global_results</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Main testfunction for the MD5 tests. It does nothing but calling the subtests one after the other.
<p>
Definition at line <a class="el" href="md5__test_8c-source.html#l00218">218</a> of file <a class="el" href="md5__test_8c-source.html">md5_test.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a3" doxytag="md5_test.c::md5_test_MD5_Final" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int md5_test_MD5_Final </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Testfunciton for MD5_Final <dl compact><dt><b>Returns:</b></dt><dd>int number of tests failed in this function </dd></dl>
<p>
Definition at line <a class="el" href="md5__test_8c-source.html#l00159">159</a> of file <a class="el" href="md5__test_8c-source.html">md5_test.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="md5_test.c::md5_test_MD5_Init" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int md5_test_MD5_Init </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top">void </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Testfunciton for MD5_Init <dl compact><dt><b>Returns:</b></dt><dd>int number of tests failed in this function </dd></dl>
<p>
Definition at line <a class="el" href="md5__test_8c-source.html#l00067">67</a> of file <a class="el" href="md5__test_8c-source.html">md5_test.c</a>. </td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="md5_test.c::md5_test_MD5_Update" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> int md5_test_MD5_Update </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Testfunciton for MD5_Update <dl compact><dt><b>Returns:</b></dt><dd>int number of tests failed in this function </dd></dl>
<p>
Definition at line <a class="el" href="md5__test_8c-source.html#l00097">97</a> of file <a class="el" href="md5__test_8c-source.html">md5_test.c</a>. </td>
</tr>
</table>
</td>
</tr>
</table>
<hr>
<div align="center">Copyright 2003 by Christian Scheurer and Niklaus Schild</div>
</html>