cctools
md5.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2008- The University of Notre Dame
3 This software is distributed under the GNU General Public License.
4 See the file COPYING for details.
5 */
6 
7 #ifndef MD5_H
8 #define MD5_H
9 
14 #include "int_sizes.h"
15 
16 #define MD5_DIGEST_LENGTH 16
17 #define MD5_DIGEST_LENGTH_HEX (MD5_DIGEST_LENGTH<<1)
18 
19 typedef struct {
20  UINT32_T state[4];
21  UINT32_T count[2];
22  unsigned char buffer[64];
24 
25 void md5_init(md5_context_t * ctx);
26 void md5_update(md5_context_t * ctx, const unsigned char *, unsigned int);
27 void md5_final(unsigned char digest[MD5_DIGEST_LENGTH], md5_context_t * ctx);
28 
37 void md5_buffer(const char *buffer, int length, unsigned char digest[MD5_DIGEST_LENGTH]);
38 
47 int md5_file(const char *filename, unsigned char digest[MD5_DIGEST_LENGTH]);
48 
54 const char *md5_string(unsigned char digest[MD5_DIGEST_LENGTH]);
55 
56 #endif
Definition: md5.h:19
const char * md5_string(unsigned char digest[MD5_DIGEST_LENGTH])
Convert an MD5 digest into a printable string.
void md5_buffer(const char *buffer, int length, unsigned char digest[MD5_DIGEST_LENGTH])
Checksum a memory buffer.
int md5_file(const char *filename, unsigned char digest[MD5_DIGEST_LENGTH])
Checksum a local file.