diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-12-14 06:33:57 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-12-14 06:33:57 +0000 |
commit | 0838e0b9265a9ec55d1a11fa3f32616ec7dbf74c (patch) | |
tree | 8ac383e28a651068af6baf20d618568ed6581081 /crypt/md5test.c | |
parent | 7afc594790a145ba485198e76baa2e984f704f81 (diff) | |
download | glibc-0838e0b9265a9ec55d1a11fa3f32616ec7dbf74c.zip glibc-0838e0b9265a9ec55d1a11fa3f32616ec7dbf74c.tar.gz glibc-0838e0b9265a9ec55d1a11fa3f32616ec7dbf74c.tar.bz2 |
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.
Diffstat (limited to 'crypt/md5test.c')
-rw-r--r-- | crypt/md5test.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/crypt/md5test.c b/crypt/md5test.c index cfd9605..5397e5a 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; |