Skip to content

Commit

Permalink
Integrated CN-Conceal (CCX) algo (#259)
Browse files Browse the repository at this point in the history
* Integrated embedded config parsing #245

* cleanup

* Cleanup in remotelog

* Fixed MS Visual Studio 2019 compatibility

* Embedded config parsing only for miner not server

* wip

* Finished delete template

* WIP

* Integrated Argon2id/chukwa algo

* Added chukwa-wrkz algo variant

* Integrated cn-conceal/ccx for x86 arch
  • Loading branch information
Bendr0id authored Jul 24, 2019
1 parent dea9b97 commit 161856b
Show file tree
Hide file tree
Showing 6 changed files with 301 additions and 18 deletions.
44 changes: 44 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"algo": "cryptonight", // cryptonight (default), cryptonight-lite, cryptonight-ultralite, cryptonight-extremelite or cryptonight-heavy
"aesni": 0, // selection of AES-NI mode (0 auto, 1 on, 2 off)
"threads": 0, // number of miner threads (not set or 0 enables automatic selection of optimal thread count)
"multihash-factor": 0, // number of hash blocks to process at a time (not set or 0 enables automatic selection of optimal number of hash blocks)
"multihash-thread-mask" : null, // for multihash-factors>0 only, limits multihash to given threads (mask), mask "0x3" means run multihash on thread 0 and 1 only (default: all threads)
"pow-variant" : "auto", // specificy the PoW variat to use: -> auto (default), '0', '1', '2', 'ipbc', 'xao', 'xtl', 'rto', 'xfh', 'upx', 'turtle', 'hosp', 'r', 'wow', 'double (xcash)', 'zls' (zelerius), 'rwz' (graft), 'upx2'
// for further help see: https://github.com/Bendr0id/xmrigCC/wiki/Coin-configurations
"asm-optimization" : "auto", // specificy the ASM optimization to use: -> auto (default), intel, ryzen, bulldozer, off
"background": false, // true to run the miner in the background (Windows only, for *nix plase use screen/tmux or systemd service instead)
"colors": true, // false to disable colored output
"cpu-affinity": null, // set process affinity to CPU core(s), mask "0x3" for cores 0 and 1
"cpu-priority": null, // set process priority (0 idle, 2 normal to 5 highest)
"donate-level": 5, // donate level, mininum 1%
"log-file": null, // log all output to a file, example: "c:/some/path/xmrig.log"
"max-cpu-usage": 100, // maximum CPU usage for automatic mode, usually limiting factor is CPU cache not this option.
"print-time": 60, // print hashrate report every N seconds
"retries": 5, // number of times to retry before switch to backup server
"retry-pause": 5, // time to pause between retries
"safe": false, // true to safe adjust threads and av settings for current CPU
"syslog": false, // use system log for output messages
"reboot-cmd" : "", // command to execute to reboot the OS
"force-pow-variant" : false, // force pow variant, dont parse pow/variant from pool job
"skip-self-check" : false, // skip the self check on startup
"pools": [
{
"url": "donate2.graef.in:80", // URL of mining server
"user": "YOUR_WALLET_ID", // username for mining server
"pass": "x", // password for mining server
"use-tls" : false, // enable tls for pool communication (need pool support)
"keepalive": true, // send keepalived for prevent timeout (need pool support)
"nicehash": false // enable nicehash/xmrig-proxy support
}
],
"cc-client": {
"url": "localhost:3344", // url of the CC Server (ip:port)
"use-tls" : false, // enable tls for CC communication (needs to be enabled on CC Server too)
"access-token": "mySecret", // access token for CC Server (has to be the same in config_cc.json)
"worker-id": null, // custom worker-id for CC Server (otherwise hostname is used)
"update-interval-s": 10, // status update interval in seconds (default: 10 min: 1)
"use-remote-logging" : true, // enable remote logging on CC Server
"upload-config-on-startup" : true // upload current miner config to CC Server on startup
}
}
13 changes: 12 additions & 1 deletion src/Options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ constexpr static const char *pow_variant_names[] = {
"zls",
"graft",
"upx2",
"conceal",
"chukwa",
"wrkz"
};
Expand Down Expand Up @@ -1305,7 +1306,17 @@ bool Options::parsePowVariant(const char *powVariant)
break;
}

