Rework hashes (also fix Fletcher16 and CRC64)

This commit is contained in:
Jérôme Leclercq
2022-02-10 01:46:58 +01:00
parent 52100e3b3b
commit 97ee89afb7
29 changed files with 1262 additions and 1330 deletions

View File

@@ -13,13 +13,11 @@
namespace Nz
{
struct HashMD5_state;
class NAZARA_CORE_API HashMD5 : public AbstractHash
class NAZARA_CORE_API MD5Hash final : public AbstractHash
{
public:
HashMD5();
virtual ~HashMD5();
MD5Hash() = default;
~MD5Hash() = default;
void Append(const UInt8* data, std::size_t len) override;
void Begin() override;
@@ -29,7 +27,11 @@ namespace Nz
const char* GetHashName() const override;
private:
HashMD5_state* m_state;
void md5_process(const UInt8* data);
std::size_t m_count[2]; /* message length in bits, lsw first */
UInt32 m_abcd[4]; /* digest buffer */
UInt8 m_buf[64]; /* accumulate block */
};
}