50 [[nodiscard]]
virtual uint8_t*
getData(
size_t offset,
size_t size) = 0;
84 [[nodiscard]]
const TigerHash&
calcHash(
const std::function<
void(
size_t,
size_t)>& progressCallback);
91 void notifyChange(
size_t offset,
size_t len, time_t time);
96 Node(
size_t n_,
size_t l_) : n(n_), l(l_) {}
100 [[nodiscard]] Node getTop()
const;
101 [[nodiscard]] Node getLeaf(
size_t block)
const;
102 [[nodiscard]] Node getParent(Node node)
const;
103 [[nodiscard]] Node getLeftChild(Node node)
const;
104 [[nodiscard]] Node getRightChild(Node node)
const;
106 [[nodiscard]]
const TigerHash&
calcHash(Node node,
const std::function<
void(
size_t,
size_t)>& progressCallback);
110 const size_t dataSize;
The TigerTree class will query the to-be-hashed data via this abstract interface.
virtual bool isCacheStillValid(time_t &time)=0
Because TTH calculation of a large file takes some time (a few 1/10s for a hard disk image) we try to...
virtual uint8_t * getData(size_t offset, size_t size)=0
Return the requested portion of the to-be-hashed data block.
Calculate a tiger-tree-hash.
const TigerHash & calcHash(const std::function< void(size_t, size_t)> &progressCallback)
Calculate the hash value.
void notifyChange(size_t offset, size_t len, time_t time)
Inform this calculator about changes in the input data.
static constexpr size_t BLOCK_SIZE
This file implemented 3 utility functions:
This struct represents the result of a tiger-hash.