1220496Smarkm/* RIPEMD160DRIVER.C - test driver for RIPEMD160 */ 244301Swollman 3220496Smarkm/* Copyright (C) 1990-2, RSA Data Security, Inc. Created 1990. All rights 4220496Smarkm * reserved. 5220496Smarkm * 6220496Smarkm * RSA Data Security, Inc. makes no representations concerning either the 7220496Smarkm * merchantability of this software or the suitability of this software for 8220496Smarkm * any particular purpose. It is provided "as is" without express or implied 9220496Smarkm * warranty of any kind. 10220496Smarkm * 11220496Smarkm * These notices must be retained in any copies of any part of this 12220496Smarkm * documentation and/or software. */ 13220496Smarkm 1484211Sdillon#include <sys/cdefs.h> 1584211Sdillon__FBSDID("$FreeBSD$"); 1684211Sdillon 1744301Swollman#include <sys/types.h> 1844301Swollman 1944301Swollman#include <stdio.h> 2044301Swollman#include <time.h> 2144301Swollman#include <string.h> 22220496Smarkm 2344301Swollman#include "ripemd.h" 2444301Swollman 25220496Smarkm/* Digests a string and prints the result. */ 26220496Smarkmstatic void 27220496SmarkmRIPEMD160String(char *string) 2844301Swollman{ 29220496Smarkm char buf[2*20 + 1]; 3044301Swollman 31220496Smarkm printf("RIPEMD160 (\"%s\") = %s\n", 32220496Smarkm string, RIPEMD160_Data(string, strlen(string), buf)); 3344301Swollman} 3444301Swollman 35220496Smarkm/* Digests a reference suite of strings and prints the results. */ 36220496Smarkmint 37220496Smarkmmain(void) 3844301Swollman{ 39220496Smarkm printf("RIPEMD160 test suite:\n"); 4044301Swollman 41220496Smarkm RIPEMD160String(""); 42220496Smarkm RIPEMD160String("abc"); 43220496Smarkm RIPEMD160String("message digest"); 44220496Smarkm RIPEMD160String("abcdefghijklmnopqrstuvwxyz"); 45220496Smarkm RIPEMD160String("ABCDEFGHIJKLMNOPQRSTUVWXYZ" 46220496Smarkm "abcdefghijklmnopqrstuvwxyz0123456789"); 47220496Smarkm RIPEMD160String("1234567890123456789012345678901234567890" 48220496Smarkm "1234567890123456789012345678901234567890"); 49220496Smarkm 50220496Smarkm return 0; 5144301Swollman} 52