1 /* MDDRIVER.C - test driver for MD2, MD4 and MD5
7 /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
10 RSA Data Security, Inc. makes no representations concerning either
11 the merchantability of this software or the suitability of this
12 software for any particular purpose. It is provided "as is"
13 without express or implied warranty of any kind.
15 These notices must be retained in any copies of any part of this
16 documentation and/or software.
19 /* The following makes MD default to MD5 if it has not already been
20 defined with C compiler flags.
26 #include <sys/types.h>
33 #define MDData MD2Data
37 #define MDData MD4Data
41 #define MDData MD5Data
44 /* Digests a string and prints the result.
46 static void MDString (string)
51 printf ("MD%d (\"%s\") = %s\n",
52 MD, string, MDData(string,strlen(string),buf));
55 /* Digests a reference suite of strings and prints the results.
59 printf ("MD%d test suite:\n", MD);
64 MDString ("message digest");
65 MDString ("abcdefghijklmnopqrstuvwxyz");
67 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
69 ("1234567890123456789012345678901234567890\
70 1234567890123456789012345678901234567890");