diff --git a/src/backend/cpu/CpuConfig_gen.h b/src/backend/cpu/CpuConfig_gen.h index d28cc955a..28b1cefdd 100644 --- a/src/backend/cpu/CpuConfig_gen.h +++ b/src/backend/cpu/CpuConfig_gen.h @@ -126,6 +126,11 @@ size_t inline generate(Threads &threads, uint32 count += threads.move(Algorithm::kRX_WOW, std::move(wow)); } + if (!threads.isExist(Algorithm::RX_YADA)) { + auto yada = cpuInfo->threads(Algorithm::RX_YADA, limit); + count += threads.move(Algorithm::kRX_YADA, std::move(yada)); + } + count += generate(Algorithm::kRX, threads, Algorithm::RX_0, limit); return count; diff --git a/src/base/crypto/Algorithm.cpp b/src/base/crypto/Algorithm.cpp index b7ea908aa..e7c4f5513 100644 --- a/src/base/crypto/Algorithm.cpp +++ b/src/base/crypto/Algorithm.cpp @@ -81,6 +81,7 @@ const char *Algorithm::kRX_WOW = "rx/wow"; const char *Algorithm::kRX_ARQ = "rx/arq"; const char *Algorithm::kRX_GRAFT = "rx/graft"; const char *Algorithm::kRX_SFX = "rx/sfx"; +const char *Algorithm::kRX_YADA = "rx/yada"; #endif #ifdef XMRIG_ALGO_ARGON2 @@ -146,6 +147,7 @@ static const std::map kAlgorithmNames = { ALGO_NAME(RX_ARQ), ALGO_NAME(RX_GRAFT), ALGO_NAME(RX_SFX), + ALGO_NAME(RX_YADA), # endif # ifdef XMRIG_ALGO_ARGON2 @@ -259,6 +261,8 @@ static const std::map kAlgorithmAlias ALGO_ALIAS(RX_GRAFT, "randomgraft"), ALGO_ALIAS_AUTO(RX_SFX), ALGO_ALIAS(RX_SFX, "randomx/sfx"), ALGO_ALIAS(RX_SFX, "randomsfx"), + ALGO_ALIAS_AUTO(RX_YADA), ALGO_ALIAS(RX_YADA, "randomx/yada"), + ALGO_ALIAS(RX_YADA, "randomyada"), # endif # ifdef XMRIG_ALGO_ARGON2 @@ -346,7 +350,7 @@ std::vector xmrig::Algorithm::all(const std::function(raw.data()))); - } - else if (size == 8) { - m_target = *reinterpret_cast(raw.data()); + if (algorithm() == Algorithm::RX_YADA) { + m_target = strtoull(target, nullptr, 16); } else { - return false; + if (size == 4) { + m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast(raw.data()))); + } + else if (size == 8) { + m_target = *reinterpret_cast(raw.data()); + } + else { + return false; + } } # ifdef XMRIG_PROXY_PROJECT @@ -176,6 +180,7 @@ int32_t xmrig::Job::nonceOffset() const auto f = algorithm().family(); if (f == Algorithm::KAWPOW) return 32; if (f == Algorithm::GHOSTRIDER) return 76; + if (f == Algorithm::RX_YADA) return 147; return 39; } diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index 7e0e50cd5..adfec8a9b 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -100,6 +100,13 @@ RandomX_ConfigurationSafex::RandomX_ConfigurationSafex() ArgonSalt = "RandomSFX\x01"; } +RandomX_ConfigurationYada::RandomX_ConfigurationYada() +{ + ArgonSalt = "RandomXYadaCoin\x03"; + SuperscalarLatency = 150; + ArgonIterations = 4; +} + RandomX_ConfigurationBase::RandomX_ConfigurationBase() : ArgonIterations(3) , ArgonLanes(1) @@ -350,6 +357,7 @@ RandomX_ConfigurationWownero RandomX_WowneroConfig; RandomX_ConfigurationArqma RandomX_ArqmaConfig; RandomX_ConfigurationGraft RandomX_GraftConfig; RandomX_ConfigurationSafex RandomX_SafexConfig; +RandomX_ConfigurationYada RandomX_YadaConfig; alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/randomx/randomx.h b/src/crypto/randomx/randomx.h index 80aad66b6..6e7875a9b 100644 --- a/src/crypto/randomx/randomx.h +++ b/src/crypto/randomx/randomx.h @@ -146,12 +146,14 @@ struct RandomX_ConfigurationWownero : public RandomX_ConfigurationBase { RandomX struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_ConfigurationArqma(); }; struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_ConfigurationGraft(); }; struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); }; +struct RandomX_ConfigurationYada : public RandomX_ConfigurationBase { RandomX_ConfigurationYada(); }; extern RandomX_ConfigurationMonero RandomX_MoneroConfig; extern RandomX_ConfigurationWownero RandomX_WowneroConfig; extern RandomX_ConfigurationArqma RandomX_ArqmaConfig; extern RandomX_ConfigurationGraft RandomX_GraftConfig; extern RandomX_ConfigurationSafex RandomX_SafexConfig; +extern RandomX_ConfigurationYada RandomX_YadaConfig; extern RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/rx/RxAlgo.cpp b/src/crypto/rx/RxAlgo.cpp index 7399afe75..0de9694be 100644 --- a/src/crypto/rx/RxAlgo.cpp +++ b/src/crypto/rx/RxAlgo.cpp @@ -44,6 +44,9 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm) case Algorithm::RX_SFX: return &RandomX_SafexConfig; + case Algorithm::RX_YADA: + return &RandomX_YadaConfig; + default: break; }