/***************************************************************************/
/* sha.h								   */
/*									   */
/* SHA-1 code header file.						   */
/* Taken from the public domain implementation by Peter C. Gutmann	   */
/* on 2 Sep 1992, modified by Carl Ellison to be SHA-1.			   */
/***************************************************************************/

#ifndef _SHA_H_
#define _SHA_H_

#include <stdint.h>

/* Define APG_LITTLE_ENDIAN if the machine is little-endian */

#define APG_LITTLE_ENDIAN

/* Useful defines/typedefs */

typedef uint8_t    BYTE ;
typedef uint32_t   LONG ;

/* The SHA block size and message digest sizes, in bytes */

#define SHA_BLOCKSIZE   64
#define SHA_DIGESTSIZE  20

/* The structure for storing SHA info */

typedef struct {
  LONG digest[ 5 ] ;            /* Message digest */
  LONG countLo, countHi ;       /* 64-bit bit count */
  LONG data[ 16 ] ;             /* SHA data buffer */
  LONG slop ;			/* # of bytes saved in data[] */
} apg_SHA_INFO ;

void apg_shaInit( apg_SHA_INFO *shaInfo ) ;
void apg_shaUpdate( apg_SHA_INFO *shaInfo, BYTE *buffer, int count ) ;
void apg_shaFinal( apg_SHA_INFO *shaInfo, BYTE hash[SHA_DIGESTSIZE] ) ;

#endif /* _SHA_H_ */

/***************************************************************************/
/* sha.h								   */
/*									   */
/* SHA-1 code header file.						   */
/* Taken from the public domain implementation by Peter C. Gutmann	   */
/* on 2 Sep 1992, modified by Carl Ellison to be SHA-1.			   */
/***************************************************************************/

#ifndef _SHA_H_
#define _SHA_H_

/* Define APG_LITTLE_ENDIAN if the machine is little-endian */

#define APG_LITTLE_ENDIAN

/* Useful defines/typedefs */

typedef unsigned char   BYTE ;
typedef unsigned long   LONG ;

/* The SHA block size and message digest sizes, in bytes */

#define SHA_BLOCKSIZE   64
#define SHA_DIGESTSIZE  20

/* The structure for storing SHA info */

typedef struct {
  LONG digest[ 5 ] ;            /* Message digest */
  LONG countLo, countHi ;       /* 64-bit bit count */
  LONG data[ 16 ] ;             /* SHA data buffer */
  LONG slop ;			/* # of bytes saved in data[] */
} apg_SHA_INFO ;

void apg_shaInit( apg_SHA_INFO *shaInfo ) ;
void apg_shaUpdate( apg_SHA_INFO *shaInfo, BYTE *buffer, int count ) ;
void apg_shaFinal( apg_SHA_INFO *shaInfo, BYTE hash[SHA_DIGESTSIZE] ) ;

#endif /* _SHA_H_ */

--- 
+++ 
@@ -9,14 +9,16 @@
 #ifndef _SHA_H_
 #define _SHA_H_
 
+#include <stdint.h>
+
 /* Define APG_LITTLE_ENDIAN if the machine is little-endian */
 
 #define APG_LITTLE_ENDIAN
 
 /* Useful defines/typedefs */
 
-typedef unsigned char   BYTE ;
-typedef unsigned long   LONG ;
+typedef uint8_t    BYTE ;
+typedef uint32_t   LONG ;
 
 /* The SHA block size and message digest sizes, in bytes */
 
Use uint8_t and uint32_t in SHA-1 implementation.
