From f2411c886d3e3a7de7d56f16bf13569d260039a5 Mon Sep 17 00:00:00 2001 From: pixel Date: Wed, 5 Sep 2007 14:35:54 +0000 Subject: Fixing virtual heritage. --- include/GMPHashFunction.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/GMPHashFunction.h b/include/GMPHashFunction.h index 3aa6738..cdbc3dd 100644 --- a/include/GMPHashFunction.h +++ b/include/GMPHashFunction.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: GMPHashFunction.h,v 1.1 2007-09-05 14:11:54 pixel Exp $ */ +/* $Id: GMPHashFunction.h,v 1.2 2007-09-05 14:35:54 pixel Exp $ */ #ifndef __GMPHASHFUNCTION_H__ #define __GMPHASHFUNCTION_H__ @@ -30,13 +30,22 @@ class GMPHashFunction : public HashFunction { mpz_class GFinish(); }; -class GMPSHA1 : public GMPHashFunction, SHA1 { +class GMPSHA1 : public SHA1, GMPHashFunction { + protected: + virtual void update(const unsigned char * data, size_t l) { SHA1::update(data, l); } + virtual size_t finish(Uint8 * digest) { return SHA1::finish(digest); } }; -class GMPSHA256 : public GMPHashFunction, SHA1 { +class GMPSHA256 : public SHA256, GMPHashFunction { + protected: + virtual void update(const unsigned char * data, size_t l) { SHA256::update(data, l); } + virtual size_t finish(Uint8 * digest) { return SHA256::finish(digest); } }; -class GMPMD5 : public GMPHashFunction, SHA1 { +class GMPMD5 : public MD5, GMPHashFunction { + protected: + virtual void update(const unsigned char * data, size_t l) { MD5::update(data, l); } + virtual size_t finish(Uint8 * digest) { return MD5::finish(digest); } }; #endif -- cgit v1.2.3