From 5a2c4444a4e2b5ddc5e5dbf98990dcad45e32fe8 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Tue, 27 Mar 2018 20:54:47 +0200 Subject: POW AEON v7 - add new pow for AEON - fix missing cryptonight-heavy selection for multi hashes --- xmrstak/backend/cryptonight.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'xmrstak/backend/cryptonight.hpp') diff --git a/xmrstak/backend/cryptonight.hpp b/xmrstak/backend/cryptonight.hpp index fe10a9f..538f1d8 100644 --- a/xmrstak/backend/cryptonight.hpp +++ b/xmrstak/backend/cryptonight.hpp @@ -9,7 +9,8 @@ enum xmrstak_algo cryptonight = 1, cryptonight_lite = 2, cryptonight_monero = 3, - cryptonight_heavy = 4 + cryptonight_heavy = 4, + cryptonight_aeon = 5 }; // define aeon settings @@ -40,6 +41,9 @@ inline constexpr size_t cn_select_memory() { return CRYPTONI template<> inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_HEAVY_MEMORY; } +template<> +inline constexpr size_t cn_select_memory() { return CRYPTONIGHT_LITE_MEMORY; } + inline size_t cn_select_memory(xmrstak_algo algo) { @@ -53,6 +57,8 @@ inline size_t cn_select_memory(xmrstak_algo algo) return CRYPTONIGHT_MEMORY; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_MEMORY; + case cryptonight_aeon: + return CRYPTONIGHT_LITE_MEMORY; default: return 0; } @@ -73,6 +79,9 @@ inline constexpr uint32_t cn_select_mask() { return CRYPTONI template<> inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_HEAVY_MASK; } +template<> +inline constexpr uint32_t cn_select_mask() { return CRYPTONIGHT_LITE_MASK; } + inline size_t cn_select_mask(xmrstak_algo algo) { switch(algo) @@ -85,6 +94,8 @@ inline size_t cn_select_mask(xmrstak_algo algo) return CRYPTONIGHT_MASK; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_MASK; + case cryptonight_aeon: + return CRYPTONIGHT_LITE_MASK; default: return 0; } @@ -105,6 +116,9 @@ inline constexpr uint32_t cn_select_iter() { return CRYPTONI template<> inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_HEAVY_ITER; } +template<> +inline constexpr uint32_t cn_select_iter() { return CRYPTONIGHT_LITE_ITER; } + inline size_t cn_select_iter(xmrstak_algo algo) { switch(algo) @@ -117,6 +131,8 @@ inline size_t cn_select_iter(xmrstak_algo algo) return CRYPTONIGHT_ITER; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_ITER; + case cryptonight_aeon: + return CRYPTONIGHT_LITE_ITER; default: return 0; } -- cgit v1.1 From 0c48570ac662662fc9e808c0efe042f843fd6b23 Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 29 Mar 2018 21:02:58 +0200 Subject: github annotations - documentation: change `aeon` to `aeon7` - change `case` order in `switch` statements - update README.txt --- xmrstak/backend/cryptonight.hpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'xmrstak/backend/cryptonight.hpp') diff --git a/xmrstak/backend/cryptonight.hpp b/xmrstak/backend/cryptonight.hpp index 538f1d8..8a8e259 100644 --- a/xmrstak/backend/cryptonight.hpp +++ b/xmrstak/backend/cryptonight.hpp @@ -49,16 +49,14 @@ inline size_t cn_select_memory(xmrstak_algo algo) { switch(algo) { + case cryptonight_monero: case cryptonight: - return CRYPTONIGHT_MEMORY; + return CRYPTONIGHT_MEMORY; + case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_MEMORY; - case cryptonight_monero: - return CRYPTONIGHT_MEMORY; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_MEMORY; - case cryptonight_aeon: - return CRYPTONIGHT_LITE_MEMORY; default: return 0; } @@ -86,16 +84,14 @@ inline size_t cn_select_mask(xmrstak_algo algo) { switch(algo) { + case cryptonight_monero: case cryptonight: return CRYPTONIGHT_MASK; + case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_MASK; - case cryptonight_monero: - return CRYPTONIGHT_MASK; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_MASK; - case cryptonight_aeon: - return CRYPTONIGHT_LITE_MASK; default: return 0; } @@ -123,16 +119,14 @@ inline size_t cn_select_iter(xmrstak_algo algo) { switch(algo) { + case cryptonight_monero: case cryptonight: return CRYPTONIGHT_ITER; + case cryptonight_aeon: case cryptonight_lite: return CRYPTONIGHT_LITE_ITER; - case cryptonight_monero: - return CRYPTONIGHT_ITER; case cryptonight_heavy: return CRYPTONIGHT_HEAVY_ITER; - case cryptonight_aeon: - return CRYPTONIGHT_LITE_ITER; default: return 0; } -- cgit v1.1