File: sha.h

package info (click to toggle)
tcltrf 2.1.4-dfsg3-2
  • links: PTS
  • area: main
  • in suites: buster, stretch
  • size: 9,652 kB
  • ctags: 9,400
  • sloc: ansic: 73,138; sh: 3,155; tcl: 1,343; makefile: 182; exp: 22
file content (41 lines) | stat: -rw-r--r-- 909 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef SHA_H
#define SHA_H

#include <tcl.h>

/* NIST Secure Hash Algorithm */
/* heavily modified from Peter C. Gutmann's implementation */

/* Useful defines & typedefs */

#ifndef _WIN32
typedef unsigned char BYTE;
#endif
#if defined(__alpha) || defined(__LP64__)
typedef unsigned int  UINT32;
#else
#ifndef UINT32
#ifdef _WIN32
#	pragma warning ( disable : 4142 )
#endif
typedef unsigned long UINT32;
#endif
#endif


#define SHA_BLOCKSIZE		64
#define SHA_DIGESTSIZE		20

typedef struct {
    UINT32 digest[5];		/* message digest */
    UINT32 count_lo, count_hi;	/* 64-bit bit count */
    UINT32 data[16];		/* SHA data buffer */
} SHA_INFO;

void sha_init   _ANSI_ARGS_ ((SHA_INFO *));
void sha_update _ANSI_ARGS_ ((SHA_INFO *, BYTE *, int));
void sha_final  _ANSI_ARGS_ ((SHA_INFO *));
void sha_stream _ANSI_ARGS_ ((SHA_INFO *, FILE *));
void sha_print  _ANSI_ARGS_ ((SHA_INFO *));

#endif /* SHA_H */