Add some hash functions

- new: md2, md4, md5, sha384, sha512, xxhash-32, xxhash-64
- put Blake2sp hash stuff back to rar code
- added the hashes to GUI and Explorer Menu code
This commit is contained in:
Tino Reichardt
2018-11-03 00:18:33 +01:00
parent add56b5aed
commit 36a17a5184
31 changed files with 1812 additions and 408 deletions

View File

@@ -2962,4 +2962,35 @@ REGISTER_ARC_I(
NULL)
}}
class CBlake2spHasher:
public IHasher,
public CMyUnknownImp
{
CBlake2sp _blake;
Byte mtDummy[1 << 7];
public:
CBlake2spHasher() { Init(); }
MY_UNKNOWN_IMP
INTERFACE_IHasher(;)
};
STDMETHODIMP_(void) CBlake2spHasher::Init() throw()
{
Blake2sp_Init(&_blake);
}
STDMETHODIMP_(void) CBlake2spHasher::Update(const void *data, UInt32 size) throw()
{
Blake2sp_Update(&_blake, (const Byte *)data, size);
}
STDMETHODIMP_(void) CBlake2spHasher::Final(Byte *digest) throw()
{
Blake2sp_Final(&_blake, digest);
}
REGISTER_HASHER(CBlake2spHasher, 0x202, "BLAKE2sp", BLAKE2S_DIGEST_SIZE)