1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-01-18 21:22:50 -05:00

Add "rx/yada" algorithm

This commit is contained in:
Matt Vogel
2021-12-10 13:49:40 -08:00
parent 5b8501fb57
commit 8c9b48851e
23 changed files with 3909 additions and 3659 deletions

View File

@@ -111,14 +111,22 @@ bool xmrig::Job::setTarget(const char *target)
const auto raw = Cvt::fromHex(target, strlen(target));
const size_t size = raw.size();
if (size == 4) {
m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast<const uint32_t *>(raw.data())));
# ifdef XMRIG_ALGO_RX_YADA
if (algorithm() == Algorithm::RX_YADA) {
m_target = strtoull(target, nullptr, 16);
}
else if (size == 8) {
m_target = *reinterpret_cast<const uint64_t *>(raw.data());
}
else {
return false;
else
# endif
{
if (size == 4) {
m_target = 0xFFFFFFFFFFFFFFFFULL / (0xFFFFFFFFULL / uint64_t(*reinterpret_cast<const uint32_t *>(raw.data())));
}
else if (size == 8) {
m_target = *reinterpret_cast<const uint64_t *>(raw.data());
}
else {
return false;
}
}
# ifdef XMRIG_PROXY_PROJECT