Kagome
Polkadot Runtime Engine in C++17
bip39_provider_impl.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_BIP39_PROVIDER_IMPL_HPP
7 #define KAGOME_BIP39_PROVIDER_IMPL_HPP
8 
11 
13 #include "log/logger.hpp"
14 
15 namespace kagome::crypto {
17  public:
18  ~Bip39ProviderImpl() override = default;
19 
20  explicit Bip39ProviderImpl(std::shared_ptr<Pbkdf2Provider> pbkdf2_provider);
21 
22  outcome::result<std::vector<uint8_t>> calculateEntropy(
23  const std::vector<std::string> &word_list) const override;
24 
25  outcome::result<bip39::Bip39Seed> makeSeed(
26  gsl::span<const uint8_t> entropy,
27  std::string_view password) const override;
28 
29  outcome::result<bip39::Bip39Seed> generateSeed(
30  std::string_view mnemonic_phrase) const override;
31 
32  private:
33  std::shared_ptr<Pbkdf2Provider> pbkdf2_provider_;
36  };
37 } // namespace kagome::crypto
38 
39 #endif // KAGOME_BIP39_PROVIDER_IMPL_HPP
Bip39ProviderImpl(std::shared_ptr< Pbkdf2Provider > pbkdf2_provider)
outcome::result< bip39::Bip39Seed > makeSeed(gsl::span< const uint8_t > entropy, std::string_view password) const override
makes seed from entropy
~Bip39ProviderImpl() override=default
outcome::result< bip39::Bip39Seed > generateSeed(std::string_view mnemonic_phrase) const override
std::shared_ptr< soralog::Logger > Logger
Definition: logger.hpp:23
std::shared_ptr< Pbkdf2Provider > pbkdf2_provider_
outcome::result< std::vector< uint8_t > > calculateEntropy(const std::vector< std::string > &word_list) const override
calculates entropy from mnemonic