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