From 14ac5496c6bdab7e7abaf8f533634b5118c3c681 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Tue, 16 Sep 2003 05:29:46 +0000 Subject: [PATCH] Actuall use the custom hash. --- shredtree.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/shredtree.c b/shredtree.c index 410d6c7..8c1e701 100644 --- a/shredtree.c +++ b/shredtree.c @@ -7,7 +7,6 @@ #include #include #include -#include "md5.h" #include "shred.h" /* control bits, meant to be set at startup */ @@ -130,12 +129,11 @@ shred; static struct hash_t emit_chunk(shred *display, int linecount) /* emit chunk corresponding to current display */ { - struct md5_ctx ctx; int i, firstline; struct hash_t out; /* build completed chunk onto end of array */ - md5_init_ctx(&ctx); + hash_init(); if (debug) fprintf(stderr, "Chunk:\n"); for (i = 0; i < shredsize; i++) @@ -143,9 +141,9 @@ static struct hash_t emit_chunk(shred *display, int linecount) { if (debug) fprintf(stderr, "%d: '%s'\n", i, display[i].line); - md5_process_bytes(display[i].line, strlen(display[i].line), &ctx); + hash_update(display[i].line, strlen(display[i].line)); } - md5_finish_ctx(&ctx, (void *)&out.hash); + hash_complete(&out.hash); firstline = shredsize; for (i = shredsize - 1; i >= 0; i--) if (display[i].line) -- 2.43.0