From: Eric S. Raymond Date: Tue, 16 Sep 2003 05:29:46 +0000 (+0000) Subject: Actuall use the custom hash. X-Git-Tag: 2.0~55 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=14ac5496c6bdab7e7abaf8f533634b5118c3c681;p=comparator.git Actuall use the custom hash. --- 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)