From 608fd6f14a6b9c0eeba2843fb14cbb235be0034f Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 7 Feb 2018 19:07:36 +0000 Subject: Monero Cryptonight variants, and add one for v7 This is the first variant of many, with the intent to improve Monero's resistance to ASICs and encourage mining decentralization. --- tests/hash/CMakeLists.txt | 2 +- tests/hash/main.cpp | 11 +++++++++-- tests/hash/tests-slow-1.txt | 5 +++++ 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 tests/hash/tests-slow-1.txt (limited to 'tests') diff --git a/tests/hash/CMakeLists.txt b/tests/hash/CMakeLists.txt index e2aca8517..92abeca20 100644 --- a/tests/hash/CMakeLists.txt +++ b/tests/hash/CMakeLists.txt @@ -43,7 +43,7 @@ set_property(TARGET hash-tests PROPERTY FOLDER "tests") -foreach (hash IN ITEMS fast slow tree extra-blake extra-groestl extra-jh extra-skein) +foreach (hash IN ITEMS fast slow slow-1 tree extra-blake extra-groestl extra-jh extra-skein) add_test( NAME "hash-${hash}" COMMAND hash-tests "${hash}" "${CMAKE_CURRENT_SOURCE_DIR}/tests-${hash}.txt") diff --git a/tests/hash/main.cpp b/tests/hash/main.cpp index aa928856a..5a16284df 100644 --- a/tests/hash/main.cpp +++ b/tests/hash/main.cpp @@ -51,6 +51,12 @@ extern "C" { } tree_hash((const char (*)[32]) data, length >> 5, hash); } + static void cn_slow_hash_0(const void *data, size_t length, char *hash) { + return cn_slow_hash(data, length, hash, 0); + } + static void cn_slow_hash_1(const void *data, size_t length, char *hash) { + return cn_slow_hash(data, length, hash, 1); + } } POP_WARNINGS @@ -58,9 +64,10 @@ extern "C" typedef void hash_f(const void *, size_t, char *); struct hash_func { const string name; hash_f &f; -} hashes[] = {{"fast", cn_fast_hash}, {"slow", cn_slow_hash}, {"tree", hash_tree}, +} hashes[] = {{"fast", cn_fast_hash}, {"slow", cn_slow_hash_0}, {"tree", hash_tree}, {"extra-blake", hash_extra_blake}, {"extra-groestl", hash_extra_groestl}, - {"extra-jh", hash_extra_jh}, {"extra-skein", hash_extra_skein}}; + {"extra-jh", hash_extra_jh}, {"extra-skein", hash_extra_skein}, + {"slow-1", cn_slow_hash_1}}; int main(int argc, char *argv[]) { hash_f *f; diff --git a/tests/hash/tests-slow-1.txt b/tests/hash/tests-slow-1.txt new file mode 100644 index 000000000..0c571f86f --- /dev/null +++ b/tests/hash/tests-slow-1.txt @@ -0,0 +1,5 @@ +b46aab7facce3eb4b4679d1d526f2d500d43736988b7881853c4c0c4af04ac0e 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +f0f0ab8a50a809ccd82c76996e494b20a1e01e90ed4814a27db2558511559091 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +13310922971e1112b382357aeaa8b0bf0cd941dc6f5e398979f3fa77d13749bd 8519e039172b0d70e5ca7b3383d6b3167315a422747b73f019cf9528f0fde341fd0f2a63030ba6450525cf6de31837669af6f1df8131faf50aaab8d3a7405589 +0d9f641d14a782748ed5548f72a20c83c4a2cfe606015ad9eda5b36a00947d72 37a636d7dafdf259b7287eddca2f58099e98619d2f99bdb8969d7b14498102cc065201c8be90bd777323f449848b215d2977c92c4c1c2da36ab46b2e389689ed97c18fec08cd3b03235c5e4c62a37ad88c7b67932495a71090e85dd4020a9300 +d74a0c9b603aa9f9af0bfec0c36d3d383c14930a0ee2f08dab44536fccda5bee 38274c97c45a172cfc97679870422e3a1ab0784960c60514d816271415c306ee3a3ed1a77e31f6a885c3cb -- cgit v1.2.3