AuroraRuntime/Source/Hashing/AuHashStream.hpp
Jamie Reece Wilson 3732352b4e [+] AuHashing::Whirlpool
[+] AuHashing::Blake2S_32
[+] AuHashing::Blake2S_28
[+] AuHashing::Blake2S_20
[+] AuHashing::Blake2S_16
[+] AuHashing::Blake2B_64
[+] AuHashing::Blake2B_48
[+] AuHashing::Blake2B_32
[+] AuHashing::Blake2B_20
[+] AuHashing::GetHashLength
[+] AuHashing::GetHashBits
[+] AuHashing::IHashStream::GetHashType
2024-02-18 17:53:37 +00:00

45 lines
1016 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuHashStream.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
namespace Aurora::Hashing
{
#pragma pack(push)
#pragma pack(4)
struct HashStreamImpl : IHashStream
{
HashStreamImpl(EHashType type);
void Ingest(const Memory::MemoryViewRead &input) override;
AuUInt8 const *GetBytes(AuUInt32 &length) override;
Memory::MemoryViewRead Finalize() override;
Memory::MemoryViewRead PeekFinalize() override;
AuResult<Memory::MemoryViewRead> Export() override;
bool Import(const Memory::MemoryViewRead &view) override;
void Reset() override;
EHashType GetHashType() override;
void Init();
private:
EHashType type_ {};
bool bFinished_ {};
AuUInt8 buffer_[64] {};
union
{
hash_state state_ {};
char altBuffer_[432];
};
};
#pragma pack(pop)
}