From d0f32f49e814e9bdb894536beda73cf8c2e88279 Mon Sep 17 00:00:00 2001 From: weidai Date: Tue, 9 Mar 2004 12:42:38 +0000 Subject: [PATCH] implement AlgorithmName() for HAVAL and PanamaHash --- haval.h | 3 +++ panama.h | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/haval.h b/haval.h index a5aa3f57..12926abd 100644 --- a/haval.h +++ b/haval.h @@ -17,6 +17,9 @@ public: void TruncatedFinal(byte *hash, unsigned int size); unsigned int DigestSize() const {return digestSize;} + static const char * StaticAlgorithmName() {return "HAVAL";} + std::string AlgorithmName() const {return std::string("HAVAL(") + IntToString(digestSize) + "," + IntToString(pass) + ")";} + protected: static const unsigned int wi2[32], wi3[32], wi4[32], wi5[32]; static const word32 mc2[32], mc3[32], mc4[32], mc5[32]; diff --git a/panama.h b/panama.h index e1f73f59..2544f3bd 100644 --- a/panama.h +++ b/panama.h @@ -26,13 +26,14 @@ protected: /// Panama Hash template -class PanamaHash : protected Panama, public IteratedHash +class PanamaHash : protected Panama, public AlgorithmImpl, PanamaHash > { public: enum {DIGESTSIZE = 32}; PanamaHash() {Panama::Reset();} unsigned int DigestSize() const {return DIGESTSIZE;} void TruncatedFinal(byte *hash, unsigned int size); + static const char * StaticAlgorithmName() {return "Panama";} protected: void Init() {Panama::Reset();}