![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
Hash algorithm abstract class. More...
#include <hash.hpp>
Public Member Functions | |
virtual const std::array< uint8_t, O > & | digest () const =0 |
template<class CharT , class Traits , class Allocator > | |
const std::array< uint8_t, O > & | digest (const std::basic_string< CharT, Traits, Allocator > &data) |
template<std::size_t N> | |
const std::array< uint8_t, O > & | digest (const std::array< uint8_t, N > &data) |
const std::array< uint8_t, O > & | digest (const uint8_t *data, std::size_t len) |
template<class CharT , class Traits > | |
const std::array< uint8_t, O > & | digest (std::basic_istream< CharT, Traits > &stream) |
Static Public Member Functions | |
static constexpr std::size_t | getOutputSize () |
static constexpr std::size_t | getBlockSize () |
Protected Member Functions | |
virtual void | reset ()=0 |
virtual void | addData (const uint8_t *data, std::size_t len)=0 |
virtual void | finalize ()=0 |
Hash algorithm abstract class.
N is the hash output size in bytes.
B is the hash block size in bytes (used in HMAC algorithm).
|
protectedpure virtual |
Compute hash for data with the current hash
data | The data to add |
len | The data length |
Implemented in anch::crypto::SHA1, and anch::crypto::MD5.
|
pure virtual |
Get the hash result
Implemented in anch::crypto::SHA1, anch::crypto::MD5, anch::crypto::SHA2< O, B, W, R, I >, anch::crypto::SHA2< O, 64, uint32_t, 64, I >, and anch::crypto::SHA2< O, 128, uint64_t, 80, I >.
|
inline |
Reset current hash context and compute hash for string
data | the string to hash |
|
inline |
Reset current hash context and compute hash for string
data | the string to hash |
|
inline |
Reset current hash context and compute hash for string
data | the string to hash |
len | the data length |
|
inline |
Reset current hash context and compute hash for stream
stream | the stream to hash |
|
protectedpure virtual |
Reset hash context
Implemented in anch::crypto::SHA1, and anch::crypto::MD5.
|
inlinestatic |
Hash block size getter
|
inlinestatic |
Hash output size getter
|
protectedpure virtual |
Reset hash context
Implemented in anch::crypto::SHA1, and anch::crypto::MD5.