xref: /titanic_51/usr/src/lib/libsasl/include/md5_private.h (revision b453864f3587ccc3324d7a3b0438a1e542dcfde7)
1 /*
2  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #pragma ident	"%Z%%M%	%I%	%E% SMI"
7 
8 /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
9 rights reserved.
10 
11 License to copy and use this software is granted provided that it
12 is identified as the "RSA Data Security, Inc. MD5 Message-Digest
13 Algorithm" in all material mentioning or referencing this software
14 or this function.
15 
16 License is also granted to make and use derivative works provided
17 that such works are identified as "derived from the RSA Data
18 Security, Inc. MD5 Message-Digest Algorithm" in all material
19 mentioning or referencing the derived work.
20 
21 RSA Data Security, Inc. makes no representations concerning either
22 the merchantability of this software or the suitability of this
23 software for any particular purpose. It is provided "as is"
24 without express or implied warranty of any kind.
25 These notices must be retained in any copies of any part of this
26 documentation and/or software.
27  */
28 
29 #ifndef _MD5_PRIVATE_H
30 #define _MD5_PRIVATE_H
31 
32 #ifdef _SUN_SDK_
33 #ifndef _MD5_H
34 #include <md5.h>
35 #endif /* _MD5_H */
36 
37 #define _sasl_MD5Init(md5_ctx)	MD5Init(md5_ctx)
38 #define _sasl_MD5Update(md5_ctx, s, n) MD5Update(md5_ctx, s, n)
39 #define _sasl_MD5Final(b, md5_ctx) MD5Final(b, md5_ctx)
40 #else
41 /* MD5 context. */
42 typedef struct {
43   UINT4 state[4];                                   /* state (ABCD) */
44   UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
45   unsigned char buffer[64];                         /* input buffer */
46 } MD5_CTX;
47 
48 void _sasl_MD5Init PROTO_LIST ((MD5_CTX *));
49 void _sasl_MD5Update PROTO_LIST
50   ((MD5_CTX *, unsigned char *, unsigned int));
51 void _sasl_MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
52 
53 void _sasl_hmac_md5 PROTO_LIST ((unsigned char *, int, unsigned char *, int, caddr_t));
54 #endif /* _SUN_SDK_ */
55 
56 #endif /* _MD5_PRIVATE_H */
57