From 6fc90cefbcf20cb24fef2dd42b200c5753e50d7e Mon Sep 17 00:00:00 2001 From: FSOL-XDAG <128682335+FSOL-XDAG@users.noreply.github.com> Date: Tue, 4 Apr 2023 23:07:53 +0200 Subject: [PATCH] 6.19.2 update --- src/base/net/stratum/Job.cpp | 17 +++-- src/crypto/rx/RxAlgo.h | 124 +++++++++++++++++------------------ src/version.h | 4 +- 3 files changed, 77 insertions(+), 68 deletions(-) diff --git a/src/base/net/stratum/Job.cpp b/src/base/net/stratum/Job.cpp index 058e0f796e..b77ce477ea 100644 --- a/src/base/net/stratum/Job.cpp +++ b/src/base/net/stratum/Job.cpp @@ -247,6 +247,7 @@ void xmrig::Job::copy(const Job &other) m_minerTxExtraNonceOffset = other.m_minerTxExtraNonceOffset; m_minerTxExtraNonceSize = other.m_minerTxExtraNonceSize; m_minerTxMerkleTreeBranch = other.m_minerTxMerkleTreeBranch; + m_hasViewTag = other.m_hasViewTag; # else memcpy(m_ephPublicKey, other.m_ephPublicKey, sizeof(m_ephPublicKey)); memcpy(m_ephSecretKey, other.m_ephSecretKey, sizeof(m_ephSecretKey)); @@ -302,6 +303,7 @@ void xmrig::Job::move(Job &&other) m_minerTxExtraNonceOffset = other.m_minerTxExtraNonceOffset; m_minerTxExtraNonceSize = other.m_minerTxExtraNonceSize; m_minerTxMerkleTreeBranch = std::move(other.m_minerTxMerkleTreeBranch); + m_hasViewTag = other.m_hasViewTag; # else memcpy(m_ephPublicKey, other.m_ephPublicKey, sizeof(m_ephPublicKey)); memcpy(m_ephSecretKey, other.m_ephSecretKey, sizeof(m_ephSecretKey)); @@ -325,7 +327,7 @@ void xmrig::Job::setSpendSecretKey(const uint8_t *key) } -void xmrig::Job::setMinerTx(const uint8_t *begin, const uint8_t *end, size_t minerTxEphPubKeyOffset, size_t minerTxPubKeyOffset, size_t minerTxExtraNonceOffset, size_t minerTxExtraNonceSize, const Buffer &minerTxMerkleTreeBranch) +void xmrig::Job::setMinerTx(const uint8_t *begin, const uint8_t *end, size_t minerTxEphPubKeyOffset, size_t minerTxPubKeyOffset, size_t minerTxExtraNonceOffset, size_t minerTxExtraNonceSize, const Buffer &minerTxMerkleTreeBranch, bool hasViewTag) { m_minerTxPrefix.assign(begin, end); m_minerTxEphPubKeyOffset = minerTxEphPubKeyOffset; @@ -333,6 +335,13 @@ void xmrig::Job::setMinerTx(const uint8_t *begin, const uint8_t *end, size_t min m_minerTxExtraNonceOffset = minerTxExtraNonceOffset; m_minerTxExtraNonceSize = minerTxExtraNonceSize; m_minerTxMerkleTreeBranch = minerTxMerkleTreeBranch; + m_hasViewTag = hasViewTag; +} + + +void xmrig::Job::setViewTagInMinerTx(uint8_t view_tag) +{ + memcpy(m_minerTxPrefix.data() + m_minerTxEphPubKeyOffset + 32, &view_tag, 1); } @@ -342,7 +351,7 @@ void xmrig::Job::setExtraNonceInMinerTx(uint32_t extra_nonce) } -void xmrig::Job::generateSignatureData(String &signatureData) const +void xmrig::Job::generateSignatureData(String &signatureData, uint8_t& view_tag) const { uint8_t* eph_public_key = m_minerTxPrefix.data() + m_minerTxEphPubKeyOffset; uint8_t* txkey_pub = m_minerTxPrefix.data() + m_minerTxPubKeyOffset; @@ -353,14 +362,14 @@ void xmrig::Job::generateSignatureData(String &signatureData) const uint8_t derivation[32]; - generate_key_derivation(m_viewPublicKey, txkey_sec, derivation); + generate_key_derivation(m_viewPublicKey, txkey_sec, derivation, &view_tag); derive_public_key(derivation, 0, m_spendPublicKey, eph_public_key); uint8_t buf[32 * 3] = {}; memcpy(buf, txkey_pub, 32); memcpy(buf + 32, eph_public_key, 32); - generate_key_derivation(txkey_pub, m_viewSecretKey, derivation); + generate_key_derivation(txkey_pub, m_viewSecretKey, derivation, nullptr); derive_secret_key(derivation, 0, m_spendSecretKey, buf + 64); signatureData = Cvt::toHex(buf, sizeof(buf)); diff --git a/src/crypto/rx/RxAlgo.h b/src/crypto/rx/RxAlgo.h index 0e6544d8c5..fe6ef3d281 100644 --- a/src/crypto/rx/RxAlgo.h +++ b/src/crypto/rx/RxAlgo.h @@ -1,62 +1,62 @@ -/* XMRig - * Copyright (c) 2018-2019 tevador - * Copyright (c) 2018-2021 SChernykh - * Copyright (c) 2016-2021 XMRig , - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef XMRIG_RX_ALGO_H -#define XMRIG_RX_ALGO_H - - -#include -#include - - -#include "base/crypto/Algorithm.h" - - -struct RandomX_ConfigurationBase; - - -namespace xmrig -{ - - -class RxAlgo -{ -public: - static Algorithm::Id apply(Algorithm::Id algorithm); - static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm); - static uint32_t programCount(Algorithm::Id algorithm); - static uint32_t programIterations(Algorithm::Id algorithm); - static uint32_t programSize(Algorithm::Id algorithm); - static uint32_t version(Algorithm::Id algorithm); - - static inline Algorithm::Id id(Algorithm::Id algorithm) - { - if (algorithm == Algorithm::RX_SFX || algorithm == Algorithm::RX_XDAG) { - return Algorithm::RX_0; - } - - return algorithm; - } -}; - - -} /* namespace xmrig */ - - -#endif /* XMRIG_RX_ALGO_H */ +/* XMRig + * Copyright (c) 2018-2019 tevador + * Copyright (c) 2018-2021 SChernykh + * Copyright (c) 2016-2021 XMRig , + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef XMRIG_RX_ALGO_H +#define XMRIG_RX_ALGO_H + + +#include +#include + + +#include "base/crypto/Algorithm.h" + + +struct RandomX_ConfigurationBase; + + +namespace xmrig +{ + + +class RxAlgo +{ +public: + static Algorithm::Id apply(Algorithm::Id algorithm); + static const RandomX_ConfigurationBase *base(Algorithm::Id algorithm); + static uint32_t programCount(Algorithm::Id algorithm); + static uint32_t programIterations(Algorithm::Id algorithm); + static uint32_t programSize(Algorithm::Id algorithm); + static uint32_t version(Algorithm::Id algorithm); + + static inline Algorithm::Id id(Algorithm::Id algorithm) + { + if (algorithm == Algorithm::RX_SFX || algorithm == Algorithm::RX_XDAG) { + return Algorithm::RX_0; + } + + return algorithm; + } +}; + + +} /* namespace xmrig */ + + +#endif /* XMRIG_RX_ALGO_H */ diff --git a/src/version.h b/src/version.h index 7e68405b18..ff18df51cc 100644 --- a/src/version.h +++ b/src/version.h @@ -22,7 +22,7 @@ #define APP_ID "xmrig-4-xdag" #define APP_NAME "XMRig-4-XDAG" #define APP_DESC "XMRig-4-XDAG miner" -#define APP_VERSION "6.19.1" +#define APP_VERSION "6.19.2" #define APP_DOMAIN "xdag.io" #define APP_SITE "www.xdag.io" #define APP_COPYRIGHT "Copyright (C) 2016-2023 xmrig.com / xdag.io" @@ -30,7 +30,7 @@ #define APP_VER_MAJOR 6 #define APP_VER_MINOR 19 -#define APP_VER_PATCH 1 +#define APP_VER_PATCH 2 #ifdef _MSC_VER # if (_MSC_VER >= 1930)