]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/md5-private.h
Import CUPS v1.7.1
[thirdparty/cups.git] / cups / md5-private.h
CommitLineData
ef416fc2 1/*
61515785 2 * "$Id: md5-private.h 10996 2013-05-29 11:51:34Z msweet $"
71e16022
MS
3 *
4 * Private MD5 definitions for CUPS.
5 *
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 2005 by Easy Software Products
8 *
9 * Copyright (C) 1999 Aladdin Enterprises. All rights reserved.
10 *
11 * This software is provided 'as-is', without any express or implied
12 * warranty. In no event will the authors be held liable for any damages
13 * arising from the use of this software.
14 *
15 * Permission is granted to anyone to use this software for any purpose,
16 * including commercial applications, and to alter it and redistribute it
17 * freely, subject to the following restrictions:
18 *
19 * 1. The origin of this software must not be misrepresented; you must not
20 * claim that you wrote the original software. If you use this software
21 * in a product, an acknowledgment in the product documentation would be
22 * appreciated but is not required.
23 * 2. Altered source versions must be plainly marked as such, and must not be
24 * misrepresented as being the original software.
25 * 3. This notice may not be removed or altered from any source distribution.
26 *
27 * L. Peter Deutsch
28 * ghost@aladdin.com
ef416fc2 29 */
71e16022 30
ef416fc2 31/*
32 Independent implementation of MD5 (RFC 1321).
33
34 This code implements the MD5 Algorithm defined in RFC 1321.
35 It is derived directly from the text of the RFC and not from the
36 reference implementation.
37
38 The original and principal author of md5.h is L. Peter Deutsch
39 <ghost@aladdin.com>. Other authors are noted in the change history
40 that follows (in reverse chronological order):
41
42 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
43 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
44 added conditionalization for C++ compilation from Martin
45 Purschke <purschke@bnl.gov>.
46 1999-05-03 lpd Original version.
47 */
48
71e16022
MS
49#ifndef _CUPS_MD5_PRIVATE_H_
50# define _CUPS_MD5_PRIVATE_H_
ef416fc2 51
52/* Define the state of the MD5 Algorithm. */
53typedef 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
60extern "C" {
61# endif /* __cplusplus */
62
63/* Initialize the algorithm. */
757d2cad 64void _cupsMD5Init(_cups_md5_state_t *pms);
ef416fc2 65
66/* Append a string to the message. */
757d2cad 67void _cupsMD5Append(_cups_md5_state_t *pms, const unsigned char *data, int nbytes);
ef416fc2 68
69/* Finish the message and return the digest. */
757d2cad 70void _cupsMD5Finish(_cups_md5_state_t *pms, unsigned char digest[16]);
ef416fc2 71
72# ifdef __cplusplus
73} /* end extern "C" */
74# endif /* __cplusplus */
71e16022
MS
75#endif /* !_CUPS_MD5_PRIVATE_H_ */
76
77/*
61515785 78 * End of "$Id: md5-private.h 10996 2013-05-29 11:51:34Z msweet $".
71e16022 79 */