From 5b00026841ab662eb230623aff8cc50b115efdf4 Mon Sep 17 00:00:00 2001 From: dsc Date: Thu, 8 Oct 2020 15:44:09 +0200 Subject: [PATCH] Add support for Wownero --- src/main.cpp | 4 ++-- src/monero_seed.cpp | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index eb652a3..5b8f349 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -94,8 +94,8 @@ int main(int argc, const char* argv[]) { else { std::cout << "Monero 14-word mnemonic seed proof of concept" << std::endl; std::cout << "Usage: " << std::endl; - std::cout << argv[0] << " --create [--date ] [--coin ]" << std::endl; - std::cout << argv[0] << " --restore \"<14-word seed>\" [--coin ]" << std::endl; + std::cout << argv[0] << " --create [--date ] [--coin ]" << std::endl; + std::cout << argv[0] << " --restore \"<14-word seed>\" [--coin ]" << std::endl; } } catch (const std::exception & ex) { diff --git a/src/monero_seed.cpp b/src/monero_seed.cpp index 302ef5f..720c06c 100644 --- a/src/monero_seed.cpp +++ b/src/monero_seed.cpp @@ -59,9 +59,11 @@ constexpr int pbkdf2_iterations = 4096; static const std::string COIN_MONERO = "monero"; static const std::string COIN_AEON = "aeon"; +static const std::string COIN_WOWNERO = "wownero"; constexpr gf_elem monero_flag = gf_elem(0x539); constexpr gf_elem aeon_flag = gf_elem(0x201); +constexpr gf_elem wownero_flag = gf_elem(0x1a4); static const char* KDF_PBKDF2 = "PBKDF2-HMAC-SHA256/4096"; @@ -105,6 +107,9 @@ static gf_elem get_coin_flag(const std::string& coin) { else if (coin == COIN_AEON) { return aeon_flag; } + else if (coin == COIN_WOWNERO) { + return wownero_flag; + } else { THROW_EXCEPTION("invalid coin"); }