1 /* SHADRIVER.C - test driver for SHA-1 (and SHA-0)
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 SHA default to SHA-1 if it has not already been
20 defined with C compiler flags.
26 #include <sys/types.h>
34 #define SHA_Data SHA1_Data
36 #define SHA_Data SHA256_Data
39 /* Digests a string and prints the result.
41 static void SHAString (string)
46 printf ("SHA-%d (\"%s\") = %s\n",
47 SHA, string, SHA_Data(string,strlen(string),buf));
50 /* Digests a reference suite of strings and prints the results.
54 printf ("SHA-%d test suite:\n", SHA);
58 SHAString ("message digest");
59 SHAString ("abcdefghijklmnopqrstuvwxyz");
61 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
63 ("1234567890123456789012345678901234567890\
64 1234567890123456789012345678901234567890");