Skip to content

Commit

Permalink
6.19.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
FSOL-XDAG authored Apr 4, 2023
1 parent 1df0b74 commit 6fc90ce
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 68 deletions.
17 changes: 13 additions & 4 deletions src/base/net/stratum/Job.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand All @@ -325,14 +327,21 @@ 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;
m_minerTxPubKeyOffset = minerTxPubKeyOffset;
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);
}


Expand All @@ -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;
Expand All @@ -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));
Expand Down
124 changes: 62 additions & 62 deletions src/crypto/rx/RxAlgo.h
Original file line number Diff line number Diff line change
@@ -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 */
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#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"
#define APP_KIND "miner"

#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)
Expand Down

0 comments on commit 6fc90ce

Please sign in to comment.