From 0838e0b9265a9ec55d1a11fa3f32616ec7dbf74c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 14 Dec 2001 06:33:57 +0000 Subject: Update. 2001-12-13 Ulrich Drepper * crypt/md5.c (md5_process_bytes): Correct handling of alignment. Patch by Eric Sharkey . * crypt/md5test.c (main): Add test for multiple calls to __md5_process_bytes to itererate over input string. --- crypt/md5test.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crypt/md5test.c') diff --git a/crypt/md5test.c b/crypt/md5test.c index cfd9605099..5397e5ac61 100644 --- a/crypt/md5test.c +++ b/crypt/md5test.c @@ -35,10 +35,19 @@ main (int argc, char *argv[]) for (cnt = 0; cnt < (int) (sizeof (tests) / sizeof (tests[0])); ++cnt) { + int i; + int j; + __md5_init_ctx (&ctx); __md5_process_bytes (tests[cnt].input, strlen (tests[cnt].input), &ctx); __md5_finish_ctx (&ctx, sum); result |= memcmp (tests[cnt].result, sum, 16); + + __md5_init_ctx (&ctx); + for (i = 0; tests[cnt].input[i] != '\0'; ++i) + __md5_process_bytes (&tests[cnt].input[i], 1, &ctx); + __md5_finish_ctx (&ctx, sum); + result |= memcmp (tests[cnt].result, sum, 16); } return result; -- cgit v1.2.3