diff options
author | Geoff Keating <geoffk@cygnus.com> | 2000-03-04 00:47:31 +0000 |
---|---|---|
committer | Geoff Keating <geoffk@cygnus.com> | 2000-03-04 00:47:31 +0000 |
commit | b11f59548803413101b72d28f42cbe997d64a144 (patch) | |
tree | 4898a19a9169c9cedd0250e0e7590dbc6058b189 /crypt/md5test.c | |
parent | e3d53b06cc8520c23a010909ab2f0bde93f2abfc (diff) | |
download | glibc-b11f59548803413101b72d28f42cbe997d64a144.tar glibc-b11f59548803413101b72d28f42cbe997d64a144.tar.gz glibc-b11f59548803413101b72d28f42cbe997d64a144.tar.bz2 glibc-b11f59548803413101b72d28f42cbe997d64a144.zip |
* Makeconfig (rpath-dirs): Add crypt.
(all-subdirs): Remove md5crypt.
* crypt/sysdeps/unix/crypt.c: Move to crypt/.
* crypt/sysdeps/unix/crypt-entry.c: Move to crypt/.
* sysdeps/generic/crypt-entry.c: Delete.
* crypt/sysdeps/unix/crypt.h: Move to crypt/.
* sysdeps/generic/crypt.h: Delete.
* crypt/sysdeps/unix/crypt-private.h: Move to crypt/.
* crypt/sysdeps/unix/crypt_util.c: Move to crypt/.
* crypt/sysdeps/unix/des_impl.c: Move to sunrpc/.
* sysdeps/generic/des_impl.c: Delete.
* crypt/sysdeps/unix/ufc-crypt.h: Move to crypt/.
* crypt/sysdeps: Delete.
* crypt/crypt_util.c: Don't use `patchlevel.h'.
* md5-crypt/Versions: Move to crypt/.
* md5-crypt/md5-crypt.c: Move to crypt/.
* md5-crypt/md5.c: Move to crypt/.
* md5-crypt/md5c-test.c: Move to crypt/.
* md5-crypt/md5test.c: Move to crypt/.
* md5-crypt: Delete.
* crypt/Makefile: Adjust for new structure.
2000-03-03 Geoff Keating <geoffk@cygnus.com>
* Makeconfig (rpath-dirs): Add crypt.
(all-subdirs): Remove md5crypt.
* crypt/sysdeps/unix/crypt.c: Move to crypt/.
* crypt/sysdeps/unix/crypt-entry.c: Move to crypt/.
* sysdeps/generic/crypt-entry.c: Delete.
* crypt/sysdeps/unix/crypt.h: Move to crypt/.
* sysdeps/generic/crypt.h: Delete.
* crypt/sysdeps/unix/crypt-private.h: Move to crypt/.
* crypt/sysdeps/unix/crypt_util.c: Move to crypt/.
* crypt/sysdeps/unix/des_impl.c: Move to sunrpc/.
* sysdeps/generic/des_impl.c: Delete.
* crypt/sysdeps/unix/ufc-crypt.h: Move to crypt/.
* crypt/sysdeps: Delete.
* crypt/crypt_util.c: Don't use `patchlevel.h'.
* md5-crypt/Versions: Move to crypt/.
* md5-crypt/md5-crypt.c: Move to crypt/.
* md5-crypt/md5.c: Move to crypt/.
* md5-crypt/md5c-test.c: Move to crypt/.
* md5-crypt/md5test.c: Move to crypt/.
* md5-crypt: Delete.
* crypt/Makefile: Adjust for new structure.
Diffstat (limited to 'crypt/md5test.c')
-rw-r--r-- | crypt/md5test.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/crypt/md5test.c b/crypt/md5test.c new file mode 100644 index 0000000000..cfd9605099 --- /dev/null +++ b/crypt/md5test.c @@ -0,0 +1,45 @@ +#include <string.h> +#include "md5.h" + +static const struct +{ + const char *input; + const char result[16]; +} tests[] = + { + { "", + "\xd4\x1d\x8c\xd9\x8f\x00\xb2\x04\xe9\x80\x09\x98\xec\xf8\x42\x7e" }, + { "a", + "\x0c\xc1\x75\xb9\xc0\xf1\xb6\xa8\x31\xc3\x99\xe2\x69\x77\x26\x61" }, + { "abc", + "\x90\x01\x50\x98\x3c\xd2\x4f\xb0\xd6\x96\x3f\x7d\x28\xe1\x7f\x72" }, + { "message digest", + "\xf9\x6b\x69\x7d\x7c\xb7\x93\x8d\x52\x5a\x2f\x31\xaa\xf1\x61\xd0" }, + { "abcdefghijklmnopqrstuvwxyz", + "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1\x3b" }, + { "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", + "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d\x9f" }, + { "123456789012345678901234567890123456789012345678901234567890" + "12345678901234567890", + "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6\x7a" } + }; + + +int +main (int argc, char *argv[]) +{ + struct md5_ctx ctx; + char sum[16]; + int result = 0; + int cnt; + + for (cnt = 0; cnt < (int) (sizeof (tests) / sizeof (tests[0])); ++cnt) + { + __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); + } + + return result; +} |