7 /* those are the standard RFC 1321 test vectors */
13 "abcdefghijklmnopqrstuvwxyz",
14 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
15 "12345678901234567890123456789012345678901234567890123456789012" \
19 static char *val
[] = {
20 "d41d8cd98f00b204e9800998ecf8427e",
21 "0cc175b9c0f1b6a831c399e269772661",
22 "900150983cd24fb0d6963f7d28e17f72",
23 "f96b697d7cb7938d525a2f31aaf161d0",
24 "c3fcd3d76192e4007dfb496cca67e13b",
25 "d174ab98d277d9f5a5611c2c9f419d9f",
26 "57edf4a22be3c955ac49da2e2107b67a"
29 int main(__attribute__((unused
)) int argc
, __attribute__((unused
)) char **argv
)
34 unsigned char md5sum
[16];
36 printf("\n MD5 Validation Tests:\n\n");
38 for (i
= 0; i
< 7; i
++) {
39 printf( " Test %d ", i
+ 1 );
42 md5_update( &ctx
, (uint8
*) msg
[i
], strlen( msg
[i
] ) );
43 md5_finish( &ctx
, md5sum
);
45 for (j
= 0; j
< 16; j
++) {
46 sprintf(output
+ j
* 2, "%02x", md5sum
[j
]);
49 if (memcmp(output
, val
[i
], 32)) {