Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libmd/shadriver.c
Show All 16 Lines | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <time.h> | #include <time.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "sha.h" | #include "sha.h" | ||||
#include "sha256.h" | #include "sha256.h" | ||||
#include "sha384.h" | |||||
#include "sha512.h" | #include "sha512.h" | ||||
/* The following makes SHA default to SHA-1 if it has not already been | /* The following makes SHA default to SHA-1 if it has not already been | ||||
* defined with C compiler flags. */ | * defined with C compiler flags. */ | ||||
#ifndef SHA | #ifndef SHA | ||||
#define SHA 1 | #define SHA 1 | ||||
#endif | #endif | ||||
#if SHA == 1 | #if SHA == 1 | ||||
#undef SHA_Data | #undef SHA_Data | ||||
#define SHA_Data SHA1_Data | #define SHA_Data SHA1_Data | ||||
#elif SHA == 256 | #elif SHA == 256 | ||||
#undef SHA_Data | #undef SHA_Data | ||||
#define SHA_Data SHA256_Data | #define SHA_Data SHA256_Data | ||||
#elif SHA == 384 | |||||
#undef SHA_Data | |||||
#define SHA_Data SHA384_Data | |||||
#elif SHA == 512 | #elif SHA == 512 | ||||
#undef SHA_Data | #undef SHA_Data | ||||
#define SHA_Data SHA512_Data | #define SHA_Data SHA512_Data | ||||
#endif | #endif | ||||
/* Digests a string and prints the result. */ | /* Digests a string and prints the result. */ | ||||
static void | static void | ||||
SHAString(char *string) | SHAString(char *string) | ||||
Show All 24 Lines |