SHA-3 hash
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
SHA3< m_mode > Class Template Reference

SHA-3 hash main class. More...

#include <sha3.hpp>

Public Member Functions

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 Public Member Functions

static constexpr auto block_size ()
 calculate block size based on selected hash mode
 

Detailed Description

template<std::size_t m_mode>
class SHA3< m_mode >

SHA-3 hash main class.

Template Parameters
modehash 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

Member Function Documentation

◆ 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
outoutput buffer for the calculated hash
inbuffer with the remaining data
szsize 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
inchunk buffer
szsize 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: