diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/md/md4c.c | 24 | ||||
-rw-r--r-- | lib/libc/md/md5c.c | 26 |
2 files changed, 28 insertions, 22 deletions
diff --git a/lib/libc/md/md4c.c b/lib/libc/md/md4c.c index 4f3f9a7a815..6b00340c08b 100644 --- a/lib/libc/md/md4c.c +++ b/lib/libc/md/md4c.c @@ -22,7 +22,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md4c.c,v 1.5 1996/11/24 02:25:58 niklas Exp $"; +static char rcsid[] = "$OpenBSD: md4c.c,v 1.6 1996/12/04 02:31:56 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <string.h> @@ -53,10 +53,8 @@ static void MD4Transform __P ((u_int32_t [4], const unsigned char [64])); #define Encode memcpy #define Decode memcpy #else /* BIG_ENDIAN */ -static void Encode __P - ((unsigned char *, u_int32_t *, size_t)); -static void Decode __P - ((u_int32_t *, const unsigned char *, size_t)); +static void Encode __P ((void *, void *, size_t)); +static void Decode __P ((void *, const void *, size_t)); #endif /* LITTLE_ENDIAN */ static unsigned char PADDING[64] = { @@ -94,11 +92,13 @@ static unsigned char PADDING[64] = { /* Encodes input (u_int32_t) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -u_int32_t *input; +static void Encode (out, in, len) +void *out; +void *in; size_t len; { + u_int32_t *input = in; + unsigned char *output = out; size_t i, j; for (i = 0, j = 0; j < len; i++, j += 4) { @@ -112,11 +112,13 @@ size_t len; /* Decodes input (unsigned char) into output (u_int32_t). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) -u_int32_t *output; -const unsigned char *input; +static void Decode (out, in, len) +void *out; +const void *in; size_t len; { + u_int32_t *output = out; + const unsigned char *input = in; size_t i, j; for (i = 0, j = 0; j < len; i++, j += 4) diff --git a/lib/libc/md/md5c.c b/lib/libc/md/md5c.c index 0a831fd5e0a..b32990aa1e9 100644 --- a/lib/libc/md/md5c.c +++ b/lib/libc/md/md5c.c @@ -23,7 +23,7 @@ documentation and/or software. */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: md5c.c,v 1.5 1996/11/24 02:25:58 niklas Exp $"; +static char rcsid[] = "$OpenBSD: md5c.c,v 1.6 1996/12/04 02:31:57 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <string.h> @@ -58,8 +58,8 @@ static void MD5Transform __P ((u_int32_t [4], const unsigned char [64])); #define Encode memcpy #define Decode memcpy #else /* BIG_ENDIAN */ -static void Encode __P((unsigned char *, u_int32_t *, size_t)); -static void Decode __P((u_int32_t *, const unsigned char *, size_t)); +static void Encode __P((void *, void *, size_t)); +static void Decode __P((void *, const void *, size_t)); #endif /* LITTLE_ENDIAN */ static unsigned char PADDING[64] = { @@ -107,12 +107,14 @@ Rotation is separate from addition to prevent recomputation. /* Encodes input (u_int32_t) into output (unsigned char). Assumes len is a multiple of 4. */ -static void Encode (output, input, len) -unsigned char *output; -u_int32_t *input; +static void Encode (in, out, len) +void *out; +void *in; size_t len; { - unsigned size_t i, j; + unsigned char *output = out; + size_t i, j; + u_int32_t *input = in; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); @@ -125,12 +127,14 @@ size_t len; /* Decodes input (unsigned char) into output (u_int32_t). Assumes len is a multiple of 4. */ -static void Decode (output, input, len) -u_int32_t *output; -const unsigned char *input; +static void Decode (out, in, len) +void *out; +const void *in; size_t len; { - size_t int i, j; + u_int32_t *output = out; + const unsigned char *input = in; + size_t i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((u_int32_t)input[j]) | (((u_int32_t)input[j+1]) << 8) | |