24 #ifndef INC_MD2_HPP_6054FE3E_36EE_452D_AD68_111840350FB4
25 #define INC_MD2_HPP_6054FE3E_36EE_452D_AD68_111840350FB4
75 void reset()
override;
85 uint8_t*
getValue(uint8_t* buffer)
const override;
94 size_t getSize()
const override {
return 16; }
102 void update(
const uint8_t* buf,
size_t len)
override;
157 return ChecksumAlgoId::MD2;
Add some utilities to Checksum class.
Computes a hash from a byte stream.
Computes a checksum from a byte stream.
Computes the MD2 hash from a byte stream.
MD2()
Default constructor.
static std::string getHashName()
Returns the name of the hash algorithm.
static constexpr ChecksumAlgoId getIdentifier()
Returns an unique identifier for the hash algorithm.
uint8_t * getValue(uint8_t *buffer) const override
Returns the MD2 hash value in the first 20 bytes of the given address.
uint8_t X[48]
Buffer used for computing md2 hash.
uint8_t ibuffer[16]
Input buffer.
void update(const uint8_t *buf, size_t len) override
Updates the MD2 hash with specified array of bytes.
ChecksumAlgoId getID() const override
Returns an unique identifier for the checksum or the hash algorithm.
static Checksum * getNewInstance()
Gets a new instance of this class.
void finish()
Process the remaining bytes in the internal buffer and the usual prolog according to the standard.
uint8_t C[16]
Buffer used for computing md2 hash.
int count
Current size of the input buffer.
std::string getName() const override
Returns the name of the checksum or the hash algorithm.
void reset() override
Resets the MD2 hash to initial state of computation.
size_t getSize() const override
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method.
ChecksumAlgoId
Ids of algorithms of checksums.