2 ** Copyright 1998 - 2000 Double Precision, Inc.
3 ** See COPYING for distribution information.
12 static const char * const teststr
[]={
17 "abcdefghijklmnopqrstuvwxyz",
18 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
19 "12345678901234567890123456789012345678901234567890123456789012345678901234567890"};
21 char *salts
[4]={"abcdef","01234567","76543210","QWERTY"};
22 char *passwds
[4]={ "rosebud",
25 "for the world is hollow, and I have touched the sky"};
29 printf("MD5 test suite:\n");
30 for (i
=0; i
<(int)sizeof(teststr
)/sizeof(teststr
[0]); i
++)
34 md5_digest(teststr
[i
], strlen(teststr
[i
]), digest
);
36 printf("MD5 (\"%s\") = ", teststr
[i
]);
37 for (j
=0; j
<sizeof(digest
); j
++)
38 printf("%02x", digest
[j
]);
41 for (i
=0; i
<sizeof(salts
)/sizeof(salts
[0]); i
++)
42 printf("Salt: %s\nPassword: %s\nHash:%s\n\n",
44 md5_crypt_redhat(passwds
[i
], salts
[i
]));