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