2022-09-19 01:34:57 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: HMAC.hpp
|
|
|
|
Date: 2022-9-18
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Crypto::HMAC
|
|
|
|
{
|
|
|
|
struct HMACContext : IHMACContext
|
|
|
|
{
|
2022-09-25 09:56:03 +00:00
|
|
|
HMACContext(AuHashing::EHashType type);
|
2022-09-19 01:34:57 +00:00
|
|
|
|
|
|
|
void Ingest(const Memory::MemoryViewRead &input) override;
|
|
|
|
|
|
|
|
Memory::MemoryViewRead Finalize() override;
|
|
|
|
|
|
|
|
void Reset() override;
|
|
|
|
|
|
|
|
bool Init(const Memory::MemoryViewRead &input);
|
|
|
|
private:
|
|
|
|
AuUInt8 buffer_[64] {};
|
|
|
|
hmac_state state_ {};
|
|
|
|
hmac_state referenceState_ {};
|
2022-09-25 09:56:03 +00:00
|
|
|
AuHashing::EHashType type_ {};
|
2022-09-19 01:34:57 +00:00
|
|
|
bool bFinished_ {};
|
|
|
|
};
|
|
|
|
}
|