Batch #859 by ragnarok-clanker: 0 byte-identical, 14 confirmed by peer review. - fn_00122 MD5::~MD5: logic confirmed by peer review - fn_00123 MD5::Decode: logic confirmed by peer review - fn_00124 MD5::Initialize: logic confirmed by peer review - fn_00125 MD5::Transform: logic confirmed by peer review - fn_00126 MD5::Update: logic confirmed by peer review - fn_00127 MD5::Finalize: logic confirmed by peer review - fn_00128 MD5::DigestBuffer: logic confirmed by peer review - fn_00129 MD5::HashBuffer: logic confirmed by peer review - fn_00130 MD5::HashString: logic confirmed by peer review - fn_00131 MD5::HashString: logic confirmed by peer review - fn_00132 MD5::HashFile: logic confirmed by peer review - fn_00133 MD5::HashStringLower: logic confirmed by peer review - fn_00134 MD5::HashStringLower: logic confirmed by peer review - fn_00135 MD5::HashFile: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Utility/MD5.cpp
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
#ifndef RAGNAROK_SOURCE_UTILITY_MD5_H
|
|
#define RAGNAROK_SOURCE_UTILITY_MD5_H
|
|
|
|
#include <cstdint>
|
|
|
|
class MD5 {
|
|
public:
|
|
MD5();
|
|
~MD5();
|
|
|
|
int Initialize();
|
|
void Update(const unsigned char* input, std::uint32_t length);
|
|
unsigned char* Finalize();
|
|
unsigned char* DigestBuffer(const unsigned char* input, std::uint32_t length, unsigned char* digest);
|
|
std::uint32_t HashBuffer(const unsigned char* input, std::uint32_t length);
|
|
std::uint32_t HashString(const char* text);
|
|
std::uint32_t HashString(const wchar_t* text);
|
|
std::uint32_t HashFile(const wchar_t* filename);
|
|
std::uint32_t HashStringLower(const char* text);
|
|
std::uint32_t HashStringLower(const wchar_t* text);
|
|
std::uint32_t HashFile(const char* filename);
|
|
|
|
private:
|
|
const unsigned char* Decode(std::uint32_t* output, const unsigned char* input, std::uint32_t count);
|
|
std::uint32_t* Transform(std::uint32_t* state, const std::uint32_t* input);
|
|
|
|
union {
|
|
/* 0000 */ unsigned char m_buffer[64];
|
|
/* 0000 */ std::uint32_t m_words[16];
|
|
};
|
|
/* 0040 */ std::uint32_t m_state[4];
|
|
/* 0050 */ std::uint32_t m_byteCount[2];
|
|
};
|
|
|
|
static_assert(sizeof(MD5) == 0x58);
|
|
|
|
#endif
|