#include <isc/lang.h>
#include <isc/platform.h>
#include <isc/types.h>
Go to the source code of this file.
Data Structures | |
struct | isc_md5_t |
Defines | |
#define | ISC_MD5_H 1 |
#define | ISC_MD5_DIGESTLENGTH 16U |
#define | ISC_MD5_BLOCK_LENGTH 64U |
Functions | |
ISC_LANG_BEGINDECLS void | isc_md5_init (isc_md5_t *ctx) |
void | isc_md5_invalidate (isc_md5_t *ctx) |
void | isc_md5_update (isc_md5_t *ctx, const unsigned char *buf, unsigned int len) |
void | isc_md5_final (isc_md5_t *ctx, unsigned char *digest) |
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 MD5Init, call MD5Update as needed on buffers full of bytes, and then call MD5Final, which will fill a supplied 16-byte array with the digest.
Changed so as no longer to depend on Colin Plumb's `usual.h' header definitions; now uses stuff from dpkg's config.h
Definition in file md5.h.
#define ISC_MD5_DIGESTLENGTH 16U |
Definition at line 50 of file md5.h.
Referenced by ATF_TC_BODY(), compute_secret(), hmacmd5_fromdns(), hmacmd5_sign(), hmacmd5_verify(), isc_hmacmd5_sign(), isc_hmacmd5_verify(), isc_hmacmd5_verify2(), sign(), and verify().
ISC_LANG_BEGINDECLS void isc_md5_init | ( | isc_md5_t * | ctx | ) |
Start MD5 accumulation. Set bit count to 0 and buffer to mysterious initialization constants.
Definition at line 138 of file md5.c.
References isc_md5_t::buf, and isc_md5_t::bytes.
Referenced by ATF_TC_BODY(), compute_secret(), hmacmd5_fromdns(), isc_hmacmd5_init(), and isc_hmacmd5_sign().
void isc_md5_invalidate | ( | isc_md5_t * | ctx | ) |
void isc_md5_update | ( | isc_md5_t * | ctx, | |
const unsigned char * | buf, | |||
unsigned int | len | |||
) |
Update context to reflect the concatenation of another buffer full of bytes.
Definition at line 260 of file md5.c.
References isc_md5_t::buf, isc_md5_t::bytes, byteSwap(), isc_md5_t::in, and transform().
Referenced by ATF_TC_BODY(), compute_secret(), hmacmd5_fromdns(), isc_hmacmd5_init(), isc_hmacmd5_sign(), and isc_hmacmd5_update().
void isc_md5_final | ( | isc_md5_t * | ctx, | |
unsigned char * | digest | |||
) |
Final wrapup - pad to 64-byte boundary with the bit pattern 1 0* (64-bit count of bits processed, MSB-first)
Definition at line 299 of file md5.c.
References isc_md5_t::buf, isc_md5_t::bytes, byteSwap(), isc_md5_t::in, and transform().
Referenced by ATF_TC_BODY(), compute_secret(), hmacmd5_fromdns(), isc_hmacmd5_init(), and isc_hmacmd5_sign().