#include <shashbase.h>
Inheritance diagram for SecureHashBase:
Public Member Functions | |
SecureHashBase () | |
Constructor; a no-op here. | |
virtual | ~SecureHashBase () |
Destructor must clean up the hash state. | |
virtual const Parameters * | GetPar () const |
Returns a pointer to the (normally static) parameters of this hash algorithm. | |
virtual uint64 | FedBytes () const |
Returns how many bytes were already fed (using feed()) since the last reset(). | |
virtual void | reset () |
Reset the hash; delete the current hash value (as returned by GetHash()). | |
virtual void | feed (const char *buf, size_t len) |
Feed the hash algo with data. | |
virtual void | final () |
Do the final computing of the hash value (padding...). | |
virtual void | GetHash (char *buf) const |
Query the (current) hash value /message digest. | |
Static Public Attributes | |
const Parameters | par |
Protected Attributes | |
uint64 | length |
length of hashed data in BYTES. | |
Private Member Functions | |
SecureHashBase (const SecureHashBase &) | |
Do not use these:. | |
void | operator= (const SecureHashBase &) |
If no derived class is used but this class itself, a null-hash (which is always 0) is used.
How to compute a message digest / hash value:
Definition at line 51 of file shashbase.h.
|
Do not use these:.
|
|
Constructor; a no-op here.
Definition at line 77 of file shashbase.h. References length. |
|
Destructor must clean up the hash state.
Definition at line 79 of file shashbase.h. |
|
Returns how many bytes were already fed (using feed()) since the last reset().
Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 29 of file shashbase.cc. |
|
Feed the hash algo with data. Input the passed data into the hash algorithm and go on computing the hash value. buf does not have to be aligned.
Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 41 of file shashbase.cc. References length. Referenced by test_hash(). |
|
Do the final computing of the hash value (padding...). This needs to be done before querying the has value using GetHash(). Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 47 of file shashbase.cc. Referenced by test_hash(). |
|
Query the (current) hash value /message digest. Should call final() before doing this; otherwise there may be some not-yet-processed input bytes pending. Make sure that your buffer can hold enough (hash_size) bytes. buf does not have to be aligned. Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 52 of file shashbase.cc. Referenced by test_hash(). |
|
Returns a pointer to the (normally static) parameters of this hash algorithm. The returned pointer may only be used in read-only manner. It may point to memory allocated by the hash class as the pointer may not be used after the class was destroyed. Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 90 of file shashbase.h. References par. Referenced by test_hash(). |
|
|
|
Reset the hash; delete the current hash value (as returned by GetHash()).
Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 35 of file shashbase.cc. References length. Referenced by test_hash(). |
|
length of hashed data in BYTES.
Definition at line 69 of file shashbase.h. Referenced by FedBytes(), feed(), reset(), and SecureHashBase(). |
|
Initial value: { INIT_FIELD(hash_size) 1, INIT_FIELD(block_size) 1, INIT_FIELD(hash_ID) 0x0000, INIT_FIELD(name) "null" } Reimplemented in CRC32Hash, RMD160Hash, SHA0Hash, and SHA1Hash. Definition at line 20 of file shashbase.cc. Referenced by GetPar(). |