aboutsummaryrefslogtreecommitdiffstats
path: root/camel/md5-utils.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-09-07 07:27:12 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-09-07 07:27:12 +0800
commit9043c1aa7a31915129d14f913c9126557ca49402 (patch)
tree303048164217d1da978037b3a44582e55851028f /camel/md5-utils.c
parentfe269dcef34863055a9641c300c20b9760f70ab2 (diff)
downloadgsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar.gz
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar.bz2
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar.lz
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar.xz
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.tar.zst
gsoc2013-evolution-9043c1aa7a31915129d14f913c9126557ca49402.zip
camel/md5-utils.c Documented all funcs.
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. svn path=/trunk/; revision=1189
Diffstat (limited to 'camel/md5-utils.c')
-rw-r--r--camel/md5-utils.c59
1 files changed, 50 insertions, 9 deletions
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];