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