diff --git a/README.md b/README.md index a7eee6041..c890da1a5 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ Besides [Monero](https://getmonero.org), following coins can be mined using this - [Stellite](https://stellite.cash/) - [TurtleCoin](https://turtlecoin.lol) - [Zelerius](https://zelerius.org/) +- [X-CASH](https://x-network.io/) Ryo currency is a way for us to implement the ideas that we were unable to in Monero. See [here](https://github.com/fireice-uk/cryptonote-speedup-demo/) for details. @@ -70,6 +71,7 @@ If your prefered coin is not listed, you can choose one of the following algorit - cryptonight_v7 - cryptonight_v7_stellite - cryptonight_v8 + - cryptonight_v8_double (used by X-CASH) - cryptonight_v8_half (used by masari and stellite) - cryptonight_v8_reversewaltz (used by graft) - cryptonight_v8_zelerius diff --git a/xmrstak/backend/cpu/minethd.cpp b/xmrstak/backend/cpu/minethd.cpp index 2e6d7d1be..e90b59500 100644 --- a/xmrstak/backend/cpu/minethd.cpp +++ b/xmrstak/backend/cpu/minethd.cpp @@ -473,11 +473,21 @@ bool minethd::self_test() { func_selector(ctx, ::jconf::inst()->HaveHardwareAes(), false, algo); ctx[0]->hash_fn("This is a test This is a test This is a test", 44, out, ctx, algo); - bResult = memcmp(out, "\x32\xf7\x36\xec\x1d\x2f\x3f\xc5\x4c\x49\xbe\xb8\xa0\x47\x6c\xbf\xdd\x14\xc3\x51\xb9\xc6\xd7\x2c\x6f\x9f\xfc\xb5\x87\x5b\xe6\xb3", 32) == 0; + bResult = bResult && memcmp(out, "\x32\xf7\x36\xec\x1d\x2f\x3f\xc5\x4c\x49\xbe\xb8\xa0\x47\x6c\xbf\xdd\x14\xc3\x51\xb9\xc6\xd7\x2c\x6f\x9f\xfc\xb5\x87\x5b\xe6\xb3", 32) == 0; func_selector(ctx, ::jconf::inst()->HaveHardwareAes(), true, algo); ctx[0]->hash_fn("This is a test This is a test This is a test", 44, out, ctx, algo); - bResult &= memcmp(out, "\x32\xf7\x36\xec\x1d\x2f\x3f\xc5\x4c\x49\xbe\xb8\xa0\x47\x6c\xbf\xdd\x14\xc3\x51\xb9\xc6\xd7\x2c\x6f\x9f\xfc\xb5\x87\x5b\xe6\xb3", 32) == 0; + bResult = bResult && memcmp(out, "\x32\xf7\x36\xec\x1d\x2f\x3f\xc5\x4c\x49\xbe\xb8\xa0\x47\x6c\xbf\xdd\x14\xc3\x51\xb9\xc6\xd7\x2c\x6f\x9f\xfc\xb5\x87\x5b\xe6\xb3", 32) == 0; + } + else if(algo == POW(cryptonight_v8_double)) + { + func_selector(ctx, ::jconf::inst()->HaveHardwareAes(), false, algo); + ctx[0]->hash_fn("This is a test This is a test This is a test", 44, out, ctx, algo); + bResult = bResult && memcmp(out, "\x63\x43\x8e\xd\x5c\x18\xff\xca\xd5\xb5\xdf\xe0\x26\x8a\x5b\x3f\xe9\xbc\x1\xef\xe6\x3a\xd3\x4f\x2c\x57\x1c\xda\xb2\xc\x32\x31", 32) == 0; + + func_selector(ctx, ::jconf::inst()->HaveHardwareAes(), true, algo); + ctx[0]->hash_fn("This is a test This is a test This is a test", 44, out, ctx, algo); + bResult = bResult && memcmp(out, "\x63\x43\x8e\xd\x5c\x18\xff\xca\xd5\xb5\xdf\xe0\x26\x8a\x5b\x3f\xe9\xbc\x1\xef\xe6\x3a\xd3\x4f\x2c\x57\x1c\xda\xb2\xc\x32\x31", 32) == 0; } else printer::inst()->print_msg(L0, diff --git a/xmrstak/backend/cryptonight.hpp b/xmrstak/backend/cryptonight.hpp index 4f5d88dea..e58665922 100644 --- a/xmrstak/backend/cryptonight.hpp +++ b/xmrstak/backend/cryptonight.hpp @@ -30,7 +30,8 @@ enum xmrstak_algo_id cryptonight_turtle = start_derived_algo_id, cryptonight_v8_half = (start_derived_algo_id + 1), - cryptonight_v8_zelerius = (start_derived_algo_id + 2) + cryptonight_v8_zelerius = (start_derived_algo_id + 2), + cryptonight_v8_double = (start_derived_algo_id + 3) // please add the algorithm name to get_algo_name() }; @@ -62,11 +63,12 @@ inline std::string get_algo_name(xmrstak_algo_id algo_id) "cryptonight_v8_reversewaltz" // used by graft }}; - static std::array derived_algo_names = + static std::array derived_algo_names = {{ "cryptonight_turtle", "cryptonight_v8_half", // used by masari and stellite - "cryptonight_v8_zelerius" + "cryptonight_v8_zelerius", + "cryptonight_v8_double" }}; @@ -181,6 +183,8 @@ constexpr uint32_t CN_ZELERIUS_ITER = 0x60000; constexpr uint32_t CN_WALTZ_ITER = 0x60000; +constexpr uint32_t CN_DOUBLE_ITER = 0x100000; + inline xmrstak_algo POW(xmrstak_algo_id algo_id) { static std::array pow = {{ @@ -204,11 +208,12 @@ inline xmrstak_algo POW(xmrstak_algo_id algo_id) {cryptonight_v8_reversewaltz, cryptonight_v8_reversewaltz, CN_WALTZ_ITER, CN_MEMORY} }}; - static std::array derived_pow = + static std::array derived_pow = {{ {cryptonight_turtle, cryptonight_monero_v8, CN_ITER/8, CN_MEMORY/8, CN_TURTLE_MASK}, {cryptonight_v8_half, cryptonight_monero_v8, CN_ITER/2, CN_MEMORY}, - {cryptonight_v8_zelerius, cryptonight_monero_v8, CN_ZELERIUS_ITER, CN_MEMORY} + {cryptonight_v8_zelerius, cryptonight_monero_v8, CN_ZELERIUS_ITER, CN_MEMORY}, + {cryptonight_v8_double, cryptonight_monero_v8, CN_DOUBLE_ITER, CN_MEMORY} // {cryptonight_derived} }}; diff --git a/xmrstak/jconf.cpp b/xmrstak/jconf.cpp index 1c7243263..5e3384a63 100644 --- a/xmrstak/jconf.cpp +++ b/xmrstak/jconf.cpp @@ -103,6 +103,7 @@ xmrstak::coin_selection coins[] = { { "cryptonight_turtle", {POW(cryptonight_turtle)}, {POW(cryptonight_turtle)}, nullptr }, { "cryptonight_v7", {POW(cryptonight_monero)}, {POW(cryptonight_gpu)}, nullptr }, { "cryptonight_v8", {POW(cryptonight_monero_v8)}, {POW(cryptonight_r)}, nullptr }, + { "cryptonight_v8_double", {POW(cryptonight_v8_double)}, {POW(cryptonight_gpu)}, nullptr }, { "cryptonight_v8_half", {POW(cryptonight_v8_half)}, {POW(cryptonight_gpu)}, nullptr }, { "cryptonight_v8_reversewaltz", {POW(cryptonight_v8_reversewaltz)}, {POW(cryptonight_gpu)}, nullptr }, { "cryptonight_v8_zelerius", {POW(cryptonight_v8_zelerius)},{POW(cryptonight_gpu)}, nullptr }, @@ -120,7 +121,8 @@ xmrstak::coin_selection coins[] = { { "stellite", {POW(cryptonight_v8_half)}, {POW(cryptonight_gpu)}, nullptr }, { "turtlecoin", {POW(cryptonight_turtle), 6u,POW(cryptonight_aeon)}, {POW(cryptonight_aeon)}, nullptr }, { "plenteum", {POW(cryptonight_turtle)}, {POW(cryptonight_turtle)}, nullptr }, - { "zelerius", {POW(cryptonight_v8_zelerius), 7, POW(cryptonight_monero_v8)}, {POW(cryptonight_gpu)}, nullptr } + { "zelerius", {POW(cryptonight_v8_zelerius), 7, POW(cryptonight_monero_v8)}, {POW(cryptonight_gpu)}, nullptr }, + { "xcash", {POW(cryptonight_v8_double)}, {POW(cryptonight_gpu)}, nullptr } }; constexpr size_t coin_algo_size = (sizeof(coins)/sizeof(coins[0])); diff --git a/xmrstak/pools.tpl b/xmrstak/pools.tpl index b1fd0e70b..ea3a276aa 100644 --- a/xmrstak/pools.tpl +++ b/xmrstak/pools.tpl @@ -32,6 +32,7 @@ POOLCONF], * ryo * turtlecoin * plenteum + * xcash * * Native algorithms which do not depend on any block versions: * @@ -47,6 +48,7 @@ POOLCONF], * cryptonight_superfast * cryptonight_v7 * cryptonight_v8 + * cryptonight_v8_double (used by xcash) * cryptonight_v8_half (used by masari and stellite) * cryptonight_v8_reversewaltz (used by graft) * cryptonight_v8_zelerius