diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-14 10:16:33 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2005-01-14 10:16:33 +0000 |
commit | 37b51a9aa6d5d0fb97bad0d1a27d27304da277c2 (patch) | |
tree | c36e5222b076ba6ba42423a97dccaf272fb087fa /src/libutil/md5.c | |
parent | 7e8961f72056f53ccf78eba0ee8c240bc2310ab8 (diff) |
* Removed some dead code.
Diffstat (limited to 'src/libutil/md5.c')
-rw-r--r-- | src/libutil/md5.c | 83 |
1 files changed, 0 insertions, 83 deletions
diff --git a/src/libutil/md5.c b/src/libutil/md5.c index fa67ebfcd..fe1ecdddb 100644 --- a/src/libutil/md5.c +++ b/src/libutil/md5.c @@ -20,10 +20,6 @@ /* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. */ -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - #include <sys/types.h> #include <stdlib.h> @@ -123,85 +119,6 @@ md5_finish_ctx (ctx, resbuf) return md5_read_ctx (ctx, resbuf); } -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -int -md5_stream (stream, resblock) - FILE *stream; - void *resblock; -{ - /* Important: BLOCKSIZE must be a multiple of 64. */ -#define BLOCKSIZE 4096 - struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; - size_t sum; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Iterate over full file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - computation function processes the whole buffer so that with the - next round of the loop another block can be read. */ - size_t n; - sum = 0; - - /* Read block. Take care for partial reads. */ - do - { - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); - - sum += n; - } - while (sum < BLOCKSIZE && n != 0); - if (n == 0 && ferror (stream)) - return 1; - - /* If end of file is reached, end the loop. */ - if (n == 0) - break; - - /* Process buffer with BLOCKSIZE bytes. Note that - BLOCKSIZE % 64 == 0 - */ - md5_process_block (buffer, BLOCKSIZE, &ctx); - } - - /* Add the last bytes if necessary. */ - if (sum > 0) - md5_process_bytes (buffer, sum, &ctx); - - /* Construct result in desired memory. */ - md5_finish_ctx (&ctx, resblock); - return 0; -} - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - 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; -{ - struct md5_ctx ctx; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Process whole buffer but last len % 64 bytes. */ - md5_process_bytes (buffer, len, &ctx); - - /* Put result in desired memory area. */ - return md5_finish_ctx (&ctx, resblock); -} - - void md5_process_bytes (buffer, len, ctx) const void *buffer; |