diff --git a/Source/Utility/Md5State.h b/Source/Utility/Md5State.h new file mode 100644 index 0000000..eef2491 --- /dev/null +++ b/Source/Utility/Md5State.h @@ -0,0 +1,26 @@ +#ifndef RAGNAROK_SOURCE_UTILITY_MD5STATE_H +#define RAGNAROK_SOURCE_UTILITY_MD5STATE_H + +#include +#include + +class MD5State { +public: + void Init(); + void Append(const unsigned char* data, int nbytes); + void Finish(unsigned char* digest); + + void Process(const unsigned char* data); + + /* 0000 */ std::uint32_t count[2]; + /* 0008 */ std::uint32_t abcd[4]; + /* 0018 */ unsigned char buf[64]; +}; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(offsetof(MD5State, abcd) == 0x08); +static_assert(offsetof(MD5State, buf) == 0x18); +static_assert(sizeof(MD5State) == 0x58); +#endif + +#endif diff --git a/data/compile.json b/data/compile.json index 3721fed..ee6f112 100644 --- a/data/compile.json +++ b/data/compile.json @@ -716,6 +716,7 @@ "Source/Utility/Math/ClientAngles.cpp": 0, "Source/Utility/Math/RadialGrid.cpp": 0, "Source/Utility/Math/RayTriangle.cpp": 0, + "Source/Utility/Md5.cpp": 0, "Source/Utility/NFileLog.cpp": 0, "Source/Utility/NIPAddr.cpp": 0, "Source/Utility/ProcessSecurity.cpp": 0,