Merge pull request #4 from FSOL-XDAG/6.19.2

6.19.2 update
This commit is contained in:
FSOL-XDAG 2023-04-07 00:36:32 +02:00 committed by GitHub
commit 8f0d0c06ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 68 deletions

View file

@ -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));

View file

@ -1,62 +1,62 @@
/* XMRig
* Copyright (c) 2018-2019 tevador <tevador@gmail.com>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_RX_ALGO_H
#define XMRIG_RX_ALGO_H
#include <cstddef>
#include <cstdint>
#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 <tevador@gmail.com>
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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 <http://www.gnu.org/licenses/>.
*/
#ifndef XMRIG_RX_ALGO_H
#define XMRIG_RX_ALGO_H
#include <cstddef>
#include <cstdint>
#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 */

View file

@ -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)