24 #ifndef INC_SHA1_HPP_AB134A0A_6DAC_4986_AA70_EFCE7BED9E65
25 #define INC_SHA1_HPP_AB134A0A_6DAC_4986_AA70_EFCE7BED9E65
79 void reset()
override;
89 uint8_t*
getValue(uint8_t* buffer)
const override;
98 size_t getSize()
const override {
return 20; }
106 void update(
const uint8_t* buf,
size_t len)
override;
187 return ChecksumAlgoId::SHA1;
Computes a checksum from a byte stream.
Computes a hash from a byte stream.
Computes the SHA1 (or SHA160) hash from a byte stream.
uint32_t h2
Third part of the state of computation.
std::string getName() const override
Returns the name of the checksum or the hash algorithm.
uint32_t h3
Fourth part of the state of computation.
uint8_t ibuffer[64]
Input buffer.
static std::string getHashName()
Returns the name of the hash algorithm.
uint32_t h1
Second part of the state of computation.
void finish()
Process the remaining bytes in the internal buffer and the usual prolog according to the standard.
ArrayString getAltNames() const override
Returns the alternative names of the SHA1 hash algorithm.
static ArrayString getAlternativeNames()
Returns the alternative names of the SHA1 hash algorithm.
int count
Current size of the input buffer.
ChecksumAlgoId getID() const override
Returns an unique identifier for the checksum or the hash algorithm.
void transform(uint8_t *data)
Transform the message X which consists of 16 32-bit-words.
uint32_t h4
Fifth part of the state of computation.
SHA1()
Default constructor.
uint8_t * getValue(uint8_t *buffer) const override
Returns the SHA1 hash value in the first 20 bytes of the given address.
void update(const uint8_t *buf, size_t len) override
Updates the SHA1 hash with specified array of bytes.
static constexpr ChecksumAlgoId getIdentifier()
Returns an unique identifier for the hash algorithm.
size_t getSize() const override
Returns the minimal size to allocate in memory to store the hash with the getValue(buffer) method.
static Checksum * getNewInstance()
Gets a new instance of this class.
uint32_t nblocks
Number of blocks.
uint32_t h0
First part of the state of computation.
void reset() override
Resets the SHA1 hash to initial state of computation.
Interface for classes from the Libgcrypt that compute hashes.
ChecksumAlgoId
Ids of algorithms of checksums.
std::vector< std::string > ArrayString
Array of strings.