mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 16:07:04 -06:00
- 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
44 lines
864 B
C++
44 lines
864 B
C++
// Sha384Reg.cpp /TR 2018-11-02
|
|
|
|
#include "StdAfx.h"
|
|
|
|
#include "../../C/CpuArch.h"
|
|
|
|
EXTERN_C_BEGIN
|
|
#include "../../C/hashes/sha.h"
|
|
EXTERN_C_END
|
|
|
|
#include "../Common/MyCom.h"
|
|
#include "../7zip/Common/RegisterCodec.h"
|
|
|
|
// SHA384
|
|
class CSHA384Hasher:
|
|
public IHasher,
|
|
public CMyUnknownImp
|
|
{
|
|
SHA384_CTX _ctx;
|
|
Byte mtDummy[1 << 7];
|
|
|
|
public:
|
|
CSHA384Hasher() { SHA384_Init(&_ctx); }
|
|
|
|
MY_UNKNOWN_IMP1(IHasher)
|
|
INTERFACE_IHasher(;)
|
|
};
|
|
|
|
STDMETHODIMP_(void) CSHA384Hasher::Init() throw()
|
|
{
|
|
SHA384_Init(&_ctx);
|
|
}
|
|
|
|
STDMETHODIMP_(void) CSHA384Hasher::Update(const void *data, UInt32 size) throw()
|
|
{
|
|
SHA384_Update(&_ctx, (const Byte *)data, size);
|
|
}
|
|
|
|
STDMETHODIMP_(void) CSHA384Hasher::Final(Byte *digest) throw()
|
|
{
|
|
SHA384_Final(digest, &_ctx);
|
|
}
|
|
REGISTER_HASHER(CSHA384Hasher, 0x208, "SHA384", SHA384_DIGEST_LENGTH)
|