Blame contrib/organize/MD5.h

Packit Service 21b5d1
#ifndef __MD5_h__
Packit Service 21b5d1
#define __MD5_h__
Packit Service 21b5d1
Packit Service 21b5d1
/*
Packit Service 21b5d1
 * This is the header file for the MD5 message-digest algorithm.
Packit Service 21b5d1
 * The algorithm is due to Ron Rivest.  This code was
Packit Service 21b5d1
 * written by Colin Plumb in 1993, no copyright is claimed.
Packit Service 21b5d1
 * This code is in the public domain; do with it what you wish.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * Equivalent code is available from RSA Data Security, Inc.
Packit Service 21b5d1
 * This code has been tested against that, and is equivalent,
Packit Service 21b5d1
 * except that you don't need to include two pages of legalese
Packit Service 21b5d1
 * with every copy.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * To compute the message digest of a chunk of bytes, declare an
Packit Service 21b5d1
 * MD5_CTX structure, pass it to MD5Init, call MD5Update as
Packit Service 21b5d1
 * needed on buffers full of bytes, and then call MD5Final, which
Packit Service 21b5d1
 * will fill a supplied 16-byte array with the digest.
Packit Service 21b5d1
 *
Packit Service 21b5d1
 * Changed so as no longer to depend on Colin Plumb's `usual.h'
Packit Service 21b5d1
 * header definitions; now uses stuff from dpkg's config.h
Packit Service 21b5d1
 *  - Ian Jackson <ian@chiark.greenend.org.uk>.
Packit Service 21b5d1
 * Still in the public domain.
Packit Service 21b5d1
 */
Packit Service 21b5d1
Packit Service 21b5d1
#include <sys/types.h>
Packit Service 21b5d1
#ifdef EXV_HAVE_STDINT_H
Packit Service 21b5d1
# include <stdint.h>
Packit Service 21b5d1
#endif
Packit Service 21b5d1
Packit Service 21b5d1
/* MSVC doesn't provide C99 types, but it has MS specific variants */
Packit Service 21b5d1
#ifdef _MSC_VER
Packit Service 21b5d1
typedef unsigned __int32 uint32_t;
Packit Service 21b5d1
#endif
Packit Service 21b5d1
Packit Service 21b5d1
typedef unsigned char md5byte;
Packit Service 21b5d1
typedef uint32_t UWORD32;
Packit Service 21b5d1
Packit Service 21b5d1
struct MD5_CTX {
Packit Service 21b5d1
	UWORD32 buf[4];
Packit Service 21b5d1
	UWORD32 bytes[2];
Packit Service 21b5d1
	UWORD32 in[16];
Packit Service 21b5d1
};
Packit Service 21b5d1
Packit Service 21b5d1
extern void MD5Init(struct MD5_CTX *context);
Packit Service 21b5d1
extern void MD5Update(struct MD5_CTX *context, md5byte const *buf, unsigned len);
Packit Service 21b5d1
extern void MD5Final(unsigned char digest[16], struct MD5_CTX *context);
Packit Service 21b5d1
extern void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
Packit Service 21b5d1
Packit Service 21b5d1
#endif