]> git.stg.codes - ssmd.git/blob - 3rdparty/snmp++/include/snmp_pp/md5.h
Initial adding
[ssmd.git] / 3rdparty / snmp++ / include / snmp_pp / md5.h
1 /*_############################################################################
2   _## 
3   _##  md5.h  
4   _##
5   _##  SNMP++v3.2.25
6   _##  -----------------------------------------------
7   _##  Copyright (c) 2001-2010 Jochen Katz, Frank Fock
8   _##
9   _##  This software is based on SNMP++2.6 from Hewlett Packard:
10   _##  
11   _##    Copyright (c) 1996
12   _##    Hewlett-Packard Company
13   _##  
14   _##  ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
15   _##  Permission to use, copy, modify, distribute and/or sell this software 
16   _##  and/or its documentation is hereby granted without fee. User agrees 
17   _##  to display the above copyright notice and this license notice in all 
18   _##  copies of the software and any documentation of the software. User 
19   _##  agrees to assume all liability for the use of the software; 
20   _##  Hewlett-Packard and Jochen Katz make no representations about the 
21   _##  suitability of this software for any purpose. It is provided 
22   _##  "AS-IS" without warranty of any kind, either express or implied. User 
23   _##  hereby grants a royalty-free license to any and all derivatives based
24   _##  upon this software code base. 
25   _##  
26   _##  Stuttgart, Germany, Thu Sep  2 00:07:47 CEST 2010 
27   _##  
28   _##########################################################################*/
29
30 #include "snmp_pp/config_snmp_pp.h"
31
32 #if !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
33
34 /* MD5.H - header file for MD5C.C */
35
36 /* Copyright (C) 1991, RSA Data Security, Inc. All rights reserved.
37
38    License to copy and use this software is granted provided that it
39    is identified as the "RSA Data Security, Inc. MD5 Message-Digest
40    Algorithm" in all material mentioning or referencing this software
41    or this function.
42
43    License is also granted to make and use derivative works provided
44    that such works are identified as "derived from the RSA Data
45    Security, Inc. MD5 Message-Digest Algorithm" in all material
46    mentioning or referencing the derived work.
47
48    RSA Data Security, Inc. makes no representations concerning either
49    the merchantability of this software or the suitability of this
50    software for any particular purpose. It is provided "as is"
51    without express or implied warranty of any kind.
52
53    These notices must be retained in any copies of any part of this
54    documentation and/or software.
55  */
56 // $Id: md5.h 288 2007-03-22 22:37:09Z katz $
57
58 #ifndef _MD5_H_
59 #define _MD5_H_
60
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64
65 #ifdef SNMP_PP_NAMESPACE
66 namespace Snmp_pp {
67 #endif
68
69 /* POINTER defines a generic pointer type */
70 typedef unsigned char *POINTER;
71
72 /* UINT2 defines a two byte word */
73 typedef unsigned short int UINT2;
74
75 /* UINT4 defines a four byte word */
76 typedef unsigned int UINT4; /* for alpha */
77 /*typedef unsigned long int UINT4; */
78
79 /* BYTE defines a unsigned character */
80 typedef unsigned char BYTE;
81
82 /* internal signed value */
83 typedef signed int signeddigit;
84
85 #ifndef NULL_PTR
86 #define NULL_PTR ((POINTER)0)
87 #endif
88
89 #ifndef UNUSED_ARG
90 #define UNUSED_ARG(x) x = *(&x);
91 #endif
92
93 #ifndef PROTOTYPES
94 #define PROTOTYPES
95 #endif
96
97 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
98          If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
99          returns an empty list. */
100
101 #ifdef PROTOTYPES
102 #define PROTO_LIST(list) list
103 #else
104 #define PROTO_LIST(list) ()
105 #endif
106
107 /* MD5 context. */
108 typedef struct {
109   UINT4 state[4];                                           /* state (ABCD) */
110   UINT4 count[2];                /* number of bits, modulo 2^64 (lsb first) */
111   unsigned char buffer[64];                                 /* input buffer */
112 } MD5_CTX;
113
114 DLLOPT void  MD5Init PROTO_LIST ((MD5_CTX *));
115 DLLOPT void  MD5Update PROTO_LIST ((MD5_CTX *, const unsigned char *, const unsigned int));
116 DLLOPT void  MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
117
118 #ifdef SNMP_PP_NAMESPACE
119 } // end of namespace Snmp_pp
120 #endif 
121
122 #ifdef __cplusplus
123 }
124 #endif
125
126 #endif
127
128 #endif // !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)