Skip to content

Commit

Permalink
Integrated chukwa variant for pengolincoin and ninjacoin
Browse files Browse the repository at this point in the history
- Fixed bad shares on cn algos when compiled with gcc 10.x
  • Loading branch information
Bendr0id committed Jun 14, 2020
1 parent 8bd85e6 commit 772c90b
Show file tree
Hide file tree
Showing 13 changed files with 58 additions and 37 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
# 2.7.0
* Integrated pengolincoin algo (`pengo`) or coin (`pengo` for autoswitch) for upcoming hardfork
* Integrated ninjacoin algo (`ninja`)
* Fixed CN invalid shares when compiled with gcc 10.1
* Updated http lib to improve performance
* Fixed freezes in XMRigServer
# 2.6.5
* Added Miner/Hashrate statistics (graphs) of the last 24h to the Dashboard
* Embedded image resources in the Dashboard for faster loading
Expand Down
22 changes: 12 additions & 10 deletions README.md
Expand Up @@ -24,16 +24,18 @@ PushOver or Telegram automatically so that you dont need to watch your miners al

Full Windows/Linux compatible, and you can mix Linux and Windows miner on one XMRigCCServer.

## Features of XMRigCC

* **Support of AstroBWT variant (algo: "astrobwt")**
* **Support of RandomKEVA variant (algo: "rx/keva")**
* **Support of CN-Talleo variant (algo: "cn-pico/tlo")**
* **Support of RandomSFX variant (algo: "rx/sfx")**
* **Support of RandomARQ variant (algo: "rx/arq")**
* **Support of UPX2 variant (algo: "cn-extremelite/upx2")** b
* **Support of CN-Conceal variant (algo: "cn/conceal")**
* **Better performance on ARMv8 CPUs**
## Last integrated algos to XMRigCC

* **pengolincoin** variant (algo: "pengo")
* **ninjacoin** variant (algo: "ninja")
* **AstroBWT** variant (algo: "astrobwt")
* **RandomKEVA** variant (algo: "rx/keva")
* **CN-Talleo** variant (algo: "cn-pico/tlo")
* **UPX2** variant (algo: "cn-extremelite/upx2")
* **CN-Conceal** variant (algo: "cn/conceal")

## XMRigCC features
* Better performance on ARMv8 CPUs
* Full SSL/TLS support
* NUMA support
* Command and control server
Expand Down
6 changes: 3 additions & 3 deletions doc/ALGORITHMS.md
Expand Up @@ -3,7 +3,7 @@
Algorithm can be defined in 3 ways:

1. By pool, using algorithm negotiation, in this case no need specify algorithm on miner side.
2. Per pool `coin` option, currently only usable value for this option is `monero`.
2. Per pool `coin` option, currently only usable value for this option is `monero`, `aqrma`, `dero`, `keva`, `pengo`
3. Per pool `algo` option.

Option `coin` useful for pools without algorithm negotiation support or daemon to allow automatically switch algorithm in next hard fork.
Expand All @@ -12,6 +12,8 @@ Option `coin` useful for pools without algorithm negotiation support or daemon t

| Name | Memory | Version | Notes |
|------|--------|---------|-------|
| `pengo` | 256 KB | 2.7.0+ | Chukwa variant PengolinCoin. |
| `ninja` | 256 KB | 2.7.0+ | Chukwa variant NinjaCoin. |
| `astroBWT` | 20 MB | 2.6.0+ | AstroBWT. |
| `rx/keva` | 1 MB | 2.6.0+ | RandomKEVA. |
| `cn-pico/tlo` | 256 KB | 2.5.0+ | CryptoNight-Pico. (Talleo) |
Expand All @@ -22,14 +24,12 @@ Option `coin` useful for pools without algorithm negotiation support or daemon t
| `rx/loki` | 2 MB | 2.0.0+ | RandomXL. |
| `cn/conceal` | 2 MB | 1.9.5+ | CryptoNight variant 1 (modified). |
| `argon2/chukwa` | 512 KB | 1.9.5+ | Argon2id (Chukwa). |
| `argon2/wrkz` | 256 KB | 1.9.5+ | Argon2id (WRKZ). |
| `cn-extremelite/upx2` | 128 KB | <1.9.5 | CryptoNight-Extremelite variant UPX2 with reversed shuffle. |
| `cn/fast` | 2 MB | <1.9.5+ | CryptoNight variant 1 with half iterations. |
| `cn/rwz` | 2 MB | <1.9.5+ | CryptoNight variant 2 with 3/4 iterations and reversed shuffle operation. |
| `cn/zls` | 2 MB | <1.9.5+ | CryptoNight variant 2 with 3/4 iterations. |
| `cn/double` | 2 MB | <1.9.5+ | CryptoNight variant 2 with double iterations. |
| `cn/r` | 2 MB | <1.9.5+ | CryptoNightR (Monero's variant 4). |
| `cn/wow` | 2 MB | <1.9.5+ | CryptoNightR (Wownero). |
| `cn-pico` | 256 KB | <1.9.5+ | CryptoNight-Pico. (Turtle) |
| `cn/half` | 2 MB | <1.9.5+ | CryptoNight variant 2 with half iterations. |
| `cn/2` | 2 MB | <1.9.5+ | CryptoNight variant 2. |
Expand Down
3 changes: 2 additions & 1 deletion src/backend/cpu/CpuWorker.cpp
Expand Up @@ -189,7 +189,7 @@ bool xmrig::CpuWorker<N>::selfTest()
# ifdef XMRIG_ALGO_ARGON2
if (m_algorithm.family() == Algorithm::ARGON2) {
return verify(Algorithm::AR2_CHUKWA, argon2_chukwa_test_out) &&
verify(Algorithm::AR2_WRKZ, argon2_wrkz_test_out);
verify(Algorithm::AR2_CHUKWA_LITE, argon2_chukwa_lite_test_out);
}
# endif

Expand Down Expand Up @@ -310,6 +310,7 @@ bool xmrig::CpuWorker<N>::verify(const Algorithm &algorithm, const uint8_t *refe
}

func(test_input, 76, m_hash, m_ctx, 0);

return memcmp(m_hash, referenceValue, sizeof m_hash) == 0;
}

