masqmail-0.2

diff src/md5/md5.h @ 162:52c82d755215

replaced the MD5 implementation with the one of Solar Designer Until now, the sample code of RFC 1321 was used. It had an ugly license. Now we use the implementation of Solar Designer, which is in the Public Domain. http://openwall.info/wiki/people/solar/software/public-domain-source-code/md5
author meillo@marmaro.de
date Sun, 18 Jul 2010 22:01:04 +0200
parents 26e34ae9a3e3
children 06525982a56c
line diff
     1.1 --- a/src/md5/md5.h	Sun Jul 18 10:48:14 2010 +0200
     1.2 +++ b/src/md5/md5.h	Sun Jul 18 22:01:04 2010 +0200
     1.3 @@ -1,35 +1,30 @@
     1.4 -/* MD5.H - header file for MD5C.C
     1.5 +/*
     1.6 + * This is an OpenSSL-compatible implementation of the RSA Data Security,
     1.7 + * Inc. MD5 Message-Digest Algorithm (RFC 1321).
     1.8 + *
     1.9 + * Written by Solar Designer <solar at openwall.com> in 2001, and placed
    1.10 + * in the public domain.  There's absolutely no warranty.
    1.11 + *
    1.12 + * See md5.c for more information.
    1.13   */
    1.14  
    1.15 -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
    1.16 -rights reserved.
    1.17 +#ifdef HAVE_OPENSSL
    1.18 +#include <openssl/md5.h>
    1.19 +#elif !defined(_MD5_H)
    1.20 +#define _MD5_H
    1.21  
    1.22 -License to copy and use this software is granted provided that it
    1.23 -is identified as the "RSA Data Security, Inc. MD5 Message-Digest
    1.24 -Algorithm" in all material mentioning or referencing this software
    1.25 -or this function.
    1.26 +/* Any 32-bit or wider unsigned integer data type will do */
    1.27 +typedef unsigned int MD5_u32plus;
    1.28  
    1.29 -License is also granted to make and use derivative works provided
    1.30 -that such works are identified as "derived from the RSA Data
    1.31 -Security, Inc. MD5 Message-Digest Algorithm" in all material
    1.32 -mentioning or referencing the derived work.
    1.33 -
    1.34 -RSA Data Security, Inc. makes no representations concerning either
    1.35 -the merchantability of this software or the suitability of this
    1.36 -software for any particular purpose. It is provided "as is"
    1.37 -without express or implied warranty of any kind.
    1.38 -
    1.39 -These notices must be retained in any copies of any part of this
    1.40 -documentation and/or software.
    1.41 - */
    1.42 -
    1.43 -/* MD5 context. */
    1.44  typedef struct {
    1.45 -	UINT4 state[4];  /* state (ABCD) */
    1.46 -	UINT4 count[2];  /* number of bits, modulo 2^64 (lsb first) */
    1.47 -	unsigned char buffer[64];  /* input buffer */
    1.48 +	MD5_u32plus lo, hi;
    1.49 +	MD5_u32plus a, b, c, d;
    1.50 +	unsigned char buffer[64];
    1.51 +	MD5_u32plus block[16];
    1.52  } MD5_CTX;
    1.53  
    1.54 -void MD5Init PROTO_LIST((MD5_CTX *));
    1.55 -void MD5Update PROTO_LIST((MD5_CTX *, unsigned char *, unsigned int));
    1.56 -void MD5Final PROTO_LIST((unsigned char[16], MD5_CTX *));
    1.57 +extern void MD5_Init(MD5_CTX *ctx);
    1.58 +extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
    1.59 +extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
    1.60 +
    1.61 +#endif