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