6 #include <aws/cal/hmac.h>
30 size_t truncateTo = 0) noexcept;
42 size_t truncateTo = 0) noexcept;
53 HMAC &operator=(
const HMAC &) =
delete;
60 inline operator bool() const noexcept {
return m_good; }
65 inline int LastError() const noexcept {
return m_lastError; }
81 bool Update(
const ByteCursor &toHMAC) noexcept;
89 bool Digest(
ByteBuf &output,
size_t truncateTo = 0) noexcept;
95 size_t DigestSize() const noexcept;
107 bool ComputeOneShot(const
ByteCursor &input,
ByteBuf &output,
size_t truncateTo = 0) noexcept;
110 HMAC(aws_hmac *hmac) noexcept;
127 virtual ~ByoHMAC() =
default;
133 aws_hmac *SeatForCInterop(
const std::shared_ptr<ByoHMAC> &selfRef);
143 virtual bool UpdateInternal(
const ByteCursor &toHash) noexcept = 0;
151 virtual bool DigestInternal(
ByteBuf &output,
size_t truncateTo = 0) noexcept = 0;
154 static void s_Destroy(
struct aws_hmac *hmac);
155 static int s_Update(
struct aws_hmac *hmac,
const struct aws_byte_cursor *buf);
156 static int s_Finalize(
struct aws_hmac *hmac,
struct aws_byte_buf *out);
158 static aws_hmac_vtable s_Vtable;
159 aws_hmac m_hmacValue;
160 std::shared_ptr<ByoHMAC> m_selfReference;
bool AWS_CRT_CPP_API ComputeSHA256HMAC(Allocator *allocator, const ByteCursor &secret, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: HMAC.cpp:15
#define AWS_CRT_CPP_API
Definition: Exports.h:36
aws_byte_buf ByteBuf
Definition: Types.h:30
aws_allocator Allocator
Definition: Allocator.h:14
aws_byte_cursor ByteCursor
Definition: Types.h:31
static const size_t SHA256_HMAC_DIGEST_SIZE
Definition: HMAC.h:17
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
std::function< std::shared_ptr< ByoHMAC >(size_t digestSize, const ByteCursor &secret, Allocator *)> CreateHMACCallback
Definition: HMAC.h:164
int LastError() const noexcept
Definition: HMAC.h:65
Definition: Allocator.h:10