implement AlgorithmName() for HAVAL and PanamaHash
parent
4e99bcc40d
commit
d0f32f49e8
3
haval.h
3
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];
|
||||
|
|
|
|||
3
panama.h
3
panama.h
|
|
@ -26,13 +26,14 @@ protected:
|
|||
|
||||
/// <a href="http://www.weidai.com/scan-mirror/md.html#Panama">Panama Hash</a>
|
||||
template <class B = LittleEndian>
|
||||
class PanamaHash : protected Panama<B>, public IteratedHash<word32, NativeByteOrder, 32>
|
||||
class PanamaHash : protected Panama<B>, public AlgorithmImpl<IteratedHash<word32, NativeByteOrder, 32>, PanamaHash<B> >
|
||||
{
|
||||
public:
|
||||
enum {DIGESTSIZE = 32};
|
||||
PanamaHash() {Panama<B>::Reset();}
|
||||
unsigned int DigestSize() const {return DIGESTSIZE;}
|
||||
void TruncatedFinal(byte *hash, unsigned int size);
|
||||
static const char * StaticAlgorithmName() {return "Panama";}
|
||||
|
||||
protected:
|
||||
void Init() {Panama<B>::Reset();}
|
||||
|
|
|
|||
Loading…
Reference in New Issue