1/* MD5.H - header file for MD5C.C
2 */
3
4/*-
5 SPDX-License-Identifier: RSA-MD
6
7 Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
8rights reserved.
9
10License to copy and use this software is granted provided that it
11is identified as the "RSA Data Security, Inc. MD5 Message-Digest
12Algorithm" in all material mentioning or referencing this software
13or this function.
14
15License is also granted to make and use derivative works provided
16that such works are identified as "derived from the RSA Data
17Security, Inc. MD5 Message-Digest Algorithm" in all material
18mentioning or referencing the derived work.
19
20RSA Data Security, Inc. makes no representations concerning either
21the merchantability of this software or the suitability of this
22software for any particular purpose. It is provided "as is"
23without express or implied warranty of any kind.
24
25These notices must be retained in any copies of any part of this
26documentation and/or software.
27 */
28
29#ifndef _SYS_MD5_H_
30#define _SYS_MD5_H_
31
32#define MD5_BLOCK_LENGTH		64
33#define MD5_DIGEST_LENGTH		16
34#define MD5_DIGEST_STRING_LENGTH	(MD5_DIGEST_LENGTH * 2 + 1)
35
36/* MD5 context. */
37typedef struct MD5Context {
38  u_int32_t state[4];	/* state (ABCD) */
39  u_int32_t count[2];	/* number of bits, modulo 2^64 (lsb first) */
40  unsigned char buffer[64];	/* input buffer */
41} MD5_CTX;
42
43#include <sys/cdefs.h>
44
45__BEGIN_DECLS
46void   MD5Init (MD5_CTX *);
47void   MD5Update (MD5_CTX *, const void *, unsigned int);
48void   MD5Final (unsigned char[__min_size(MD5_DIGEST_LENGTH)], MD5_CTX *);
49#ifndef _KERNEL
50char * MD5End(MD5_CTX *, char *);
51char * MD5Fd(int, char *);
52char * MD5FdChunk(int, char *, off_t, off_t);
53char * MD5File(const char *, char *);
54char * MD5FileChunk(const char *, char *, off_t, off_t);
55char * MD5Data(const void *, unsigned int, char *);
56#endif
57__END_DECLS
58#endif /* _SYS_MD5_H_ */
59