annotate libvo/md5sum.h @ 18659:db8821b163e5

CVS --> Subversion
author diego
date Fri, 09 Jun 2006 13:32:57 +0000
parents 401b440a6d76
children 0783dd397f74
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13395
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
1 #ifndef AUTH_MD5_H
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
2 #define AUTH_MD5_H
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
3 /* ========================================================================== **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
4 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
5 * MD5.h
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
6 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
7 * Copyright:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
8 * Copyright (C) 2003, 2004 by Christopher R. Hertel
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
9 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
10 * Email: crh@ubiqx.mn.org
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
11 *
15164
31109192db12 Mark imported files from uCIFS library as changed for GPL ¡ø2a compliance.
diego
parents: 13497
diff changeset
12 * Modified for use with MPlayer, detailed CVS changelog at
31109192db12 Mark imported files from uCIFS library as changed for GPL ¡ø2a compliance.
diego
parents: 13497
diff changeset
13 * http://www.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/
13395
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
14 * $Id$
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
15 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
16 * -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
17 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
18 * Description:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
19 * Implements the MD5 hash algorithm, as described in RFC 1321.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
20 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
21 * -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
22 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
23 * License:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
24 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
25 * This library is free software; you can redistribute it and/or
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
26 * modify it under the terms of the GNU Lesser General Public
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
27 * License as published by the Free Software Foundation; either
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
28 * version 2.1 of the License, or (at your option) any later version.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
29 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
30 * This library is distributed in the hope that it will be useful,
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
33 * Lesser General Public License for more details.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
34 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
35 * You should have received a copy of the GNU Lesser General Public
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
36 * License along with this library; if not, write to the Free Software
17367
401b440a6d76 Update licensing information: The FSF changed postal address.
diego
parents: 15164
diff changeset
37 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
13395
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
38 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
39 * -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
40 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
41 * Notes:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
42 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
43 * None of this will make any sense unless you're studying RFC 1321 as you
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
44 * read the code.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
45 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
46 * MD5 is described in RFC 1321.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
47 * The MD*4* algorithm is described in RFC 1320 (that's 1321 - 1).
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
48 * MD5 is very similar to MD4, but not quite similar enough to justify
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
49 * putting the two into a single module. Besides, I wanted to add a few
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
50 * extra functions to this one to expand its usability.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
51 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
52 * There are three primary motivations for this particular implementation.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
53 * 1) Programmer's pride. I wanted to be able to say I'd done it, and I
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
54 * wanted to learn from the experience.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
55 * 2) Portability. I wanted an implementation that I knew to be portable
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
56 * to a reasonable number platforms. In particular, the algorithm is
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
57 * designed with little-endian platforms in mind, but I wanted an
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
58 * endian-agnostic implementation.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
59 * 3) Compactness. While not an overriding goal, I thought it worth-while
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
60 * to see if I could reduce the overall size of the result. This is in
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
61 * keeping with my hopes that this library will be suitable for use in
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
62 * some embedded environments.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
63 * Beyond that, cleanliness and clarity are always worth pursuing.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
64 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
65 * As mentioned above, the code really only makes sense if you are familiar
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
66 * with the MD5 algorithm or are using RFC 1321 as a guide. This code is
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
67 * quirky, however, so you'll want to be reading carefully.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
68 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
69 * Yeah...most of the comments are cut-and-paste from my MD4 implementation.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
70 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
71 * -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
72 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
73 * References:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
74 * IETF RFC 1321: The MD5 Message-Digest Algorithm
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
75 * Ron Rivest. IETF, April, 1992
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
76 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
77 * ========================================================================== **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
78 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
79
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
80 /* #include "auth_common.h" This was in the original. */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
81
13497
927825240d42 changed include of stdint.h to inttypes.h
ivo
parents: 13395
diff changeset
82 #include <inttypes.h> /* This was not... */
13395
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
83
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
84 /* -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
85 * Typedefs:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
86 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
87
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
88 typedef unsigned char uchar; /* Added uchar typedef to keep as close to the
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
89 original as possible. */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
90
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
91 typedef struct
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
92 {
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
93 uint32_t len;
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
94 uint32_t ABCD[4];
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
95 int b_used;
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
96 uchar block[64];
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
97 } auth_md5Ctx;
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
98
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
99
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
100 /* -------------------------------------------------------------------------- **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
101 * Functions:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
102 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
103
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
104 auth_md5Ctx *auth_md5InitCtx( auth_md5Ctx *ctx );
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
105 /* ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
106 * Initialize an MD5 context.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
107 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
108 * Input: ctx - A pointer to the MD5 context structure to be initialized.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
109 * Contexts are typically created thusly:
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
110 * ctx = (auth_md5Ctx *)malloc( sizeof(auth_md5Ctx) );
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
111 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
112 * Output: A pointer to the initialized context (same as <ctx>).
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
113 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
114 * Notes: The purpose of the context is to make it possible to generate
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
115 * an MD5 Message Digest in stages, rather than having to pass a
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
116 * single large block to a single MD5 function. The context
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
117 * structure keeps track of various bits of state information.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
118 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
119 * Once the context is initialized, the blocks of message data
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
120 * are passed to the <auth_md5SumCtx()> function. Once the
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
121 * final bit of data has been handed to <auth_md5SumCtx()> the
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
122 * context can be closed out by calling <auth_md5CloseCtx()>,
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
123 * which also calculates the final MD5 result.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
124 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
125 * Don't forget to free an allocated context structure when
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
126 * you've finished using it.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
127 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
128 * See Also: <auth_md5SumCtx()>, <auth_md5CloseCtx()>
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
129 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
130 * ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
131 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
132
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
133
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
134 auth_md5Ctx *auth_md5SumCtx( auth_md5Ctx *ctx,
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
135 const uchar *src,
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
136 const int len );
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
137 /* ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
138 * Build an MD5 Message Digest within the given context.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
139 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
140 * Input: ctx - Pointer to the context in which the MD5 sum is being
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
141 * built.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
142 * src - A chunk of source data. This will be used to drive
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
143 * the MD5 algorithm.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
144 * len - The number of bytes in <src>.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
145 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
146 * Output: A pointer to the updated context (same as <ctx>).
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
147 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
148 * See Also: <auth_md5InitCtx()>, <auth_md5CloseCtx()>, <auth_md5Sum()>
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
149 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
150 * ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
151 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
152
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
153
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
154 auth_md5Ctx *auth_md5CloseCtx( auth_md5Ctx *ctx, uchar *dst );
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
155 /* ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
156 * Close an MD5 Message Digest context and generate the final MD5 sum.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
157 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
158 * Input: ctx - Pointer to the context in which the MD5 sum is being
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
159 * built.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
160 * dst - A pointer to at least 16 bytes of memory, which will
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
161 * receive the finished MD5 sum.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
162 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
163 * Output: A pointer to the closed context (same as <ctx>).
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
164 * You might use this to free a malloc'd context structure. :)
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
165 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
166 * Notes: The context (<ctx>) is returned in an undefined state.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
167 * It must be re-initialized before re-use.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
168 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
169 * See Also: <auth_md5InitCtx()>, <auth_md5SumCtx()>
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
170 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
171 * ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
172 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
173
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
174
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
175 uchar *auth_md5Sum( uchar *dst, const uchar *src, const int len );
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
176 /* ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
177 * Compute an MD5 message digest.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
178 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
179 * Input: dst - Destination buffer into which the result will be written.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
180 * Must be 16 bytes, minimum.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
181 * src - Source data block to be MD5'd.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
182 * len - The length, in bytes, of the source block.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
183 * (Note that the length is given in bytes, not bits.)
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
184 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
185 * Output: A pointer to <dst>, which will contain the calculated 16-byte
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
186 * MD5 message digest.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
187 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
188 * Notes: This function is a shortcut. It takes a single input block.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
189 * For more drawn-out operations, see <auth_md5InitCtx()>.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
190 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
191 * This function is interface-compatible with the
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
192 * <auth_md4Sum()> function in the MD4 module.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
193 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
194 * The MD5 algorithm is designed to work on data with an
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
195 * arbitrary *bit* length. Most implementations, this one
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
196 * included, handle the input data in byte-sized chunks.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
197 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
198 * The MD5 algorithm does much of its work using four-byte
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
199 * words, and so can be tuned for speed based on the endian-ness
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
200 * of the host. This implementation is intended to be
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
201 * endian-neutral, which may make it a teeny bit slower than
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
202 * others. ...maybe.
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
203 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
204 * See Also: <auth_md5InitCtx()>
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
205 *
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
206 * ------------------------------------------------------------------------ **
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
207 */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
208
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
209
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
210 /* ========================================================================== */
07708ec98d87 New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff changeset
211 #endif /* AUTH_MD5_H */