]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - lib/libmd/rmddriver.c
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / lib / libmd / rmddriver.c
1 /* RIPEMD160DRIVER.C - test driver for RIPEMD160
2  */
3
4 #include <sys/cdefs.h>
5 __FBSDID("$FreeBSD$");
6
7 /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
8    rights reserved.
9
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.
14
15    These notices must be retained in any copies of any part of this
16    documentation and/or software.
17  */
18
19 #include <sys/types.h>
20
21 #include <stdio.h>
22 #include <time.h>
23 #include <string.h>
24 #include "ripemd.h"
25
26 /* Digests a string and prints the result.
27  */
28 static void RIPEMD160String (string)
29 char *string;
30 {
31   char buf[2*20+1];
32
33   printf ("RIPEMD160 (\"%s\") = %s\n", 
34         string, RIPEMD160_Data(string,strlen(string),buf));
35 }
36
37 /* Digests a reference suite of strings and prints the results.
38  */
39 main()
40 {
41   printf ("RIPEMD160 test suite:\n");
42
43   RIPEMD160String ("");
44   RIPEMD160String ("abc");
45   RIPEMD160String ("message digest");
46   RIPEMD160String ("abcdefghijklmnopqrstuvwxyz");
47   RIPEMD160String
48     ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
49   RIPEMD160String
50     ("1234567890123456789012345678901234567890\
51 1234567890123456789012345678901234567890");
52   return 0;
53 }