xref: /plan9/sys/src/cmd/unix/drawterm/libsec/md4test.c (revision 8ccd4a6360d974db7bd7bbd4f37e7018419ea908)
1 #include "os.h"
2 #include <mp.h>
3 #include <libsec.h>
4 
5 char *tests[] = {
6 	"",
7 	"a",
8 	"abc",
9 	"message digest",
10 	"abcdefghijklmnopqrstuvwxyz",
11 	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
12 	"12345678901234567890123456789012345678901234567890123456789012345678901234567890",
13 	0
14 };
15 
16 void
main(void)17 main(void)
18 {
19 	char **pp;
20 	uchar *p;
21 	int i;
22 	uchar digest[MD5dlen];
23 
24 	for(pp = tests; *pp; pp++){
25 		p = (uchar*)*pp;
26 		md4(p, strlen(*pp), digest, 0);
27 		for(i = 0; i < MD5dlen; i++)
28 			print("%2.2ux", digest[i]);
29 		print("\n");
30 	}
31 }
32