SNMP++  3.3.4
md5.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## md5.h
4  _##
5  _## SNMP++ v3.3
6  _## -----------------------------------------------
7  _## Copyright (c) 2001-2013 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  _##########################################################################*/
27 
28 #include "snmp_pp/config_snmp_pp.h"
29 
30 #if !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
31 
32 /* MD5.H - header file for MD5C.C */
33 
34 /* Copyright (C) 1991, RSA Data Security, Inc. All rights reserved.
35 
36  License to copy and use this software is granted provided that it
37  is identified as the "RSA Data Security, Inc. MD5 Message-Digest
38  Algorithm" in all material mentioning or referencing this software
39  or this function.
40 
41  License is also granted to make and use derivative works provided
42  that such works are identified as "derived from the RSA Data
43  Security, Inc. MD5 Message-Digest Algorithm" in all material
44  mentioning or referencing the derived work.
45 
46  RSA Data Security, Inc. makes no representations concerning either
47  the merchantability of this software or the suitability of this
48  software for any particular purpose. It is provided "as is"
49  without express or implied warranty of any kind.
50 
51  These notices must be retained in any copies of any part of this
52  documentation and/or software.
53  */
54 // $Id: md5.h 2359 2013-05-09 20:07:01Z fock $
55 
56 #ifndef _MD5_H_
57 #define _MD5_H_
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 #ifdef SNMP_PP_NAMESPACE
64 namespace Snmp_pp {
65 #endif
66 
67 /* POINTER defines a generic pointer type */
68 typedef unsigned char *POINTER;
69 
70 /* UINT2 defines a two byte word */
71 typedef unsigned short int UINT2;
72 
73 /* UINT4 defines a four byte word */
74 typedef unsigned int UINT4; /* for alpha */
75 /*typedef unsigned long int UINT4; */
76 
77 /* BYTE defines a unsigned character */
78 typedef unsigned char BYTE;
79 
80 /* internal signed value */
81 typedef signed int signeddigit;
82 
83 #ifndef NULL_PTR
84 #define NULL_PTR ((POINTER)0)
85 #endif
86 
87 #ifndef UNUSED_ARG
88 #define UNUSED_ARG(x) x = *(&x);
89 #endif
90 
91 #ifndef PROTOTYPES
92 #define PROTOTYPES
93 #endif
94 
95 /* PROTO_LIST is defined depending on how PROTOTYPES is defined above.
96  If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it
97  returns an empty list. */
98 
99 #ifdef PROTOTYPES
100 #define PROTO_LIST(list) list
101 #else
102 #define PROTO_LIST(list) ()
103 #endif
104 
105 /* MD5 context. */
106 typedef struct {
107  UINT4 state[4]; /* state (ABCD) */
108  UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */
109  unsigned char buffer[64]; /* input buffer */
110 } MD5_CTX;
111 
112 DLLOPT void MD5Init PROTO_LIST ((MD5_CTX *));
113 DLLOPT void MD5Update PROTO_LIST ((MD5_CTX *, const unsigned char *, const unsigned int));
114 DLLOPT void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *));
115 
116 #ifdef SNMP_PP_NAMESPACE
117 } // end of namespace Snmp_pp
118 #endif
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif
125 
126 #endif // !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL)
unsigned int UINT4
Definition: md5.h:74
unsigned char * POINTER
Definition: md5.h:68
#define DLLOPT
#define PROTO_LIST(list)
Definition: md5.h:100
unsigned short int UINT2
Definition: md5.h:71
signed int signeddigit
Definition: md5.h:81
unsigned char BYTE
Definition: md5.h:78
Definition: md5.h:106