1 /*=========================================================================
3 Program: KWSys - Kitware System Library
4 Module: $RCSfile: MD5.h.in,v $
6 Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.
7 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notices for more information.
13 =========================================================================*/
14 #ifndef @KWSYS_NAMESPACE@_MD5_h
15 #define @KWSYS_NAMESPACE@_MD5_h
17 #include <@KWSYS_NAMESPACE@/Configure.h>
19 /* Redefine all public interface symbol names to be in the proper
20 namespace. These macros are used internally to kwsys only, and are
21 not visible to user code. Use kwsysHeaderDump.pl to reproduce
22 these macros after making changes to the interface. */
23 #if !defined(KWSYS_NAMESPACE)
24 # define kwsys_ns(x) @KWSYS_NAMESPACE@##x
25 # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT
27 #define kwsysMD5 kwsys_ns(MD5)
28 #define kwsysMD5_s kwsys_ns(MD5_s)
29 #define kwsysMD5_New kwsys_ns(MD5_New)
30 #define kwsysMD5_Delete kwsys_ns(MD5_Delete)
31 #define kwsysMD5_Initialize kwsys_ns(MD5_Initialize)
32 #define kwsysMD5_Append kwsys_ns(MD5_Append)
33 #define kwsysMD5_Finalize kwsys_ns(MD5_Finalize)
34 #define kwsysMD5_FinalizeHex kwsys_ns(MD5_FinalizeHex)
35 #define kwsysMD5_DigestToHex kwsys_ns(MD5_DigestToHex)
37 #if defined(__cplusplus)
43 * MD5 state data structure.
45 typedef struct kwsysMD5_s kwsysMD5
;
48 * Create a new MD5 instance. The returned instance is not initialized.
50 kwsysEXPORT kwsysMD5
* kwsysMD5_New(void);
53 * Delete an old MD5 instance.
55 kwsysEXPORT
void kwsysMD5_Delete(kwsysMD5
* md5
);
58 * Initialize a new MD5 digest.
60 kwsysEXPORT
void kwsysMD5_Initialize(kwsysMD5
* md5
);
63 * Append data to an MD5 digest. If the given length is negative,
64 * data will be read up to but not including a terminating null.
66 kwsysEXPORT
void kwsysMD5_Append(kwsysMD5
* md5
, unsigned char const* data
,
70 * Finalize a MD5 digest and get the 16-byte hash value.
72 kwsysEXPORT
void kwsysMD5_Finalize(kwsysMD5
* md5
, unsigned char digest
[16]);
75 * Finalize a MD5 digest and get the 32-bit hexadecimal representation.
77 kwsysEXPORT
void kwsysMD5_FinalizeHex(kwsysMD5
* md5
, char buffer
[32]);
80 * Convert a MD5 digest 16-byte value to a 32-byte hexadecimal representation.
82 kwsysEXPORT
void kwsysMD5_DigestToHex(unsigned char const digest
[16],
85 #if defined(__cplusplus)
89 /* If we are building a kwsys .c or .cxx file, let it use these macros.
90 Otherwise, undefine them to keep the namespace clean. */
91 #if !defined(KWSYS_NAMESPACE)
97 # undef kwsysMD5_Delete
98 # undef kwsysMD5_Initialize
99 # undef kwsysMD5_Append
100 # undef kwsysMD5_Finalize
101 # undef kwsysMD5_FinalizeHex
102 # undef kwsysMD5_DigestToHex