annotate src/md5-util.h @ 1727:68b791050958

fixed toggle_slideshow function https://sourceforge.net/tracker/index.php?func=detail&aid=2844302&group_id=222125&atid=1054680
author nadvornik
date Thu, 27 Aug 2009 20:23:28 +0000
parents 51d70f62338c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
1 /*
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
2 * This code implements the MD5 message-digest algorithm.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
3 * The algorithm is due to Ron Rivest. This code was
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
4 * written by Colin Plumb in 1993, no copyright is claimed.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
5 * This code is in the public domain; do with it what you wish.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
6 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
7 * Equivalent code is available from RSA Data Security, Inc.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
8 * This code has been tested against that, and is equivalent,
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
9 * except that you don't need to include two pages of legalese
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
10 * with every copy.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
11 *
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
12 * To compute the message digest of a chunk of bytes, declare an
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
13 * MD5Context structure, pass it to rpmMD5Init, call rpmMD5Update as
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
14 * needed on buffers full of bytes, and then call rpmMD5Final, which
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
15 * will fill a supplied 16-byte array with the digest.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
16 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
17
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
18 /* parts of this file are :
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
19 * Written March 1993 by Branko Lankester
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
20 * Modified June 1993 by Colin Plumb for altered md5.c.
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
21 * Modified October 1995 by Erik Troan for RPM
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
22 */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
23
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
24
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
25 #ifndef MD5_UTIL_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
26 #define MD5_UTIL_H
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
27
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
28 #include <glib.h>
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
29
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
30
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
31 typedef struct _MD5Context {
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
32 guint32 buf[4];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
33 guint32 bits[2];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
34 guchar in[64];
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
35 gint doByteReverse;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
36 } MD5Context;
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
37
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
38
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
39 /* raw routines */
1346
c9949c19a6d0 No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents: 1055
diff changeset
40 void md5_init(MD5Context *ctx);
c9949c19a6d0 No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents: 1055
diff changeset
41 void md5_update(MD5Context *ctx, const guchar *buf, guint32 len);
c9949c19a6d0 No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents: 1055
diff changeset
42 void md5_final(MD5Context *ctx, guchar digest[16]);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
43
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
44 /* generate digest from memory buffer */
1346
c9949c19a6d0 No space between function name and first parenthesis, it eases greping (see CODING).
zas_
parents: 1055
diff changeset
45 void md5_get_digest(const guchar *buffer, gint buffer_size, guchar digest[16]);
9
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
46
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
47 /* generate digest from file */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
48 gboolean md5_get_digest_from_file(const gchar *path, guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
49
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
50 /* convert digest to/from a NULL terminated text string, in ascii encoding */
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
51 gchar *md5_digest_to_text(guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
52 gboolean md5_digest_from_text(const gchar *text, guchar digest[16]);
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
53
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
54
d907d608745f Sync to GQview 1.5.9 release.
gqview
parents:
diff changeset
55 #endif /* MD5_UTILS_H */
1055
1646720364cf Adding a vim modeline to all files - patch by Klaus Ethgen
nadvornik
parents: 446
diff changeset
56 /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */