From 66c1dd5fa4bd8cfaa94b83c62783ec98c7a48d93 Mon Sep 17 00:00:00 2001 From: bertrand Date: Mon, 6 Sep 1999 10:08:37 +0000 Subject: changed names to follow camel style. 1999-09-06 bertrand * camel/md5-utils.h: * camel/md5-utils.c: changed names to follow camel style. ` svn path=/trunk/; revision=1184 --- camel/md5-utils.h | 75 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 33 deletions(-) (limited to 'camel/md5-utils.h') diff --git a/camel/md5-utils.h b/camel/md5-utils.h index cebc073609..a6047644ef 100644 --- a/camel/md5-utils.h +++ b/camel/md5-utils.h @@ -1,36 +1,45 @@ -#ifndef MD5_H -#define MD5_H - -#ifdef __alpha -typedef unsigned int uint32; -#else -typedef unsigned long uint32; -#endif - -struct MD5Context { - uint32 buf[4]; - uint32 bits[2]; - unsigned char in[64]; - int doByteReverse; -}; - -void rpmMD5Init(struct MD5Context *context, int brokenEndian); -void rpmMD5Update(struct MD5Context *context, unsigned char const *buf, - unsigned len); -void rpmMD5Final(unsigned char digest[16], struct MD5Context *context); -void rpmMD5Transform(uint32 buf[4], uint32 const in[16]); - -int mdfile(const char *fn, unsigned char *digest); -int mdbinfile(const char *fn, unsigned char *bindigest); - -/* These assume a little endian machine and return incorrect results! - They are here for compatibility with old (broken) versions of RPM */ -int mdfileBroken(const char *fn, unsigned char *digest); -int mdbinfileBroken(const char *fn, unsigned char *bindigest); - +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * This is needed to make RSAREF happy on some MS-DOS compilers. + * This code implements the MD5 message-digest algorithm. + * The algorithm is due to Ron Rivest. This code was + * written by Colin Plumb in 1993, no copyright is claimed. + * This code is in the public domain; do with it what you wish. + * + * Equivalent code is available from RSA Data Security, Inc. + * This code has been tested against that, and is equivalent, + * except that you don't need to include two pages of legalese + * with every copy. + * + * To compute the message digest of a chunk of bytes, declare an + * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as + * needed on buffers full of bytes, and then call rpmMD5Final, which + * will fill a supplied 16-byte array with the digest. + */ + +/* parts of this file are : + * Written March 1993 by Branko Lankester + * Modified June 1993 by Colin Plumb for altered md5.c. + * Modified October 1995 by Erik Troan for RPM */ -typedef /*@abstract@*/ struct MD5Context MD5_CTX; -#endif /* MD5_H */ + +#ifndef MD5_UTILS_H +#define MD5_UTILS_H + +#include + + +typedef struct { + guint32 buf[4]; + guint32 bits[2]; + guchar in[64]; + gint doByteReverse; + +} MD5Context ; + + +int md5_file (const gchar *fn, guchar *digest); +int md5_bin_file (const gchar *fn, guchar *bindigest); + + +#endif /* MD5_UTILS_H */ -- cgit v1.2.3