if (i == ARRAY_SIZE(pow_variant_names) - 1 && (!strcmp(powVariant, "chukwa"))) {
if (i == ARRAY_SIZE(pow_variant_names) - 1 && (!strcmp(powVariant, "conceal") || !strcmp(powVariant, "ccx"))) {
m_powVariant = POW_CONCEAL;
break;
}

if (i == ARRAY_SIZE(pow_variant_names) - 1 && (!strcmp(powVariant, "trtl-chukwa") || !strcmp(powVariant, "trtl_chukwa") || !strcmp(powVariant, "chuckwa"))) {
m_powVariant = POW_ARGON2_CHUKWA;
break;
}

if (i == ARRAY_SIZE(pow_variant_names) - 1 && (!strcmp(powVariant, "chukwa-wrkz") || !strcmp(powVariant, "chukwa_wrkz") || !strcmp(powVariant, "trtl-wrkz"))) {
m_powVariant = POW_ARGON2_CHUKWA;
break;
}
Expand Down
5 changes: 5 additions & 0 deletions src/PowVariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ enum PowVariant
POW_ZELERIUS,
POW_RWZ,
POW_UPX2,
POW_CONCEAL,
POW_ARGON2_CHUKWA,
POW_ARGON2_WRKZ,
LAST_ITEM
Expand Down Expand Up @@ -94,6 +95,8 @@ inline std::string getPowVariantName(PowVariant powVariant)
return "rwz";
case POW_UPX2:
return "upx2";
case POW_CONCEAL:
return "conceal";
case POW_ARGON2_CHUKWA:
return "chukwa";
case POW_ARGON2_WRKZ:
Expand Down Expand Up @@ -185,6 +188,8 @@ inline PowVariant parseVariant(const std::string variant)
powVariant = PowVariant::POW_RWZ;
} else if (variant == "upx2") {
powVariant = PowVariant::POW_UPX2;
} else if (variant == "conceal" || variant == "ccx") {
powVariant = PowVariant::POW_CONCEAL;
} else if (variant == "chukwa" || variant == "trtl-chukwa" || variant == "argon2-chukwa") {
powVariant = PowVariant::POW_ARGON2_CHUKWA;
} else if (variant == "chukwa_wrkz" || variant == "wrkz" || variant == "argon2-wrkz") {
Expand Down
15 changes: 15 additions & 0 deletions src/crypto/CryptoNight_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ const static uint8_t test_output_v0[160] = {
};


// CN CONCEAL
const static uint8_t test_output_conceal[160] = {
0xB3, 0xA1, 0x67, 0x86, 0xD2, 0xC9, 0x85, 0xEC, 0xAD, 0xC4, 0x5F, 0x91, 0x05, 0x27, 0xC7, 0xA1,
0x96, 0xF0, 0xE1, 0xE9, 0x7C, 0x87, 0x09, 0x38, 0x1D, 0x7D, 0x41, 0x93, 0x35, 0xF8, 0x16, 0x72,
0xC3, 0xBD, 0x8D, 0xE8, 0xD5, 0xAE, 0xB8, 0x59, 0x0A, 0x6C, 0xCB, 0x7B, 0x41, 0x30, 0xF7, 0x04,
0xA5, 0x7C, 0xF9, 0xCA, 0x20, 0x49, 0x9C, 0xFD, 0xE8, 0x43, 0xCF, 0x66, 0x78, 0xEA, 0x76, 0xDD,
0x91, 0x0C, 0xDE, 0x29, 0x2A, 0xE0, 0xA8, 0xCA, 0xBC, 0xAA, 0x53, 0x4C, 0x93, 0x3E, 0x7B, 0x2C,
0xF1, 0xF9, 0xE1, 0x98, 0xB2, 0x92, 0x1E, 0x19, 0x93, 0x2A, 0x74, 0x9D, 0xDB, 0x10, 0x0F, 0x16,
0xD5, 0x3D, 0xE4, 0xC4, 0x23, 0xD9, 0x2E, 0xFD, 0x79, 0x8D, 0x1E, 0x48, 0x4E, 0x46, 0x08, 0x6C,
0xFF, 0x8A, 0x49, 0xFA, 0x1E, 0xB0, 0xB6, 0x9A, 0x47, 0x1C, 0xC6, 0x30, 0x36, 0x5D, 0xFD, 0x76,
0x10, 0x07, 0x44, 0xE6, 0xC8, 0x20, 0x2A, 0x84, 0x9D, 0x70, 0x22, 0x00, 0x8B, 0x9B, 0xBD, 0x8D,
0x27, 0x49, 0xA6, 0x06, 0xDC, 0xF0, 0xA1, 0x4B, 0x50, 0xA0, 0x12, 0xCD, 0x77, 0x01, 0x4C, 0x28
};


// CN v7
const static uint8_t test_output_v1[160] = {
0xF2, 0x2D, 0x3D, 0x62, 0x03, 0xD2, 0xA0, 0x8B, 0x41, 0xD9, 0x02, 0x72, 0x78, 0xD8, 0xBC, 0xC9,
Expand Down
Loading

0 comments on commit 161856b

Please sign in to comment.