mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Update.
2001-12-13 Ulrich Drepper <drepper@redhat.com> * crypt/md5.c (md5_process_bytes): Correct handling of alignment. Patch by Eric Sharkey <sharkey@netrics.com>. * crypt/md5test.c (main): Add test for multiple calls to __md5_process_bytes to itererate over input string.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user