24 #ifndef INC_SHA224_256_HPP_178C3693_9F7E_475C_A474_9DBDA16BCC5B
25 #define INC_SHA224_256_HPP_178C3693_9F7E_475C_A474_9DBDA16BCC5B
73 void update(
const uint8_t* buf,
size_t len)
override final;
127 void reset()
override;
137 uint8_t*
getValue(uint8_t* buffer)
const override;
146 size_t getSize()
const override {
return 28; }
210 return ChecksumAlgoId::SHA2_224;
262 void reset()
override;
272 uint8_t*
getValue(uint8_t* buffer)
const override;
281 size_t getSize()
const override {
return 32; }
345 return ChecksumAlgoId::SHA2_256;
Computes the SHA256 hash from a byte stream.
uint32_t h3
Fourth part of the state of computation.
uint32_t h6
Seventh part of the state of computation.
uint32_t h2
Third part of the state of computation.
void finish()
Process the remaining bytes in the internal buffer and the usual prolog according to the standard.
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.
uint8_t ibuffer[64]
Input buffer.
int count
Current size of the input buffer.
uint32_t h0
First part of the state of computation.
uint32_t h7
Eighth part of the state of computation.
void update(const uint8_t *buf, size_t len) override final
Updates the SHA256 hash with specified array of bytes.
uint32_t h1
Second part of the state of computation.
uint32_t nblocks
Number of blocks.
uint32_t h5
Sixth part of the state of computation.
void reset() override=0
Resets the checksum to initial value.
Computes a checksum from a byte stream.
Computes a hash from a byte stream.
Computes the SHA224 hash from a byte stream.
uint8_t * getValue(uint8_t *buffer) const override
Returns the SHA224 hash value in the first 28 bytes of the given address.
ArrayString getAltNames() const override
Returns the alternative names of the SHA224 hash algorithm.
static std::string getHashName()
Returns the name of the hash algorithm.
std::string getName() const override
Returns the name of the checksum or the hash algorithm.
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.
SHA224()
Default constructor.
void reset() override
Resets the SHA224 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.
static ArrayString getAlternativeNames()
Returns the alternative names of the SHA224 hash algorithm.
static constexpr ChecksumAlgoId getIdentifier()
Returns an unique identifier for the hash algorithm.
Computes the SHA256 hash from a byte stream.
static constexpr ChecksumAlgoId getIdentifier()
Returns an unique identifier for the hash algorithm.
static Checksum * getNewInstance()
Gets a new instance of this class.
ArrayString getAltNames() const override
Returns the alternative names of the SHA256 hash algorithm.
std::string getName() const override
Returns the name of the checksum or the hash algorithm.
uint8_t * getValue(uint8_t *buffer) const override
Returns the SHA256 hash value in the first 32 bytes of the given address.
SHA256()
Default constructor.
static std::string getHashName()
Returns the name of 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.
ChecksumAlgoId getID() const override
Returns an unique identifier for the checksum or the hash algorithm.
void reset() override
Resets the SHA256 hash to initial state of computation.
static ArrayString getAlternativeNames()
Returns the alternative names of the SHA256 hash algorithm.
Interface for classes from the Libgcrypt that compute hashes.
ChecksumAlgoId
Ids of algorithms of checksums.
std::vector< std::string > ArrayString
Array of strings.