1 /* MDDRIVER.C - test driver for MD2, MD4 and MD5
2 * $FreeBSD: src/lib/libmd/mddriver.c,v 1.7 2001/09/30 21:56:22 dillon Exp $
3 * $DragonFly: src/lib/libmd/mddriver.c,v 1.3 2008/09/11 20:25:34 swildner Exp $
6 /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
9 RSA Data Security, Inc. makes no representations concerning either
10 the merchantability of this software or the suitability of this
11 software for any particular purpose. It is provided "as is"
12 without express or implied warranty of any kind.
14 These notices must be retained in any copies of any part of this
15 documentation and/or software.
18 /* The following makes MD default to MD5 if it has not already been
19 defined with C compiler flags.
25 #include <sys/types.h>
32 #define MDData MD2Data
36 #define MDData MD4Data
40 #define MDData MD5Data
43 /* Digests a string and prints the result.
45 static void MDString (string
)
50 printf ("MD%d (\"%s\") = %s\n",
51 MD
, string
, MDData(string
,strlen(string
),buf
));
54 /* Digests a reference suite of strings and prints the results.
58 printf ("MD%d test suite:\n", MD
);
63 MDString ("message digest");
64 MDString ("abcdefghijklmnopqrstuvwxyz");
66 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
68 ("1234567890123456789012345678901234567890\
69 1234567890123456789012345678901234567890");