]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | /* |
503b54c9 | 2 | * Private MD5 definitions for CUPS. |
71e16022 | 3 | * |
503b54c9 MS |
4 | * Copyright 2007-2010 by Apple Inc. |
5 | * Copyright 2005 by Easy Software Products | |
71e16022 | 6 | * |
503b54c9 | 7 | * Copyright (C) 1999 Aladdin Enterprises. All rights reserved. |
71e16022 | 8 | * |
503b54c9 MS |
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. | |
71e16022 | 12 | * |
503b54c9 MS |
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: | |
71e16022 | 16 | * |
503b54c9 MS |
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. | |
71e16022 | 24 | * |
503b54c9 MS |
25 | * L. Peter Deutsch |
26 | * ghost@aladdin.com | |
ef416fc2 | 27 | */ |
71e16022 | 28 | |
ef416fc2 | 29 | /* |
30 | Independent implementation of MD5 (RFC 1321). | |
31 | ||
32 | This code implements the MD5 Algorithm defined in RFC 1321. | |
33 | It is derived directly from the text of the RFC and not from the | |
34 | reference implementation. | |
35 | ||
36 | The original and principal author of md5.h is L. Peter Deutsch | |
37 | <ghost@aladdin.com>. Other authors are noted in the change history | |
38 | that follows (in reverse chronological order): | |
39 | ||
40 | 1999-11-04 lpd Edited comments slightly for automatic TOC extraction. | |
41 | 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5); | |
42 | added conditionalization for C++ compilation from Martin | |
43 | Purschke <purschke@bnl.gov>. | |
44 | 1999-05-03 lpd Original version. | |
45 | */ | |
46 | ||
fb863569 MS |
47 | #ifndef _CUPS_MD5_INTERNAL_H_ |
48 | # define _CUPS_MD5_INTERNAL_H_ | |
ef416fc2 | 49 | |
e3586875 MS |
50 | # include <cups/versioning.h> |
51 | ||
ef416fc2 | 52 | /* Define the state of the MD5 Algorithm. */ |
53 | typedef struct _cups_md5_state_s { | |
54 | unsigned int count[2]; /* message length in bits, lsw first */ | |
55 | unsigned int abcd[4]; /* digest buffer */ | |
56 | unsigned char buf[64]; /* accumulate block */ | |
57 | } _cups_md5_state_t; | |
58 | ||
59 | # ifdef __cplusplus | |
60 | extern "C" { | |
61 | # endif /* __cplusplus */ | |
62 | ||
63 | /* Initialize the algorithm. */ | |
fb863569 | 64 | void _cupsMD5Init(_cups_md5_state_t *pms) _CUPS_INTERNAL; |
ef416fc2 | 65 | |
66 | /* Append a string to the message. */ | |
fb863569 | 67 | void _cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes) _CUPS_INTERNAL; |
ef416fc2 | 68 | |
69 | /* Finish the message and return the digest. */ | |
fb863569 | 70 | void _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]) _CUPS_INTERNAL; |
ef416fc2 | 71 | |
72 | # ifdef __cplusplus | |
73 | } /* end extern "C" */ | |
74 | # endif /* __cplusplus */ | |
fb863569 | 75 | #endif /* !_CUPS_MD5_INTERNAL_H_ */ |