diff options
Diffstat (limited to 'src/mnemonics/electrum-words.h')
-rw-r--r-- | src/mnemonics/electrum-words.h | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/src/mnemonics/electrum-words.h b/src/mnemonics/electrum-words.h index 73db652d7..687ac76cf 100644 --- a/src/mnemonics/electrum-words.h +++ b/src/mnemonics/electrum-words.h @@ -26,7 +26,11 @@ // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -/* +/*! + * \file electrum-words.h + * + * \brief Mnemonic seed generation and wallet restoration from them. + * * This file and its cpp file are for translating Electrum-style word lists * into their equivalent byte representations for cross-compatibility with * that method of "backing up" one's wallet keys. @@ -37,14 +41,51 @@ #include <map> #include "crypto/crypto.h" // for declaration of crypto::secret_key +/*! + * \namespace crypto + */ namespace crypto { + /*! + * \namespace ElectrumWords + * + * \brief Mnemonic seed word generation and wallet restoration. + */ namespace ElectrumWords { + /*! + * \brief Called to initialize it work with a word list file. + * \param language Language of the word list file. + * \param old_word_list Whether it is to use the old style word list file. + */ void init(const std::string &language, bool old_word_list=false); + + /*! + * \brief Converts seed words to bytes (secret key). + * \param words String containing the words separated by spaces. + * \param dst To put the secret key restored from the words. + * \return false if not a multiple of 3 words, or if word is not in the words list + */ bool words_to_bytes(const std::string& words, crypto::secret_key& dst); + + /*! + * \brief Converts bytes (secret key) to seed words. + * \param src Secret key + * \param words Space separated words get copied here. + * \return Whether it was successful or not. Unsuccessful if wrong key size. + */ bool bytes_to_words(const crypto::secret_key& src, std::string& words); + + /*! + * \brief Gets a list of seed languages that are supported. + * \param languages The list gets added to this. + */ void get_language_list(std::vector<std::string> &languages); + + /*! + * \brief If the module is currenly using an old style word list. + * \return Whether it is currenly using an old style word list. + */ bool get_is_old_style_mnemonics(); } } |