Reece Wilson
8a2947ffc5
[*] Refactor bcrypt api: HashPW[Ex] -> HashPassword[Ex] [+] ByteBuffer::GetOrAllocateLinearWriteable [+] ByteBuffer::Can[Read/Write](n) [+] ByteBuffer::GetLinear[Read/Writable]able(n) [*] Split RNG.cpp into two files [+] EHashType::eSHA2_48 (_32, _64 was already in place. missed 48/384 bit) [+] AuCrypto::HMAC and IHMACContext (AuHashing) [+] EHashType::eSHA3_28 [+] EHashType::eSHA3_32 [+] EHashType::eSHA3_48 [+] EHashType::eSHA3_64 (AuCrypto) [+] EHashType::eSHA2_48_384 [+] EHashType::eSHA2_64_512 [+] EHashType::eSHA3_28_224 [+] EHashType::eSHA3_32_256 [+] EHashType::eSHA3_48_384 [+] EHashType::eSHA3_64_512 [*] (IRandomDevice) class -> struct [*] Bugfix: cast in Promise<SuccessValue_t, ErrorValue_t>::WriteIntoError [+] Missing AuHashing namespace alias [*] Time util: pad ms when fraction of a second to 3 digits
36 lines
837 B
C++
36 lines
837 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: HashStream.hpp
|
|
Date: 2021-6-12
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Hashing
|
|
{
|
|
struct HashStream : IHashStream
|
|
{
|
|
HashStream(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;
|
|
|
|
void Init();
|
|
private:
|
|
AuUInt8 buffer_[64] {};
|
|
hash_state state_ {};
|
|
EHashType type_ {};
|
|
bool bFinished_ {};
|
|
};
|
|
} |