From cbbe71752d7f9c6204ab0f16600fe7f10490f203 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 24 Apr 2004 22:38:50 +0000 Subject: Completed implementation of ldap/ntlm/simple handlers --- common/md5.h | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'common/md5.h') diff --git a/common/md5.h b/common/md5.h index 62cbf2b..de431da 100644 --- a/common/md5.h +++ b/common/md5.h @@ -15,7 +15,7 @@ * will fill a supplied 16-byte array with the digest. * * Changed so as no longer to depend on Colin Plumb's `usual.h' - * header definitions; now uses stuff from dpkg's config.h + * header definitions * - Ian Jackson . * Still in the public domain. */ @@ -27,20 +27,22 @@ extern "C" { #ifndef MD5_H #define MD5_H +#define MD5_LEN 16 #define md5byte unsigned char -struct MD5Context { - unsigned int buf[4]; - unsigned int bytes[2]; - unsigned int in[16]; -}; - -typedef struct MD5Context MD5_CTX; +typedef struct md5_ctx +{ + unsigned int buf[4]; + unsigned int bytes[2]; + unsigned int in[16]; +} +md5_ctx_t; -void MD5Init(struct MD5Context *context); -void MD5Update(struct MD5Context *context, const md5byte* buf, unsigned len); -void MD5Final(unsigned char digest[16], struct MD5Context *context); -void MD5Transform(unsigned int buf[4], unsigned int const in[16]); +void md5_init(md5_ctx_t* context); +void md5_update(md5_ctx_t* context, const void* buf, unsigned len); +void md5_final(unsigned char digest[MD5_LEN], md5_ctx_t* context); +void md5_string(unsigned char digest[MD5_LEN], const char* str); +int md5_strcmp(unsigned char digest[MD5_LEN], const char* str); #ifdef __cplusplus } -- cgit v1.2.3