diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | camel/md5-utils.c | 59 | ||||
-rw-r--r-- | camel/md5-utils.h | 2 | ||||
-rw-r--r-- | camel/providers/MH/mh-uid.c | 2 |
4 files changed, 62 insertions, 10 deletions
@@ -1,5 +1,14 @@ 1999-09-07 bertrand <Bertrand.Guiheneuf@aful.org> + * camel/md5-utils.c + Documented all funcs. + + (md5_get_digest_from_stream): + correct typo. + (md5_get_digest_from_file): + same typo corrected. + + * camel/md5-utils.h : raw routines are declared public now. Md5 use has to be versatile. diff --git a/camel/md5-utils.c b/camel/md5-utils.c index 30a750b12b..4696905176 100644 --- a/camel/md5-utils.c +++ b/camel/md5-utils.c @@ -49,10 +49,13 @@ _byte_reverse (guchar *buf, guint32 longs) } while (--longs); } -/* - * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious - * initialization constants. - */ +/** + * md5_init: Initialise an md5 context object + * @ctx: md5 context + * + * Initialise an md5 buffer. + * + **/ void md5_init (MD5Context *ctx) { @@ -71,10 +74,16 @@ md5_init (MD5Context *ctx) } -/* + +/** + * md5_update: add a buffer to md5 hash computation + * @ctx: conetxt object used for md5 computaion + * @buf: buffer to add + * @len: buffer length + * * Update context to reflect the concatenation of another buffer full - * of bytes. - */ + * of bytes. Use this to progressively construct an md5 hash. + **/ void md5_update (MD5Context *ctx, const guchar *buf, guint32 len) { @@ -130,6 +139,13 @@ md5_update (MD5Context *ctx, const guchar *buf, guint32 len) * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ +/** + * md5_final: copy the final md5 hash to a bufer + * @digest: 16 bytes buffer + * @ctx: context containing the calculated md5 + * + * copy the final md5 hash to a bufer + **/ void md5_final (guchar digest[16], MD5Context *ctx) { @@ -282,6 +298,15 @@ md5_transform (guint32 buf[4], const guint32 in[16]) +/** + * md5_get_digest: get the md5 hash of a buffer + * @buffer: byte buffer + * @buffer_size: buffer size (in bytes) + * @digest: 16 bytes buffer receiving the hash code. + * + * Get the md5 hash of a buffer. The result is put in + * the 16 bytes buffer @digest . + **/ void md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16]) { @@ -294,8 +319,16 @@ md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16]) } +/** + * md5_get_digest_from_stream: get the md5 hash of a stream + * @stream: stream + * @digest: 16 bytes buffer receiving the hash code. + * + * Get the md5 hash of a stream. The result is put in + * the 16 bytes buffer @digest . + **/ void -md5_get_digest_from_stream (CamelStream *stream, gint buffer_size, guchar digest[16]) +md5_get_digest_from_stream (CamelStream *stream, guchar digest[16]) { MD5Context ctx; guchar tmp_buf[1024]; @@ -316,8 +349,16 @@ md5_get_digest_from_stream (CamelStream *stream, gint buffer_size, guchar digest +/** + * md5_get_digest_from_file: get the md5 hash of a file + * @filename: file name + * @digest: 16 bytes buffer receiving the hash code. + * + * Get the md5 hash of a file. The result is put in + * the 16 bytes buffer @digest . + **/ void -md5_get_digest_from_file (gchar *filename, gint buffer_size, guchar digest[16]) +md5_get_digest_from_file (gchar *filename, guchar digest[16]) { MD5Context ctx; guchar tmp_buf[1024]; diff --git a/camel/md5-utils.h b/camel/md5-utils.h index 55dc5229d9..da5accbd5b 100644 --- a/camel/md5-utils.h +++ b/camel/md5-utils.h @@ -39,7 +39,7 @@ typedef struct { void md5_get_digest (const gchar *buffer, gint buffer_size, guchar digest[16]); -void md5_get_digest_from_stream (CamelStream *stream, gint buffer_size, guchar digest[16]); +void md5_get_digest_from_stream (CamelStream *stream, guchar digest[16]); /* use this one when speed is needed */ /* for use in provider code only */ diff --git a/camel/providers/MH/mh-uid.c b/camel/providers/MH/mh-uid.c index d830a8f349..8c777accaa 100644 --- a/camel/providers/MH/mh-uid.c +++ b/camel/providers/MH/mh-uid.c @@ -66,3 +66,5 @@ mh_uid_get_for_file (gchar *filename) return md5_digest_uid; } + + |