diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-01-14 18:03:54 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-01-14 18:03:54 +0000 |
commit | 570a36436c07e1baa10c69fb153dff266606c405 (patch) | |
tree | df74f6010b42a4c95c8ff57c9963bd1cf6c58c1f /wsutil/md5.c | |
parent | 7a559d2876d0d9a9b5da411c8878561a399864d3 (diff) |
Consistently use "guint8" for "8-bit byte".
Constify.
For routines that manipulate sequences of 8-bit bytes, have them take
guint8 pointers rather than void pointers.
Don't cast away constness.
svn path=/trunk/; revision=54795
Diffstat (limited to 'wsutil/md5.c')
-rw-r--r-- | wsutil/md5.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wsutil/md5.c b/wsutil/md5.c index 5050a7fdde..2cc2cb3568 100644 --- a/wsutil/md5.c +++ b/wsutil/md5.c @@ -93,7 +93,7 @@ void md5_init(md5_state_t *ctx) * Update context to reflect the concatenation of another buffer full * of bytes. */ -void md5_append( md5_state_t *ctx, unsigned char const *buf, size_t len) +void md5_append( md5_state_t *ctx, const guint8 *buf, size_t len) { guint32 t; @@ -109,7 +109,7 @@ void md5_append( md5_state_t *ctx, unsigned char const *buf, size_t len) /* Handle any leading odd-sized chunks */ if (t) { - unsigned char *p = (unsigned char *) ctx->in + t; + guint8 *p = (guint8 *) ctx->in + t; t = 64 - t; if (len < t) { @@ -141,17 +141,17 @@ void md5_append( md5_state_t *ctx, unsigned char const *buf, size_t len) * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ -void md5_finish(md5_state_t *ctx, unsigned char digest[16]) +void md5_finish(md5_state_t *ctx, guint8 digest[16]) { guint count; - unsigned char *p; + guint8 *p; /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ - p = (unsigned char *) ctx->in + count; + p = (guint8 *) ctx->in + count; *p++ = 0x80; /* Bytes of padding needed to make 64 bytes */ |