00001 /* 00002 * sha1.h 00003 * 00004 * Copyright (C) 1998, 2009 00005 * Paul E. Jones <paulej@packetizer.com> 00006 * All Rights Reserved 00007 * 00008 ***************************************************************************** 00009 * $Id: sha1.h 12 2009-06-22 19:34:25Z paulej $ 00010 ***************************************************************************** 00011 * 00012 * Description: 00013 * This class implements the Secure Hashing Standard as defined 00014 * in FIPS PUB 180-1 published April 17, 1995. 00015 * 00016 * Many of the variable names in the SHA1Context, especially the 00017 * single character names, were used because those were the names 00018 * used in the publication. 00019 * 00020 * Please read the file sha1.c for more information. 00021 * 00022 */ 00023 00024 #ifndef _SHA1_H_ 00025 #define _SHA1_H_ 00026 00027 #include "LgiInc.h" 00028 00029 /* 00030 * This structure will hold context information for the hashing 00031 * operation 00032 */ 00033 typedef struct SHA1Context 00034 { 00035 unsigned Message_Digest[5]; /* Message Digest (output) */ 00036 00037 unsigned Length_Low; /* Message length in bits */ 00038 unsigned Length_High; /* Message length in bits */ 00039 00040 unsigned char Message_Block[64]; /* 512-bit message blocks */ 00041 int Message_Block_Index; /* Index into message block array */ 00042 00043 int Computed; /* Is the digest computed? */ 00044 int Corrupted; /* Is the message digest corruped? */ 00045 } SHA1Context; 00046 00047 /* 00048 * Function Prototypes 00049 */ 00050 LgiFunc void SHA1Reset(SHA1Context *); 00051 LgiFunc int SHA1Result(SHA1Context *); 00052 LgiFunc void SHA1Input(SHA1Context *ctx, const unsigned char *in, unsigned in_length); 00053 00054 #endif