Kagome
Polkadot Runtime Engine in C++17
kagome::crypto::HasherImpl Class Reference

#include <hasher_impl.hpp>

Inheritance diagram for kagome::crypto::HasherImpl:
Collaboration diagram for kagome::crypto::HasherImpl:

Public Member Functions

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

Additional Inherited Members

- Protected Types inherited from kagome::crypto::Hasher
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_impl.hpp.

Constructor & Destructor Documentation

kagome::crypto::HasherImpl::~HasherImpl ( )
overridedefault

Member Function Documentation

Hash128 kagome::crypto::HasherImpl::blake2b_128 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

blake2b_128 function calculates 16-byte blake2b hash

Parameters
buffersource value
Returns
128-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 36 of file hasher_impl.cpp.

Hash256 kagome::crypto::HasherImpl::blake2b_256 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

blake2b_256 function calculates 32-byte blake2b hash

Parameters
buffersource value
Returns
256-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 46 of file hasher_impl.cpp.

Hash512 kagome::crypto::HasherImpl::blake2b_512 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

blake2b_512 function calculates 64-byte blake2b hash

Parameters
buffersource value
Returns
512-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 52 of file hasher_impl.cpp.

Hash64 kagome::crypto::HasherImpl::blake2b_64 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

blake2b_64 function calculates 8-byte blake2b hash

Parameters
buffersource value
Returns
64-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 26 of file hasher_impl.cpp.

Hash256 kagome::crypto::HasherImpl::blake2s_256 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

blake2s_256 function calculates 32-byte blake2s hash

Parameters
buffersource value
Returns
256-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 69 of file hasher_impl.cpp.

Hash256 kagome::crypto::HasherImpl::keccak_256 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

keccak_256 function calculates 32-byte keccak hash

Parameters
buffersource value
Returns
256-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 58 of file hasher_impl.cpp.

Hash256 kagome::crypto::HasherImpl::sha2_256 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

sha2_256 function calculates 32-byte sha2-256 hash

Parameters
buffersource value
Returns
256-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 75 of file hasher_impl.cpp.

Hash128 kagome::crypto::HasherImpl::twox_128 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

twox_128 calculates 16-byte twox hash

Parameters
buffersource buffer
Returns
128-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 32 of file hasher_impl.cpp.

Hash256 kagome::crypto::HasherImpl::twox_256 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

twox_256 calculates 32-byte twox hash

Parameters
buffersource buffer
Returns
256-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 42 of file hasher_impl.cpp.

Hash64 kagome::crypto::HasherImpl::twox_64 ( gsl::span< const uint8_t >  buffer) const
overridevirtual

twox_64 calculates 8-byte twox hash

Parameters
buffersource buffer
Returns
64-bit hash value

Implements kagome::crypto::Hasher.

Definition at line 22 of file hasher_impl.cpp.


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