Kagome
Polkadot Runtime Engine in C++17
hasher_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_CORE_CRYPTO_HASHER_HASHER_IMPL_HPP_
7 #define KAGOME_CORE_CRYPTO_HASHER_HASHER_IMPL_HPP_
8 
9 #include "crypto/hasher.hpp"
10 
11 namespace kagome::crypto {
12 
13  class HasherImpl : public Hasher {
14  public:
15  ~HasherImpl() override = default;
16 
17  Hash64 twox_64(gsl::span<const uint8_t> buffer) const override;
18 
19  Hash64 blake2b_64(gsl::span<const uint8_t> buffer) const override;
20 
21  Hash128 twox_128(gsl::span<const uint8_t> buffer) const override;
22 
23  Hash128 blake2b_128(gsl::span<const uint8_t> buffer) const override;
24 
25  Hash256 twox_256(gsl::span<const uint8_t> buffer) const override;
26 
27  Hash256 blake2b_256(gsl::span<const uint8_t> buffer) const override;
28 
29  Hash256 keccak_256(gsl::span<const uint8_t> buffer) const override;
30 
31  Hash256 blake2s_256(gsl::span<const uint8_t> buffer) const override;
32 
33  Hash256 sha2_256(gsl::span<const uint8_t> buffer) const override;
34 
35  Hash512 blake2b_512(gsl::span<const uint8_t> buffer) const override;
36  };
37 
38 } // namespace kagome::crypto
39 
40 #endif // KAGOME_CORE_CRYPTO_HASHER_HASHER_IMPL_HPP_
Hash128 twox_128(gsl::span< const uint8_t > buffer) const override
twox_128 calculates 16-byte twox hash
Definition: hasher_impl.cpp:32
Hash256 twox_256(gsl::span< const uint8_t > buffer) const override
twox_256 calculates 32-byte twox hash
Definition: hasher_impl.cpp:42
Hash64 twox_64(gsl::span< const uint8_t > buffer) const override
twox_64 calculates 8-byte twox hash
Definition: hasher_impl.cpp:22
~HasherImpl() override=default
Hash256 blake2s_256(gsl::span< const uint8_t > buffer) const override
blake2s_256 function calculates 32-byte blake2s hash
Definition: hasher_impl.cpp:69
Hash256 sha2_256(gsl::span< const uint8_t > buffer) const override
sha2_256 function calculates 32-byte sha2-256 hash
Definition: hasher_impl.cpp:75
Hash512 blake2b_512(gsl::span< const uint8_t > buffer) const override
blake2b_512 function calculates 64-byte blake2b hash
Definition: hasher_impl.cpp:52
Hash128 blake2b_128(gsl::span< const uint8_t > buffer) const override
blake2b_128 function calculates 16-byte blake2b hash
Definition: hasher_impl.cpp:36
Hash256 keccak_256(gsl::span< const uint8_t > buffer) const override
keccak_256 function calculates 32-byte keccak hash
Definition: hasher_impl.cpp:58
Hash64 blake2b_64(gsl::span< const uint8_t > buffer) const override
blake2b_64 function calculates 8-byte blake2b hash
Definition: hasher_impl.cpp:26
Hash256 blake2b_256(gsl::span< const uint8_t > buffer) const override
blake2b_256 function calculates 32-byte blake2b hash
Definition: hasher_impl.cpp:46