Expand Down
14 changes: 9 additions & 5 deletions src/base/crypto/Algorithm.cpp
Expand Up @@ -135,9 +135,13 @@ static AlgoName const algorithm_names[] = {
{ "chukwa", nullptr, Algorithm::AR2_CHUKWA },
{ "ar2/512", nullptr, Algorithm::AR2_CHUKWA },
{ "ar2-512", nullptr, Algorithm::AR2_CHUKWA },
{ "argon2/wrkz", nullptr, Algorithm::AR2_WRKZ },
{ "ar2/256", nullptr, Algorithm::AR2_WRKZ },
{ "ar2-256", nullptr, Algorithm::AR2_WRKZ },
{ "argon2/chukwa-lite", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "ar2/256", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "ar2-256", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "argon2/ninja", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "ninja", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "argon2/pengo", nullptr, Algorithm::AR2_CHUKWA_LITE },
{ "pengo", nullptr, Algorithm::AR2_CHUKWA_LITE },
# endif
# ifdef XMRIG_ALGO_ASTROBWT
{ "astrobwt", nullptr, Algorithm::ASTROBWT_DERO },
Expand Down Expand Up @@ -223,7 +227,7 @@ size_t xmrig::Algorithm::l3() const
case AR2_CHUKWA:
return oneMiB / 2;

case AR2_WRKZ:
case AR2_CHUKWA_LITE:
return oneMiB / 4;

default:
Expand Down Expand Up @@ -336,7 +340,7 @@ xmrig::Algorithm::Family xmrig::Algorithm::family(Id id)

# ifdef XMRIG_ALGO_ARGON2
case AR2_CHUKWA:
case AR2_WRKZ:
case AR2_CHUKWA_LITE:
return ARGON2;
# endif

Expand Down
2 changes: 1 addition & 1 deletion src/base/crypto/Algorithm.h
Expand Up @@ -73,7 +73,7 @@ class Algorithm
RX_SFX, // "rx/sfx" RandomSFX (Safex Cash).
RX_KEVA, // "rx/keva" RandomKV (Keva).
AR2_CHUKWA, // "argon2/chukwa" Argon2id (Chukwa).
AR2_WRKZ, // "argon2/wrkz" Argon2id (WRKZ)
AR2_CHUKWA_LITE,// "argon2/chukwa-lite" Argon2id (Chukwa-Lite).
ASTROBWT_DERO, // "astrobwt/dero" AstroBWT (Dero)
MAX
};
Expand Down
6 changes: 5 additions & 1 deletion src/base/crypto/Coin.cpp
Expand Up @@ -52,7 +52,8 @@ static CoinName const coin_names[] = {
{ "arqma", Coin::ARQMA },
{ "arq", Coin::ARQMA },
{ "dero", Coin::DERO },
{ "keva", Coin::KEVA }
{ "keva", Coin::KEVA },
{ "pengo", Coin::PENGO }
};


Expand All @@ -75,6 +76,9 @@ xmrig::Algorithm::Id xmrig::Coin::algorithm(uint8_t blobVersion) const
case KEVA:
return (blobVersion >= 11) ? Algorithm::RX_KEVA : Algorithm::CN_R;

case PENGO:
return (blobVersion >= 6) ? Algorithm::AR2_CHUKWA_LITE : Algorithm::CN_PICO_0;

case INVALID:
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/base/crypto/Coin.h
Expand Up @@ -42,7 +42,8 @@ class Coin
MONERO,
ARQMA,
DERO,
KEVA
KEVA,
PENGO
};


