diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-10 08:54:26 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-10 08:54:26 +0000 |
commit | a72a98a7fb25676f64a22e55a3485baf1be984af (patch) | |
tree | c0013f9d96aba2dfef9cb09d4e182c32d5860a73 /lib | |
parent | 88be547a30395d2ca3cd7d09cc8e87b41549e7bc (diff) | |
download | coreutils-a72a98a7fb25676f64a22e55a3485baf1be984af.tar.xz |
Include "md5.h" first.
(md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
md5_buffer, md5_process_bytes, md5_process_block):
Define with prototypes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/md5.c | 33 |
1 files changed, 9 insertions, 24 deletions
@@ -24,12 +24,13 @@ # include <config.h> #endif +#include "md5.h" + #include <sys/types.h> #include <stdlib.h> #include <string.h> -#include "md5.h" #include "unlocked-io.h" #ifdef _LIBC @@ -70,8 +71,7 @@ static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; /* Initialize structure containing state of computation. (RFC 1321, 3.3: Step 3) */ void -md5_init_ctx (ctx) - struct md5_ctx *ctx; +md5_init_ctx (struct md5_ctx *ctx) { ctx->A = 0x67452301; ctx->B = 0xefcdab89; @@ -88,9 +88,7 @@ md5_init_ctx (ctx) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * -md5_read_ctx (ctx, resbuf) - const struct md5_ctx *ctx; - void *resbuf; +md5_read_ctx (const struct md5_ctx *ctx, void *resbuf) { ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); @@ -106,9 +104,7 @@ md5_read_ctx (ctx, resbuf) IMPORTANT: On some systems it is required that RESBUF is correctly aligned for a 32 bits value. */ void * -md5_finish_ctx (ctx, resbuf) - struct md5_ctx *ctx; - void *resbuf; +md5_finish_ctx (struct md5_ctx *ctx, void *resbuf) { /* Take yet unprocessed bytes into account. */ md5_uint32 bytes = ctx->buflen; @@ -137,9 +133,7 @@ md5_finish_ctx (ctx, resbuf) resulting message digest number will be written into the 16 bytes beginning at RESBLOCK. */ int -md5_stream (stream, resblock) - FILE *stream; - void *resblock; +md5_stream (FILE *stream, void *resblock) { struct md5_ctx ctx; char buffer[BLOCKSIZE + 72]; @@ -206,10 +200,7 @@ md5_stream (stream, resblock) output yields to the wanted ASCII representation of the message digest. */ void * -md5_buffer (buffer, len, resblock) - const char *buffer; - size_t len; - void *resblock; +md5_buffer (const char *buffer, size_t len, void *resblock) { struct md5_ctx ctx; @@ -225,10 +216,7 @@ md5_buffer (buffer, len, resblock) void -md5_process_bytes (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; +md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx) { /* When we already have some bits in our internal buffer concatenate both inputs first. */ @@ -312,10 +300,7 @@ md5_process_bytes (buffer, len, ctx) It is assumed that LEN % 64 == 0. */ void -md5_process_block (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; +md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx) { md5_uint32 correct_words[16]; const md5_uint32 *words = buffer; |