blob: 5d7a339c8c47978f7a5b4f8e04408b7c7b50a845 [file] [log] [blame]
#ifndef SHA_H
#define SHA_H
/* NIST Secure Hash Algorithm */
/* heavily modified from Peter C. Gutmann's implementation */
/* Useful defines & typedefs */
#include <inttypes.h>
typedef unsigned char BYTE;
typedef uint32_t LONG;
#define SHA_BLOCKSIZE 64
#define SHA_DIGESTSIZE 20
typedef struct {
LONG digest[5]; /* message digest */
LONG count_lo, count_hi; /* 64-bit bit count */
LONG data[16]; /* SHA data buffer */
} SHA_INFO;
void sha_init(SHA_INFO *);
void sha_update(SHA_INFO *, BYTE *, int);
void sha_final(SHA_INFO *);
void sha_stream(SHA_INFO *, FILE *);
void sha_print(SHA_INFO *);
#endif /* SHA_H */