Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::Hasher Class Referenceabstract

#include <hasher.hpp>

Inheritance diagram for kagome::crypto::Hasher:
Collaboration diagram for kagome::crypto::Hasher:

Public Member Functions

virtual ~Hasher ()=default
 
virtual Hash64 twox_64 (gsl::span< const uint8_t > buffer) const =0
 twox_64 calculates 8-byte twox hash More...
 
virtual Hash64 blake2b_64 (gsl::span< const uint8_t > buffer) const =0
 blake2b_64 function calculates 8-byte blake2b hash More...
 
virtual Hash128 twox_128 (gsl::span< const uint8_t > buffer) const =0
 twox_128 calculates 16-byte twox hash More...
 
virtual Hash128 blake2b_128 (gsl::span< const uint8_t > buffer) const =0
 blake2b_128 function calculates 16-byte blake2b hash More...
 
virtual Hash256 twox_256 (gsl::span< const uint8_t > buffer) const =0
 twox_256 calculates 32-byte twox hash More...
 
virtual Hash256 blake2b_256 (gsl::span< const uint8_t > buffer) const =0
 blake2b_256 function calculates 32-byte blake2b hash More...
 
virtual Hash512 blake2b_512 (gsl::span< const uint8_t > buffer) const =0
 blake2b_512 function calculates 64-byte blake2b hash More...
 
virtual Hash256 keccak_256 (gsl::span< const uint8_t > buffer) const =0
 keccak_256 function calculates 32-byte keccak hash More...
 
virtual Hash256 blake2s_256 (gsl::span< const uint8_t > buffer) const =0
 blake2s_256 function calculates 32-byte blake2s hash More...
 
virtual Hash256 sha2_256 (gsl::span< const uint8_t > buffer) const =0
 sha2_256 function calculates 32-byte sha2-256 hash More...
 

Protected Types

using Hash64 = common::Hash64
 
using Hash128 = common::Hash128
 
using Hash256 = common::Hash256
 
using Hash512 = common::Hash512
 

Detailed Description

Definition at line 13 of file hasher.hpp.

Member Typedef Documentation

Definition at line 16 of file hasher.hpp.

Definition at line 17 of file hasher.hpp.

Definition at line 18 of file hasher.hpp.

Definition at line 15 of file hasher.hpp.

Constructor & Destructor Documentation

virtual kagome::crypto::Hasher::~Hasher ( )
virtualdefault

Member Function Documentation

virtual Hash128 kagome::crypto::Hasher::blake2b_128 ( gsl::span< const uint8_t >  buffer) const
pure virtual

blake2b_128 function calculates 16-byte blake2b hash

Parameters
buffersource value
Returns
128-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash256 kagome::crypto::Hasher::blake2b_256 ( gsl::span< const uint8_t >  buffer) const
pure virtual

blake2b_256 function calculates 32-byte blake2b hash

Parameters
buffersource value
Returns
256-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash512 kagome::crypto::Hasher::blake2b_512 ( gsl::span< const uint8_t >  buffer) const
pure virtual

blake2b_512 function calculates 64-byte blake2b hash

Parameters
buffersource value
Returns
512-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash64 kagome::crypto::Hasher::blake2b_64 ( gsl::span< const uint8_t >  buffer) const
pure virtual

blake2b_64 function calculates 8-byte blake2b hash

Parameters
buffersource value
Returns
64-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash256 kagome::crypto::Hasher::blake2s_256 ( gsl::span< const uint8_t >  buffer) const
pure virtual

blake2s_256 function calculates 32-byte blake2s hash

Parameters
buffersource value
Returns
256-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash256 kagome::crypto::Hasher::keccak_256 ( gsl::span< const uint8_t >  buffer) const
pure virtual

keccak_256 function calculates 32-byte keccak hash

Parameters
buffersource value
Returns
256-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash256 kagome::crypto::Hasher::sha2_256 ( gsl::span< const uint8_t >  buffer) const
pure virtual

sha2_256 function calculates 32-byte sha2-256 hash

Parameters
buffersource value
Returns
256-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash128 kagome::crypto::Hasher::twox_128 ( gsl::span< const uint8_t >  buffer) const
pure virtual

twox_128 calculates 16-byte twox hash

Parameters
buffersource buffer
Returns
128-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash256 kagome::crypto::Hasher::twox_256 ( gsl::span< const uint8_t >  buffer) const
pure virtual

twox_256 calculates 32-byte twox hash

Parameters
buffersource buffer
Returns
256-bit hash value

Implemented in kagome::crypto::HasherImpl.

virtual Hash64 kagome::crypto::Hasher::twox_64 ( gsl::span< const uint8_t >  buffer) const
pure virtual

twox_64 calculates 8-byte twox hash

Parameters
buffersource buffer
Returns
64-bit hash value

Implemented in kagome::crypto::HasherImpl.


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