9 #include <aws/cal/hash.h>
32 size_t truncateTo = 0) noexcept;
53 size_t truncateTo = 0) noexcept;
73 size_t truncateTo = 0) noexcept;
93 Hash &operator=(
const Hash &) =
delete;
100 operator bool()
const noexcept;
105 inline int LastError() const noexcept {
return m_lastError; }
126 bool Update(const
ByteCursor &toHash) noexcept;
135 bool Digest(
ByteBuf &output,
size_t truncateTo = 0) noexcept;
147 bool ComputeOneShot(const
ByteCursor &input,
ByteBuf &output,
size_t truncateTo = 0) noexcept;
153 size_t DigestSize() const noexcept;
156 Hash(aws_hash *hash) noexcept;
178 aws_hash *SeatForCInterop(
const std::shared_ptr<ByoHash> &selfRef);
188 virtual bool UpdateInternal(
const ByteCursor &toHash) noexcept = 0;
196 virtual bool DigestInternal(
ByteBuf &output,
size_t truncateTo = 0) noexcept = 0;
199 static void s_Destroy(
struct aws_hash *hash);
200 static int s_Update(
struct aws_hash *hash,
const struct aws_byte_cursor *buf);
201 static int s_Finalize(
struct aws_hash *hash,
struct aws_byte_buf *out);
203 static aws_hash_vtable s_Vtable;
204 aws_hash m_hashValue;
205 std::shared_ptr<ByoHash> m_selfReference;
bool AWS_CRT_CPP_API ComputeMD5(Allocator *allocator, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: Hash.cpp:41
#define AWS_CRT_CPP_API
Definition: Exports.h:36
std::function< std::shared_ptr< ByoHash >(size_t digestSize, Allocator *)> CreateHashCallback
Definition: Hash.h:208
int LastError() const noexcept
Definition: Hash.h:105
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_DIGEST_SIZE
Definition: Hash.h:19
static const size_t MD5_DIGEST_SIZE
Definition: Hash.h:20
bool AWS_CRT_CPP_API ComputeSHA256(Allocator *allocator, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: Hash.cpp:15
AWS_CRT_CPP_API Allocator * ApiAllocator() noexcept
Definition: Allocator.cpp:24
static const size_t SHA1_DIGEST_SIZE
Definition: Hash.h:18
bool AWS_CRT_CPP_API ComputeSHA1(Allocator *allocator, const ByteCursor &input, ByteBuf &output, size_t truncateTo=0) noexcept
Definition: Hash.cpp:30
Definition: Allocator.h:10