X-Git-Url: http://git.tdb.fi/?p=libs%2Fcrypto.git;a=blobdiff_plain;f=source%2Fmd5.h;h=32b468b02ccd33f3f3b35203edcae16d40149262;hp=f47723c5b49ff619f1d6237620bb955c6ff7eba5;hb=af23707dc5f78bc2889252ce04d486a3ddfdaeca;hpb=d599dd9a681d815dd6627b358ee36b5a6354f6c0 diff --git a/source/md5.h b/source/md5.h index f47723c..32b468b 100644 --- a/source/md5.h +++ b/source/md5.h @@ -2,18 +2,16 @@ #define MSP_CRYPTO_MD5_H_ #include -#include "hash.h" +#include "blockhash.h" namespace Msp { namespace Crypto { -class MD5: public Hash +class MD5: public BlockHash<64> { private: UInt32 buffer[4]; UInt64 processed_bytes; - char unprocessed[64]; - unsigned unprocessed_bytes; static UInt32 sin_table[64]; static unsigned rotate_table[16]; @@ -28,12 +26,10 @@ private: public: virtual unsigned get_digest_size() const { return 16; } - using Hash::update; - virtual void update(const char *, unsigned); virtual unsigned get_digest(char *, unsigned) const; private: - void process_block(const char *); + virtual void process_block(const char *); template static void perform_round(UInt32 *, const UInt32 *);