Branching 3.2/3.3
[dragonfly.git] / lib / libmd / rmddriver.c
blob4081cf1c08622731d35a3da645c25491cbef4e18
1 /* RIPEMD160DRIVER.C - test driver for RIPEMD160
2 * $FreeBSD: src/lib/libmd/rmddriver.c,v 1.3 2001/09/30 21:56:22 dillon Exp $
3 * $DragonFly: src/lib/libmd/rmddriver.c,v 1.3 2008/09/11 20:25:34 swildner Exp $
4 */
6 /* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All
7 rights reserved.
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 #include <sys/types.h>
20 #include <stdio.h>
21 #include <time.h>
22 #include <string.h>
23 #include "ripemd.h"
25 /* Digests a string and prints the result.
27 static void RIPEMD160String (char *string)
29 char buf[2*20+1];
31 printf ("RIPEMD160 (\"%s\") = %s\n",
32 string, RIPEMD160_Data(string,strlen(string),buf));
35 /* Digests a reference suite of strings and prints the results.
37 int main(void)
39 printf ("RIPEMD160 test suite:\n");
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;