00001 /* 00002 * lib/crypto/rmd160hash.h 00003 * 00004 * Header file containing class RMD160Hash, a class for 00005 * computing the RMD160 mesage digest / hash algorithm (RIPE MD 160). 00006 * 00007 * Copyright (c) 2001--2004 by Wolfgang Wieser ] wwieser (a) gmx <*> de [ 00008 * 00009 * This file may be distributed and/or modified under the terms of the 00010 * GNU General Public License version 2 as published by the Free Software 00011 * Foundation. (See COPYING.GPL for details.) 00012 * 00013 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00014 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00015 * 00016 */ 00017 00018 #ifndef _LIB_CRYPTO_RMD160Hash_H_ 00019 #define _LIB_CRYPTO_RMD160Hash_H_ 1 00020 00030 #include <lib/crypto/shashbase.h> 00031 00040 class RMD160Hash : public SecureHashBase 00041 { 00042 public: 00044 static const Parameters par; 00045 00046 private: 00047 uint32 state[5]; 00048 //uint64 length; <- in base class // length of hashed data in BYTES. 00049 00050 unsigned char tmpbuf[64]; 00051 int tmp_size; 00052 00054 void AtomicHash(const unsigned char *msg,uint32 *w); 00055 00057 RMD160Hash(const RMD160Hash &); 00058 void operator=(const RMD160Hash &); 00059 public: 00061 RMD160Hash() : SecureHashBase() 00062 { reset(); } 00064 ~RMD160Hash() 00065 { reset(); } 00066 00068 const Parameters *GetPar() const 00069 { return(&RMD160Hash::par); } 00070 00072 uint64 FedBytes() const 00073 { return(length); } 00074 00076 void reset(); 00077 00079 void feed(const char *buf,size_t len); 00080 00082 void final(); 00083 00085 void GetHash(char *buf) const; 00086 }; 00087 00088 #endif /* _LIB_CRYPTO_RMD160Hash_H_ */