Kagome
Polkadot Runtime Engine in C++17
bip39_provider.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_BIP39_PROVIDER_HPP
7 #define KAGOME_BIP39_PROVIDER_HPP
8 
9 #include "common/buffer.hpp"
11 
12 namespace kagome::crypto {
13 
17  class Bip39Provider {
18  public:
19  virtual ~Bip39Provider() = default;
20 
26  virtual outcome::result<std::vector<uint8_t>> calculateEntropy(
27  const std::vector<std::string> &word_list) const = 0;
28 
34  virtual outcome::result<bip39::Bip39Seed> makeSeed(
35  gsl::span<const uint8_t> entropy, std::string_view password) const = 0;
36 
37  virtual outcome::result<bip39::Bip39Seed> generateSeed(
38  std::string_view mnemonic_phrase) const = 0;
39  };
40 
41 } // namespace kagome::crypto
42 
43 #endif // KAGOME_BIP39_PROVIDER_HPP
virtual outcome::result< bip39::Bip39Seed > generateSeed(std::string_view mnemonic_phrase) const =0
virtual outcome::result< bip39::Bip39Seed > makeSeed(gsl::span< const uint8_t > entropy, std::string_view password) const =0
makes seed from entropy
virtual ~Bip39Provider()=default
virtual outcome::result< std::vector< uint8_t > > calculateEntropy(const std::vector< std::string > &word_list) const =0
calculates entropy from mnemonic