00001 /*_############################################################################ 00002 _## 00003 _## sha.h 00004 _## 00005 _## SNMP++v3.2.15 00006 _## ----------------------------------------------- 00007 _## Copyright (c) 2001-2004 Jochen Katz, Frank Fock 00008 _## 00009 _## This software is based on SNMP++2.6 from Hewlett Packard: 00010 _## 00011 _## Copyright (c) 1996 00012 _## Hewlett-Packard Company 00013 _## 00014 _## ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS. 00015 _## Permission to use, copy, modify, distribute and/or sell this software 00016 _## and/or its documentation is hereby granted without fee. User agrees 00017 _## to display the above copyright notice and this license notice in all 00018 _## copies of the software and any documentation of the software. User 00019 _## agrees to assume all liability for the use of the software; 00020 _## Hewlett-Packard and Jochen Katz make no representations about the 00021 _## suitability of this software for any purpose. It is provided 00022 _## "AS-IS" without warranty of any kind, either express or implied. User 00023 _## hereby grants a royalty-free license to any and all derivatives based 00024 _## upon this software code base. 00025 _## 00026 _## Stuttgart, Germany, Tue Jan 4 21:42:42 CET 2005 00027 _## 00028 _##########################################################################*/ 00029 00030 #include "snmp_pp/config_snmp_pp.h" 00031 00032 #if !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL) 00033 00034 // $Id: sha.h,v 1.4 2004/03/03 23:11:21 katz Exp $ 00035 /**************************************************************** 00036 * SHS.h - Secure Hash Standard (draft) FIPS 180-1 * 00037 * * 00038 * Copyright (C) 1994 Uri Blumenthal, uri@watson.ibm.com * 00039 * Copyright (C) 1994 IBM T. J. Watson esearch Center * 00040 * * 00041 * Feel free to use this code, as long as you acknowledge the * 00042 * ownership by U. Blumenthal and IBM Corp. and agree to hold * 00043 * both harmless in case of ANY problem you may have with this * 00044 * code. * 00045 ****************************************************************/ 00046 #ifdef SNMP_PP_NAMESPACE 00047 namespace Snmp_pp { 00048 #endif 00049 00050 typedef struct { 00051 /* Message Digest words */ 00052 unsigned long int h[5]; 00053 /* Message length in bits */ 00054 unsigned long int count[2]; 00055 /* Current byte position in not-full-yet buf */ 00056 int index; 00057 /* Buffer for the remainder of bytes mod 64 */ 00058 unsigned char X[64]; 00059 } SHA_CTX; 00060 00061 DLLOPT void SHAInit(SHA_CTX *ctx); 00062 DLLOPT void SHAUpdate(SHA_CTX *ctx, const unsigned char *buf, unsigned int lenBuf); 00063 DLLOPT void SHAFinal(unsigned char *digest, SHA_CTX *ctx); 00064 00065 #ifdef SNMP_PP_NAMESPACE 00066 }; // end of namespace Snmp_pp 00067 #endif 00068 00069 #endif // !defined(_USE_LIBTOMCRYPT) && !defined(_USE_OPENSSL) 00070
1.3.2