1 /* --------------------------------- SHS.H ------------------------------- */
4 * NIST proposed Secure Hash Standard.
6 * Written 2 September 1992, Peter C. Gutmann.
7 * This implementation placed in the public domain.
9 * Comments to pgut1@cs.aukuni.ac.nz
12 /* Useful defines/typedefs */
19 # include <inttypes.h>
24 typedef unsigned int uint8_t __attribute__((mode(QI
)));
25 /* This is a blatant hack: on Solaris 2.5, pthread.h defines uint32_t
26 in pthread.h, which we sometimes include. We protect our
27 definition the same way Solaris 2.5 does, to avoid redefining it. */
29 typedef unsigned int uint32_t __attribute__((mode(SI
)));
36 /* The SHS block size and message digest sizes, in bytes */
38 #define SHS_BLOCKSIZE 64
39 #define SHS_DIGESTSIZE 20
41 /* The structure for storing SHS info */
44 uint32_t digest
[5]; /* Message digest */
45 uint32_t countLo
, countHi
; /* 64-bit bit count */
46 uint32_t data
[16]; /* SHS data buffer */
49 /* Turn off prototypes if requested */
50 #if (defined(NOPROTO) && defined(PROTO))
54 /* Used to remove arguments in function prototypes for non-ANSI C */
63 void shsInit
OF((SHS_INFO
*shsInfo
));
64 void shsUpdate
OF((SHS_INFO
*shsInfo
, uint8_t *buffer
, int count
));
65 void shsFinal
OF((SHS_INFO
*shsInfo
));