1#ifndef SHA_H
2#define SHA_H
3
4#include <tcl.h>
5
6/* NIST Secure Hash Algorithm */
7/* heavily modified from Peter C. Gutmann's implementation */
8
9/* Useful defines & typedefs */
10
11#ifndef _WIN32
12typedef unsigned char BYTE;
13#endif
14#if defined(__alpha) || defined(__LP64__)
15typedef unsigned int  UINT32;
16#else
17#ifndef UINT32
18#ifdef _WIN32
19#	pragma warning ( disable : 4142 )
20#endif
21typedef unsigned long UINT32;
22#endif
23#endif
24
25
26#define SHA_BLOCKSIZE		64
27#define SHA_DIGESTSIZE		20
28
29typedef struct {
30    UINT32 digest[5];		/* message digest */
31    UINT32 count_lo, count_hi;	/* 64-bit bit count */
32    UINT32 data[16];		/* SHA data buffer */
33} SHA_INFO;
34
35void sha_init   _ANSI_ARGS_ ((SHA_INFO *));
36void sha_update _ANSI_ARGS_ ((SHA_INFO *, BYTE *, int));
37void sha_final  _ANSI_ARGS_ ((SHA_INFO *));
38void sha_stream _ANSI_ARGS_ ((SHA_INFO *, FILE *));
39void sha_print  _ANSI_ARGS_ ((SHA_INFO *));
40
41#endif /* SHA_H */
42