cctools
md5.h
Go to the documentation of this file.
00001 /*
00002 Copyright (C) 2008- The University of Notre Dame
00003 This software is distributed under the GNU General Public License.
00004 See the file COPYING for details.
00005 */
00006 
00007 #ifndef MD5_H
00008 #define MD5_H
00009 
00014 #include "int_sizes.h"
00015 
00016 #define MD5_DIGEST_LENGTH 16
00017 #define MD5_DIGEST_LENGTH_HEX (MD5_DIGEST_LENGTH<<1)
00018 
00019 typedef struct {
00020         UINT32_T state[4];
00021         UINT32_T count[2];
00022         unsigned char buffer[64];
00023 } md5_context_t;
00024 
00025 void md5_init(md5_context_t * ctx);
00026 void md5_update(md5_context_t * ctx, const unsigned char *, unsigned int);
00027 void md5_final(unsigned char digest[MD5_DIGEST_LENGTH], md5_context_t * ctx);
00028 
00037 void md5_buffer(const char *buffer, int length, unsigned char digest[MD5_DIGEST_LENGTH]);
00038 
00047 int md5_file(const char *filename, unsigned char digest[MD5_DIGEST_LENGTH]);
00048 
00054 const char *md5_string(unsigned char digest[MD5_DIGEST_LENGTH]);
00055 
00056 #endif