diff options
Diffstat (limited to 'common/md5.h')
-rw-r--r-- | common/md5.h | 26 |
1 files changed, 14 insertions, 12 deletions
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 <ijackson@nyx.cs.du.edu>. * 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 } |