Skip to content

src/crypto/bip39/dictionary.hpp

Namespaces

Name
sgns
sgns::crypto
sgns::crypto::bip39

Classes

Name
class sgns::crypto::bip39::Dictionary
Stores the BIP-39 word list and maps words to entropy tokens.

Types

Name
enum class DictionaryError

Functions

Name
OUTCOME_HPP_DECLARE_ERROR_2(sgns::crypto::bip39 , DictionaryError )

Types Documentation

enum DictionaryError

Enumerator Value Description
ENTRY_NOT_FOUND 1

Functions Documentation

function OUTCOME_HPP_DECLARE_ERROR_2

OUTCOME_HPP_DECLARE_ERROR_2(
    sgns::crypto::bip39 ,
    DictionaryError 
)

Source code

#ifndef SUPERGENIUS_CRYPTO_BIP39_DICTIONARIES_HPP
#define SUPERGENIUS_CRYPTO_BIP39_DICTIONARIES_HPP

#include "crypto/bip39/entropy_accumulator.hpp"
#include "outcome/outcome.hpp"

#include <unordered_map>

namespace sgns::crypto::bip39 {

  enum class DictionaryError {
    ENTRY_NOT_FOUND = 1,
  };

  class Dictionary {
   public:
    void initialize();

    outcome::result<EntropyToken> findValue(std::string_view word);

   private:
    std::unordered_map<std::string_view, EntropyToken> entropy_map_;
  };
}  // namespace sgns::crypto::bip39

OUTCOME_HPP_DECLARE_ERROR_2(sgns::crypto::bip39, DictionaryError);

#endif  // SUPERGENIUS_CRYPTO_BIP39_DICTIONARIES_HPP

Updated on 2026-03-04 at 13:10:44 -0800