]>
Commit | Line | Data |
---|---|---|
e4d417e0 | 1 | /* |
f7a2ff7e | 2 | Copyright 2005 by Easy Software Products |
3 | ||
4 | This header file defines private APIs and should not be used in | |
5 | CUPS-based applications. | |
6 | ||
e4d417e0 | 7 | Copyright (C) 1999 Aladdin Enterprises. All rights reserved. |
8 | ||
9 | This software is provided 'as-is', without any express or implied | |
10 | warranty. In no event will the authors be held liable for any damages | |
11 | arising from the use of this software. | |
12 | ||
13 | Permission is granted to anyone to use this software for any purpose, | |
14 | including commercial applications, and to alter it and redistribute it | |
15 | freely, subject to the following restrictions: | |
16 | ||
17 | 1. The origin of this software must not be misrepresented; you must not | |
18 | claim that you wrote the original software. If you use this software | |
19 | in a product, an acknowledgment in the product documentation would be | |
20 | appreciated but is not required. | |
21 | 2. Altered source versions must be plainly marked as such, and must not be | |
22 | misrepresented as being the original software. | |
23 | 3. This notice may not be removed or altered from any source distribution. | |
24 | ||
25 | L. Peter Deutsch | |
26 | ghost@aladdin.com | |
27 | ||
28 | */ | |
c9d3f842 | 29 | /*$Id$ */ |
e4d417e0 | 30 | /* |
31 | Independent implementation of MD5 (RFC 1321). | |
32 | ||
33 | This code implements the MD5 Algorithm defined in RFC 1321. | |
34 | It is derived directly from the text of the RFC and not from the | |
35 | reference implementation. | |
36 | ||
37 | The original and principal author of md5.h is L. Peter Deutsch | |
38 | <ghost@aladdin.com>. Other authors are noted in the change history | |
39 | that follows (in reverse chronological order): | |
40 | ||
41 | 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. | |
42 | 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); | |
43 | added conditionalization for C++ compilation from Martin | |
44 | Purschke <purschke@bnl.gov>. | |
45 | 1999-05-03 lpd Original version. | |
46 | */ | |
47 | ||
f7a2ff7e | 48 | #ifndef _CUPS_MD5_H_ |
49 | # define _CUPS_MD5_H_ | |
e4d417e0 | 50 | |
51 | /* Define the state of the MD5 Algorithm. */ | |
f7a2ff7e | 52 | typedef struct _cups_md5_state_s { |
53 | unsigned int count[2]; /* message length in bits, lsw first */ | |
54 | unsigned int abcd[4]; /* digest buffer */ | |
55 | unsigned char buf[64]; /* accumulate block */ | |
56 | } _cups_md5_state_t; | |
e4d417e0 | 57 | |
f7a2ff7e | 58 | # ifdef __cplusplus |
59 | extern "C" { | |
60 | # endif /* __cplusplus */ | |
e4d417e0 | 61 | |
62 | /* Initialize the algorithm. */ | |
f7a2ff7e | 63 | void _cups_md5_init(_cups_md5_state_t *pms); |
e4d417e0 | 64 | |
65 | /* Append a string to the message. */ | |
f7a2ff7e | 66 | void _cups_md5_append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes); |
e4d417e0 | 67 | |
68 | /* Finish the message and return the digest. */ | |
f7a2ff7e | 69 | void _cups_md5_finish(_cups_md5_state_t *pms, unsigned char digest[16]); |
e4d417e0 | 70 | |
f7a2ff7e | 71 | # ifdef __cplusplus |
e4d417e0 | 72 | } /* end extern "C" */ |
f7a2ff7e | 73 | # endif /* __cplusplus */ |
74 | #endif /* !_CUPS_MD5_H_ */ |