#include <sys/cdefs.h>
__FBSDID("$FreeBSD: src/lib/libmd/shadriver.c,v 1.4 2005/03/09 19:23:04 cperciva Exp $");
#ifndef SHA_VERSION
#define SHA_VERSION 1
#endif
#include <sys/types.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include "sha.h"
#if SHA_VERSION == 1
#define SHA_Data SHA1_Data
#endif
static void SHAString (string)
char *string;
{
char buf[2*32+1];
printf ("SHA-%d (\"%s\") = %s\n",
SHA_VERSION, string, SHA_Data(string,strlen(string),buf));
}
main()
{
printf ("SHA-%d test suite:\n", SHA_VERSION);
SHAString ("");
SHAString ("abc");
SHAString ("message digest");
SHAString ("abcdefghijklmnopqrstuvwxyz");
SHAString
("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
SHAString
("1234567890123456789012345678901234567890\
1234567890123456789012345678901234567890");
return 0;
}