Expand Down
6 changes: 3 additions & 3 deletions src/crypto/argon2/Hash.h
Expand Up @@ -37,10 +37,10 @@ template<Algorithm::Id ALGO>
inline void single_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t)
{
if (ALGO == Algorithm::AR2_CHUKWA) {
argon2id_hash_raw_ex(3, 512, 1, input, size, input, 16, output, 32, ctx[0]->memory);
argon2id_hash_raw_ex(3, 512, 1, input, size, input, 16, output, 32, ctx[0]->memory);
}
else if (ALGO == Algorithm::AR2_WRKZ) {
argon2id_hash_raw_ex(4, 256, 1, input, size, input, 16, output, 32, ctx[0]->memory);
else if (ALGO == Algorithm::AR2_CHUKWA_LITE) {
argon2id_hash_raw_ex(4, 256, 1, input, size, input, 16, output, 32, ctx[0]->memory);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/crypto/cn/CnHash.cpp
Expand Up @@ -305,8 +305,8 @@ xmrig::CnHash::CnHash()
# ifdef XMRIG_ALGO_ARGON2
m_map[Algorithm::AR2_CHUKWA][AV_SINGLE][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_CHUKWA>;
m_map[Algorithm::AR2_CHUKWA][AV_SINGLE_SOFT][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_CHUKWA>;
m_map[Algorithm::AR2_WRKZ][AV_SINGLE][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_WRKZ>;
m_map[Algorithm::AR2_WRKZ][AV_SINGLE_SOFT][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_WRKZ>;
m_map[Algorithm::AR2_CHUKWA_LITE][AV_SINGLE][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_CHUKWA_LITE>;
m_map[Algorithm::AR2_CHUKWA_LITE][AV_SINGLE_SOFT][Assembly::NONE] = argon2::single_hash<Algorithm::AR2_CHUKWA_LITE>;
# endif

# ifdef XMRIG_ALGO_ASTROBWT
Expand Down
5 changes: 3 additions & 2 deletions src/crypto/cn/CryptoNight_test.h
Expand Up @@ -397,8 +397,8 @@ const static uint8_t argon2_chukwa_test_out[160] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

// "argon2/wrkz"
const static uint8_t argon2_wrkz_test_out[160] = {
// "argon2/lite a.k.a old-WRKZ (now used by: pengo, ninja)"
const static uint8_t argon2_chukwa_lite_test_out[160] = {
0x35, 0xE0, 0x83, 0xD4, 0xB9, 0xC6, 0x4C, 0x2A, 0x68, 0x82, 0x0A, 0x43, 0x1F, 0x61, 0x31, 0x19,
0x98, 0xA8, 0xCD, 0x18, 0x64, 0xDB, 0xA4, 0x07, 0x7E, 0x25, 0xB7, 0xF1, 0x21, 0xD5, 0x4B, 0xD1,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Expand All @@ -410,6 +410,7 @@ const static uint8_t argon2_wrkz_test_out[160] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

#endif


Expand Down
12 changes: 7 additions & 5 deletions src/crypto/cn/c_jh.c
Expand Up @@ -213,16 +213,16 @@ static void E8(hashState *state)
/*The compression function F8 */
static void F8(hashState *state)
{
uint64 i;
uint64_t* x = (uint64_t*)state->x;
const uint64_t* buf = (uint64*)state->buffer;

/*xor the 512-bit message with the fist half of the 1024-bit hash state*/
for (i = 0; i < 8; i++) state->x[i >> 1][i & 1] ^= ((uint64*)state->buffer)[i];

for (int i = 0; i < 8; ++i) x[i] ^= buf[i];
/*the bijective function E8 */
E8(state);

/*xor the 512-bit message with the second half of the 1024-bit hash state*/
for (i = 0; i < 8; i++) state->x[(8+i) >> 1][(8+i) & 1] ^= ((uint64*)state->buffer)[i];
for (int i = 0; i < 8; ++i) x[i + 8] ^= buf[i];
}

/*before hashing a message, initialize the hash state as H0 */
Expand All @@ -240,7 +240,9 @@ static HashReturn Init(hashState *state, int hashbitlen)
case 224: memcpy(state->x,JH224_H0,128); break;
case 256: memcpy(state->x,JH256_H0,128); break;
case 384: memcpy(state->x,JH384_H0,128); break;
case 512: memcpy(state->x,JH512_H0,128); break;
case 512:
default:
memcpy(state->x,JH512_H0,128); break;
}

return(SUCCESS);
Expand Down
6 changes: 3 additions & 3 deletions src/version.h
Expand Up @@ -28,15 +28,15 @@
#define APP_ID "XMRigCC"
#define APP_NAME "XMRigCC"
#define APP_DESC "XMRigCC CPU miner"
#define APP_VERSION "2.6.8 "
#define APP_VERSION "2.7.0 "
#define APP_DOMAIN ""
#define APP_SITE "https://github.com/BenDr0id/xmrigCC/"
#define APP_COPYRIGHT "Copyright (C) 2017- XMRigCC"
#define APP_KIND "cpu"

#define APP_VER_MAJOR 2
#define APP_VER_MINOR 6
#define APP_VER_PATCH 8
#define APP_VER_MINOR 7
#define APP_VER_PATCH 0

#ifndef NDEBUG
#define BUILD_TYPE "DEBUG"
Expand Down

0 comments on commit 772c90b

Please sign in to comment.