Merge pull request 'Add support for Wownero' (#2) from wownero into master

Reviewed-on: https://git.wownero.com/feather/monero-seed/pulls/2
This commit is contained in:
dsc 2020-10-08 13:49:49 +00:00
commit a4d800fc17
2 changed files with 7 additions and 2 deletions

View file

@ -94,8 +94,8 @@ int main(int argc, const char* argv[]) {
else { else {
std::cout << "Monero 14-word mnemonic seed proof of concept" << std::endl; std::cout << "Monero 14-word mnemonic seed proof of concept" << std::endl;
std::cout << "Usage: " << std::endl; std::cout << "Usage: " << std::endl;
std::cout << argv[0] << " --create [--date <yyyy-MM-dd>] [--coin <monero|aeon>]" << std::endl; std::cout << argv[0] << " --create [--date <yyyy-MM-dd>] [--coin <monero|aeon|wownero>]" << std::endl;
std::cout << argv[0] << " --restore \"<14-word seed>\" [--coin <monero|aeon>]" << std::endl; std::cout << argv[0] << " --restore \"<14-word seed>\" [--coin <monero|aeon|wownero>]" << std::endl;
} }
} }
catch (const std::exception & ex) { catch (const std::exception & ex) {

View file

@ -59,9 +59,11 @@ constexpr int pbkdf2_iterations = 4096;
static const std::string COIN_MONERO = "monero"; static const std::string COIN_MONERO = "monero";
static const std::string COIN_AEON = "aeon"; 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 monero_flag = gf_elem(0x539);
constexpr gf_elem aeon_flag = gf_elem(0x201); 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"; 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) { else if (coin == COIN_AEON) {
return aeon_flag; return aeon_flag;
} }
else if (coin == COIN_WOWNERO) {
return wownero_flag;
}
else { else {
THROW_EXCEPTION("invalid coin"); THROW_EXCEPTION("invalid coin");
} }