Batch #866 by ragnarok-clanker: 0 byte-identical, 3 confirmed by peer review. - fn_04423 SHA3::Add: logic confirmed by peer review - fn_04424 SHA3::GetHash: logic confirmed by peer review - fn_04425 SHA3::ProcessBlock: logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Utility/SHA3.cpp
27 lines
782 B
C++
27 lines
782 B
C++
#ifndef RAGNAROK_SOURCE_UTILITY_SHA3_H
|
|
#define RAGNAROK_SOURCE_UTILITY_SHA3_H
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
struct SHA3 {
|
|
/* 0000 */ std::uint64_t state[25];
|
|
/* 00C8 */ std::uint64_t processedBytes;
|
|
/* 00D0 */ unsigned int blockSize;
|
|
/* 00D4 */ unsigned int bufferedBytes;
|
|
/* 00D8 */ unsigned char buffer[144];
|
|
/* 0168 */ int digestBits;
|
|
|
|
void Add(const unsigned char* data, unsigned int length);
|
|
std::string GetHash();
|
|
void ProcessBlock(const unsigned char* data);
|
|
};
|
|
|
|
static_assert(offsetof(SHA3, processedBytes) == 0xC8);
|
|
static_assert(offsetof(SHA3, blockSize) == 0xD0);
|
|
static_assert(offsetof(SHA3, bufferedBytes) == 0xD4);
|
|
static_assert(offsetof(SHA3, buffer) == 0xD8);
|
|
static_assert(offsetof(SHA3, digestBits) == 0x168);
|
|
|
|
#endif
|