"Fossies" - the Fresh Open Source Software Archive

Member "apg-2.2.3/sha/sha.h" (7 Aug 2003, 1202 Bytes) of package /linux/privat/old/apg-2.2.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /***************************************************************************/
    2 /* sha.h                                   */
    3 /*                                     */
    4 /* SHA-1 code header file.                         */
    5 /* Taken from the public domain implementation by Peter C. Gutmann     */
    6 /* on 2 Sep 1992, modified by Carl Ellison to be SHA-1.            */
    7 /***************************************************************************/
    8 
    9 #ifndef _SHA_H_
   10 #define _SHA_H_
   11 
   12 /* Define APG_LITTLE_ENDIAN if the machine is little-endian */
   13 
   14 #define APG_LITTLE_ENDIAN
   15 
   16 /* Useful defines/typedefs */
   17 
   18 typedef unsigned char   BYTE ;
   19 typedef unsigned long   LONG ;
   20 
   21 /* The SHA block size and message digest sizes, in bytes */
   22 
   23 #define SHA_BLOCKSIZE   64
   24 #define SHA_DIGESTSIZE  20
   25 
   26 /* The structure for storing SHA info */
   27 
   28 typedef struct {
   29   LONG digest[ 5 ] ;            /* Message digest */
   30   LONG countLo, countHi ;       /* 64-bit bit count */
   31   LONG data[ 16 ] ;             /* SHA data buffer */
   32   LONG slop ;           /* # of bytes saved in data[] */
   33 } apg_SHA_INFO ;
   34 
   35 void apg_shaInit( apg_SHA_INFO *shaInfo ) ;
   36 void apg_shaUpdate( apg_SHA_INFO *shaInfo, BYTE *buffer, int count ) ;
   37 void apg_shaFinal( apg_SHA_INFO *shaInfo, BYTE hash[SHA_DIGESTSIZE] ) ;
   38 
   39 #endif /* _SHA_H_ */