SHA-3 hash main class.
More...
#include <sha3.hpp>
|
void | update (const void *__restrict in, const uint64_t sz) |
| update the hash state with intermediate chunk
|
|
void | finalize (void *__restrict out, const void *__restrict in, const uint64_t sz) |
| complete the hash calculation with the remaining data
|
|
auto | operator() (auto &&... args) |
| wrapper for calling a class as a functor
|
|
|
static constexpr auto | block_size () |
| calculate block size based on selected hash mode
|
|
template<std::size_t m_mode>
class SHA3< m_mode >
SHA-3 hash main class.
- Template Parameters
-
mode | hash mode (224, 384, 256 or 512) |
The class implements two main methods update and finalize. They allow hashing to be applied to data that is completely located in some kind of user buffer, and to data that comes chunk by chunk
◆ finalize()
template<std::size_t m_mode>
void SHA3< m_mode >::finalize |
( |
void *__restrict |
out, |
|
|
const void *__restrict |
in, |
|
|
const uint64_t |
sz |
|
) |
| |
|
inline |
complete the hash calculation with the remaining data
- Parameters
-
out | output buffer for the calculated hash |
in | buffer with the remaining data |
sz | size of remaining data in bytes |
- Note
- you can only call this method if all the hashing data is available at once
◆ update()
template<std::size_t m_mode>
void SHA3< m_mode >::update |
( |
const void *__restrict |
in, |
|
|
const uint64_t |
sz |
|
) |
| |
|
inline |
update the hash state with intermediate chunk
- Parameters
-
in | chunk buffer |
sz | size of chunk in bytes |
- Warning
- Make sure that the buffer size (sz param) must be a multiple of the block size (i.e. for this method the buffer must contain only full blocks)
The documentation for this class was generated from the following file: