Initial import from FreeBSD RELENG_4:
[games.git] / lib / libmd / rmddriver.c
1 /* RIPEMD160DRIVER.C - test driver for RIPEMD160
2  * $FreeBSD: src/lib/libmd/rmddriver.c,v 1.2 1999/08/28 00:05:08 peter Exp $
3  */
4
5 /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
6    rights reserved.
7
8    RSA Data Security, Inc. makes no representations concerning either
9    the merchantability of this software or the suitability of this
10    software for any particular purpose. It is provided "as is"
11    without express or implied warranty of any kind.
12
13    These notices must be retained in any copies of any part of this
14    documentation and/or software.
15  */
16
17 #include <sys/types.h>
18
19 #include <stdio.h>
20 #include <time.h>
21 #include <string.h>
22 #include "ripemd.h"
23
24 /* Digests a string and prints the result.
25  */
26 static void RIPEMD160String (string)
27 char *string;
28 {
29   char buf[2*20+1];
30
31   printf ("RIPEMD160 (\"%s\") = %s\n", 
32         string, RIPEMD160_Data(string,strlen(string),buf));
33 }
34
35 /* Digests a reference suite of strings and prints the results.
36  */
37 main()
38 {
39   printf ("RIPEMD160 test suite:\n");
40
41   RIPEMD160String ("");
42   RIPEMD160String ("abc");
43   RIPEMD160String ("message digest");
44   RIPEMD160String ("abcdefghijklmnopqrstuvwxyz");
45   RIPEMD160String
46     ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
47   RIPEMD160String
48     ("1234567890123456789012345678901234567890\
49 1234567890123456789012345678901234567890");
50   return 0;
51 }