diff options
Diffstat (limited to 'src/mnemonics/electrum-words.h')
-rw-r--r-- | src/mnemonics/electrum-words.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mnemonics/electrum-words.h b/src/mnemonics/electrum-words.h index 94ce9c200..941768352 100644 --- a/src/mnemonics/electrum-words.h +++ b/src/mnemonics/electrum-words.h @@ -64,6 +64,17 @@ namespace crypto /*! * \brief Converts seed words to bytes (secret key). * \param words String containing the words separated by spaces. + * \param dst To put the secret data restored from the words. + * \param len The number of bytes to expect, 0 if unknown + * \param duplicate If true and len is not zero, we accept half the data, and duplicate it + * \param language_name Language of the seed as found gets written here. + * \return false if not a multiple of 3 words, or if word is not in the words list + */ + bool words_to_bytes(std::string words, std::string& dst, size_t len, bool duplicate, + std::string &language_name); + /*! + * \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. * \param language_name Language of the seed as found gets written here. * \return false if not a multiple of 3 words, or if word is not in the words list @@ -72,6 +83,17 @@ namespace crypto std::string &language_name); /*! + * \brief Converts bytes to seed words. + * \param src Secret data + * \param len Secret data length in bytes (positive multiples of 4 only) + * \param words Space delimited concatenated words get written here. + * \param language_name Seed language name + * \return true if successful false if not. Unsuccessful if wrong key size. + */ + bool bytes_to_words(const char *src, size_t len, std::string& words, + const std::string &language_name); + + /*! * \brief Converts bytes (secret key) to seed words. * \param src Secret key * \param words Space delimited concatenated words get written here. |