Mercurial > mplayer.hg
annotate libvo/md5sum.h @ 13740:7b459982a1a8
Remove obsoleted comment about wma9sp running only on windows
author | rtognimp |
---|---|
date | Sat, 23 Oct 2004 15:48:31 +0000 |
parents | 927825240d42 |
children | 31109192db12 |
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 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
12 * $Id$ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
13 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
14 * -------------------------------------------------------------------------- ** |
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 * Description: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
17 * 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
|
18 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
19 * -------------------------------------------------------------------------- ** |
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 * License: |
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 * 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
|
24 * 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
|
25 * 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
|
26 * 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
|
27 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
28 * 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
|
29 * 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
|
30 * 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
|
31 * 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
|
32 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
33 * 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
|
34 * License along with this library; if not, write to the Free Software |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
35 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
36 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
37 * -------------------------------------------------------------------------- ** |
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 * Notes: |
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 * 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
|
42 * read the code. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
43 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
44 * 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
|
45 * 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
|
46 * 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
|
47 * 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
|
48 * 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
|
49 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
50 * 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
|
51 * 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
|
52 * 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
|
53 * 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
|
54 * 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
|
55 * 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
|
56 * endian-agnostic implementation. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
57 * 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
|
58 * 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
|
59 * 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
|
60 * some embedded environments. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
61 * 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
|
62 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
63 * 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
|
64 * 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
|
65 * 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
|
66 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
67 * 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
|
68 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
69 * -------------------------------------------------------------------------- ** |
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 * References: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
72 * 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
|
73 * Ron Rivest. IETF, April, 1992 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
74 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
75 * ========================================================================== ** |
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 /* #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
|
79 |
13497 | 80 #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
|
81 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
82 /* -------------------------------------------------------------------------- ** |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
83 * Typedefs: |
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 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
86 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
|
87 original as possible. */ |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
88 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
89 typedef struct |
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 uint32_t len; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
92 uint32_t ABCD[4]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
93 int b_used; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
94 uchar block[64]; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
95 } auth_md5Ctx; |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
96 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
97 |
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 * Functions: |
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 |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
102 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
|
103 /* ------------------------------------------------------------------------ ** |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
104 * Initialize an MD5 context. |
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 * 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
|
107 * Contexts are typically created thusly: |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
108 * 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
|
109 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
110 * 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
|
111 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
112 * 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
|
113 * 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
|
114 * 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
|
115 * 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
|
116 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
117 * 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
|
118 * 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
|
119 * 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
|
120 * 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
|
121 * 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
|
122 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
123 * 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
|
124 * you've finished using it. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
125 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
126 * 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
|
127 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
128 * ------------------------------------------------------------------------ ** |
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 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
|
133 const uchar *src, |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
134 const int len ); |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
135 /* ------------------------------------------------------------------------ ** |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
136 * 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
|
137 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
138 * 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
|
139 * built. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
140 * 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
|
141 * the MD5 algorithm. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
142 * 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
|
143 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
144 * 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
|
145 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
146 * 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
|
147 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
148 * ------------------------------------------------------------------------ ** |
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 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
|
153 /* ------------------------------------------------------------------------ ** |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
154 * 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
|
155 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
156 * 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
|
157 * built. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
158 * 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
|
159 * receive the finished MD5 sum. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
160 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
161 * 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
|
162 * 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
|
163 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
164 * 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
|
165 * 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
|
166 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
167 * 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
|
168 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
169 * ------------------------------------------------------------------------ ** |
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 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
|
174 /* ------------------------------------------------------------------------ ** |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
175 * Compute an MD5 message digest. |
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 * 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
|
178 * Must be 16 bytes, minimum. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
179 * 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
|
180 * 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
|
181 * (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
|
182 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
183 * 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
|
184 * MD5 message digest. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
185 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
186 * 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
|
187 * 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
|
188 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
189 * 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
|
190 * <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
|
191 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
192 * 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
|
193 * 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
|
194 * 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
|
195 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
196 * 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
|
197 * 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
|
198 * 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
|
199 * 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
|
200 * others. ...maybe. |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
201 * |
07708ec98d87
New MD5 sum video output driver. For every frame, it calculates the MD5 sum
ivo
parents:
diff
changeset
|
202 * See Also: <auth_md5InitCtx()> |
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 * ------------------------------------------------------------------------ ** |
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 #endif /* AUTH_MD5_H */ |