xref: /illumos-gate/usr/src/uts/common/sys/md4.h (revision e3ae4b35c024af1196582063ecee3ab79367227d)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef	__MD4_H
7 #define	__MD4_H
8 
9 /*
10  * MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm
11  */
12 
13 /*
14  * Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved.
15  *
16  * License to copy and use this software is granted provided that it
17  * is identified as the "RSA Data Security, Inc. MD4 Message-Digest
18  * Algorithm" in all material mentioning or referencing this software
19  * or this function.
20  *
21  * License is also granted to make and use derivative works provided
22  * that such works are identified as "derived from the RSA Data
23  * Security, Inc. MD4 Message-Digest Algorithm" in all material
24  * mentioning or referencing the derived work.
25  *
26  * RSA Data Security, Inc. makes no representations concerning either
27  * the merchantability of this software or the suitability of this
28  * software for any particular purpose. It is provided "as is"
29  * without express or implied warranty of any kind.
30  *
31  * These notices must be retained in any copies of any part of this
32  * documentation and/or software.
33  */
34 
35 #ifdef	__cplusplus
36 extern "C" {
37 #endif
38 
39 #include <sys/types.h>
40 
41 #define	MD4_DIGEST_LENGTH	16
42 
43 /* MD4 context. */
44 typedef struct {
45 	uint32_t state[4];	/* state (ABCD) */
46 	uint32_t count[2];	/* number of bits, modulo 2^64 (lsb first) */
47 	unsigned char buffer[64];	/* input buffer */
48 } MD4_CTX;
49 
50 void MD4Init(MD4_CTX *);
51 void MD4Update(MD4_CTX *, const void *_RESTRICT_KYWD, size_t);
52 void MD4Final(void *, MD4_CTX *);
53 
54 #ifdef	__cplusplus
55 }
56 #endif
57 
58 #endif	/* __MD4_H */
59