Blame utils/md5.h

Packit eace71
/*
Packit eace71
 * This is the header file for the MD5 message-digest algorithm.
Packit eace71
 * The algorithm is due to Ron Rivest.  This code was
Packit eace71
 * written by Colin Plumb in 1993, no copyright is claimed.
Packit eace71
 * This code is in the public domain; do with it what you wish.
Packit eace71
 *
Packit eace71
 * Equivalent code is available from RSA Data Security, Inc.
Packit eace71
 * This code has been tested against that, and is equivalent,
Packit eace71
 * except that you don't need to include two pages of legalese
Packit eace71
 * with every copy.
Packit eace71
 *
Packit eace71
 * To compute the message digest of a chunk of bytes, declare an
Packit eace71
 * MD5Context structure, pass it to MD5Init, call MD5Update as
Packit eace71
 * needed on buffers full of bytes, and then call MD5Final, which
Packit eace71
 * will fill a supplied 16-byte array with the digest.
Packit eace71
 *
Packit eace71
 * Changed so as no longer to depend on Colin Plumb's `usual.h'
Packit eace71
 * header definitions; now uses stuff from dpkg's config.h
Packit eace71
 *  - Ian Jackson <ijackson@nyx.cs.du.edu>.
Packit eace71
 * Still in the public domain.
Packit eace71
 */
Packit eace71
Packit eace71
#ifndef MD5_H
Packit eace71
#define MD5_H
Packit eace71
Packit eace71
#include <stdint.h>
Packit eace71
Packit eace71
#define md5byte unsigned char
Packit eace71
Packit eace71
struct MD5Context {
Packit eace71
	uint32_t buf[4];
Packit eace71
	uint32_t bytes[2];
Packit eace71
	uint32_t in[16];
Packit eace71
};
Packit eace71
Packit eace71
void MD5Init(struct MD5Context *context);
Packit eace71
void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
Packit eace71
void MD5Final(unsigned char digest[16], struct MD5Context *context);
Packit eace71
void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
Packit eace71
Packit eace71
#endif				/* !MD5_H */