diff --git a/CMakeLists.txt b/CMakeLists.txt index 21d0726b6..25c204095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ project(xmrig) option(WITH_LIBCPUID "Use Libcpuid" ON) option(WITH_AEON "CryptoNight-Lite support" ON) option(WITH_SUMO "CryptoNight-Heavy support" ON) +option(WITH_IPBC "CryptoNight-IPBC support" ON) option(WITH_HTTPD "HTTP REST API" ON) option(BUILD_STATIC "Build static binary" OFF) @@ -205,6 +206,10 @@ if (NOT WITH_SUMO) add_definitions(/DXMRIG_NO_SUMO) endif() +if (NOT WITH_IPBC) + add_definitions(/DXMRIG_NO_IPBC) +endif() + if (WITH_HTTPD) find_package(MHD) diff --git a/src/common/net/Pool.cpp b/src/common/net/Pool.cpp index ddf310319..22f2a6473 100644 --- a/src/common/net/Pool.cpp +++ b/src/common/net/Pool.cpp @@ -45,9 +45,14 @@ static const char *algoNames[] = { nullptr, # endif # ifndef XMRIG_NO_SUMO - "cryptonight-heavy" + "cryptonight-heavy", # else - nullptr + nullptr, +# endif +# ifndef XMRIG_NO_IPBC + "cryptonight-ipbc", +# else + nullptr, # endif }; @@ -60,9 +65,14 @@ static const char *algoNamesShort[] = { nullptr, # endif # ifndef XMRIG_NO_SUMO - "cn-heavy" + "cn-heavy", # else - nullptr + nullptr, +# endif +# ifndef XMRIG_NO_IPBC + "cn-ipbc", +# else + nullptr, # endif }; @@ -119,9 +129,9 @@ Pool::Pool(const char *host, uint16_t port, const char *user, const char *passwo } -const char *Pool::algoName(xmrig::Algo algorithm) +const char *Pool::algoName(xmrig::Algo algorithm, bool shortName) { - return algoNames[algorithm]; + return (shortName ? algoNamesShort : algoNames)[algorithm]; } diff --git a/src/common/net/Pool.h b/src/common/net/Pool.h index ecce865a7..62c801853 100644 --- a/src/common/net/Pool.h +++ b/src/common/net/Pool.h @@ -51,7 +51,7 @@ public: xmrig::Variant variant = xmrig::VARIANT_AUTO ); - static const char *algoName(xmrig::Algo algorithm); + static const char *algoName(xmrig::Algo algorithm, bool shortName = false); static xmrig::Algo algorithm(const char *algo); inline bool isNicehash() const { return m_nicehash; } diff --git a/src/common/xmrig.h b/src/common/xmrig.h index 0aa6b8425..6bef41860 100644 --- a/src/common/xmrig.h +++ b/src/common/xmrig.h @@ -34,6 +34,7 @@ enum Algo { CRYPTONIGHT, /* CryptoNight (Monero) */ CRYPTONIGHT_LITE, /* CryptoNight-Lite (AEON) */ CRYPTONIGHT_HEAVY, /* CryptoNight-Heavy (SUMO) */ + CRYPTONIGHT_IPBC /* CryptoNight-IPBC (IPBC) */ }; diff --git a/src/crypto/CryptoNight_constants.h b/src/crypto/CryptoNight_constants.h index 3c746d47a..6004edbd2 100644 --- a/src/crypto/CryptoNight_constants.h +++ b/src/crypto/CryptoNight_constants.h @@ -47,11 +47,16 @@ constexpr const size_t CRYPTONIGHT_HEAVY_MEMORY = 4 * 1024 * 1024; constexpr const uint32_t CRYPTONIGHT_HEAVY_MASK = 0x3FFFF0; constexpr const uint32_t CRYPTONIGHT_HEAVY_ITER = 0x40000; +constexpr const size_t CRYPTONIGHT_IPBC_MEMORY = 1 * 1024 * 1024; +constexpr const uint32_t CRYPTONIGHT_IPBC_MASK = 0xFFFF0; +constexpr const uint32_t CRYPTONIGHT_IPBC_ITER = 0x40000; + template inline constexpr size_t cn_select_memory() { return 0; } template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_MEMORY; } template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_LITE_MEMORY; } template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_HEAVY_MEMORY; } +template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_IPBC_MEMORY; } inline size_t cn_select_memory(Algo algorithm) { @@ -66,6 +71,9 @@ inline size_t cn_select_memory(Algo algorithm) case CRYPTONIGHT_HEAVY: return CRYPTONIGHT_HEAVY_MEMORY; + case CRYPTONIGHT_IPBC: + return CRYPTONIGHT_IPBC_MEMORY; + default: break; } @@ -78,6 +86,7 @@ template inline constexpr uint32_t cn_select_mask() { retur template<> inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_MASK; } template<> inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_LITE_MASK; } template<> inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_HEAVY_MASK; } +template<> inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_IPBC_MASK; } inline uint32_t cn_select_mask(Algo algorithm) { @@ -92,6 +101,9 @@ inline uint32_t cn_select_mask(Algo algorithm) case CRYPTONIGHT_HEAVY: return CRYPTONIGHT_HEAVY_MASK; + case CRYPTONIGHT_IPBC: + return CRYPTONIGHT_IPBC_MASK; + default: break; } @@ -104,6 +116,7 @@ template inline constexpr uint32_t cn_select_iter() { retur template<> inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_ITER; } template<> inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_LITE_ITER; } template<> inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_HEAVY_ITER; } +template<> inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_IPBC_ITER; } inline uint32_t cn_select_iter(Algo algorithm) { @@ -118,6 +131,9 @@ inline uint32_t cn_select_iter(Algo algorithm) case CRYPTONIGHT_HEAVY: return CRYPTONIGHT_HEAVY_ITER; + case CRYPTONIGHT_IPBC: + return CRYPTONIGHT_IPBC_ITER; + default: break; }