Crypto::HashContext< Engine_ > Class Template Reference

Class template for a Hash implementation 'Context'. More...

#include <HashContext.h>

Classes

struct  State
 

Public Types

using Engine = Engine_
 
using Hash = ByteArray< Engine::hashsize >
 

Public Member Functions

 HashContext ()
 
HashContextreset ()
 Reset the context for a new calculation. More...
 
template<typename... Ts>
Hash calculate (Ts &&... args)
 Calculate hash on some data. More...
 
Hash getHash ()
 Finalise and return the final hash value. More...
 
State getState ()
 Get intermediate hash state. More...
 
void setState (const State &state)
 Restore intermediate hash state. More...
 
Update hash over a given block of data
HashContextupdate (const Blob &blob)
 
HashContextupdate (const FSTR::ObjectBase &obj)
 
HashContextupdate (const void *data, size_t size)
 
template<size_t size_>
HashContextupdate (const ByteArray< size_ > &array)
 

Detailed Description

template<class Engine_>
class Crypto::HashContext< Engine_ >

Class template for a Hash implementation 'Context'.

Template Parameters
EngineThe HashEngine implementation

Member Typedef Documentation

◆ Engine

template<class Engine_ >
using Crypto::HashContext< Engine_ >::Engine = Engine_

◆ Hash

template<class Engine_ >
using Crypto::HashContext< Engine_ >::Hash = ByteArray<Engine::hashsize>

Constructor & Destructor Documentation

◆ HashContext()

template<class Engine_ >
Crypto::HashContext< Engine_ >::HashContext ( )
inline

Member Function Documentation

◆ calculate()

template<class Engine_ >
template<typename... Ts>
Hash Crypto::HashContext< Engine_ >::calculate ( Ts &&...  args)
inline

Calculate hash on some data.

Parameters
argsSee update() methods
Return values
Hash

◆ getHash()

template<class Engine_ >
Hash Crypto::HashContext< Engine_ >::getHash ( )
inline

Finalise and return the final hash value.

Return values
Hash

◆ getState()

template<class Engine_ >
State Crypto::HashContext< Engine_ >::getState ( )
inline

Get intermediate hash state.

Parameters
stateOUT: current state
Return values
uint64_tNumber of bytes processed so far

◆ reset()

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::reset ( )
inline

Reset the context for a new calculation.

◆ setState()

template<class Engine_ >
void Crypto::HashContext< Engine_ >::setState ( const State state)
inline

Restore intermediate hash state.

Parameter values obtained via previous getState() call

Parameters
state
count

◆ update() [1/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const Blob blob)
inline

◆ update() [2/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const FSTR::ObjectBase obj)
inline

◆ update() [3/4]

template<class Engine_ >
HashContext& Crypto::HashContext< Engine_ >::update ( const void *  data,
size_t  size 
)
inline

◆ update() [4/4]

template<class Engine_ >
template<size_t size_>
HashContext& Crypto::HashContext< Engine_ >::update ( const ByteArray< size_ > &  array)
inline

The documentation for this class was generated from the following file: