From a3ff52f00a0faf2383909f58c61717708a920080 Mon Sep 17 00:00:00 2001 From: anonimal Date: Thu, 14 Mar 2019 23:26:50 +0000 Subject: [PATCH 1/6] Makefile: remove redundant GUI target I have no idea how that got in there. I must've pushed a non-fixup'd branch by accident. --- Makefile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Makefile b/Makefile index b6183bed..d0be5571 100644 --- a/Makefile +++ b/Makefile @@ -18,10 +18,6 @@ cmake_gui = -D BUILD_GUI=ON cmake_static = -D STATIC=ON cmake_tests = -D BUILD_TESTS=ON -gui: - $(eval command += $(cmake_release) $(cmake_gui)) - $(call CMAKE,$(dir_release),$(command)) && $(MAKE) - # Helper macro define CMAKE mkdir -p $1 && cd $1 && $2 ../../ From 4926d91190fa88cbb16514ac9ad44dfca9942680 Mon Sep 17 00:00:00 2001 From: anonimal Date: Thu, 14 Mar 2019 23:27:56 +0000 Subject: [PATCH 2/6] CMake: add GUI convenience "bundle" Sets GUI target output to a GUI directory, copies needed HTML files for runtime. Related refactoring. --- src/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac57925c..fcc094a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -162,9 +162,15 @@ if(BUILD_GUI) set_property(TARGET Zano PROPERTY FOLDER "prog") set_target_properties(Zano PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/gui/qt-daemon/Info.plist.in) - set_target_properties(Zano PROPERTIES VS_DEBUGGER_COMMAND_ARGUMENTS "--html-path=${CMAKE_CURRENT_SOURCE_DIR}/gui/qt-daemon/html") + set(HTML_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gui/qt-daemon/html) + set_target_properties(Zano PROPERTIES VS_DEBUGGER_COMMAND_ARGUMENTS "--html-path=${HTML_DIR}") set(CMAKE_AUTOMOC OFF) + + # GUI convenience "bundle" + set(GUI_DIR ${CMAKE_CURRENT_BINARY_DIR}/gui) + set_target_properties(Zano PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${GUI_DIR}) + add_custom_command(TARGET Zano POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${HTML_DIR} ${GUI_DIR}/html) endif() if(APPLE) From a33090184097954cbe986fee28346601933395e4 Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 15 Mar 2019 19:58:18 +0100 Subject: [PATCH 3/6] overloaded get_wild_keccack2 --- src/common/db_abstract_accessor.h | 4 ++-- src/crypto/wild_keccak.h | 38 +++++++++++++++++-------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/common/db_abstract_accessor.h b/src/common/db_abstract_accessor.h index 2f20dd34..413bd93d 100644 --- a/src/common/db_abstract_accessor.h +++ b/src/common/db_abstract_accessor.h @@ -15,8 +15,8 @@ #include "cache_helper.h" #include "profile_tools.h" #include "../serialization/serialization.h" -#include "epee/include/readwrite_lock.h" -#include "epee/include/math_helper.h" +#include "readwrite_lock.h" +#include "math_helper.h" #undef LOG_DEFAULT_CHANNEL #define LOG_DEFAULT_CHANNEL "db" diff --git a/src/crypto/wild_keccak.h b/src/crypto/wild_keccak.h index 6dbba3f2..fda61ff5 100644 --- a/src/crypto/wild_keccak.h +++ b/src/crypto/wild_keccak.h @@ -93,36 +93,40 @@ namespace crypto }; - //------------------------------------------------------------------ inline - bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector& scratchpad, uint64_t sz) + bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector& scratchpad, uint64_t sz) + { + + const uint64_t* int_array_ptr = (const uint64_t*)&scratchpad[0]; + size_t int64_sz = sz * 4; + } + //------------------------------------------------------------------ + inline + bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const uint64_t*& int_array_ptr_scratch, uint64_t int64_sz) { uint64_t count_access = 0; crypto::wild_keccak2_dbl(reinterpret_cast(bd.data()), bd.size(), reinterpret_cast(&res), sizeof(res), [&](crypto::state_t_m& st) { ++count_access; - if (!sz) + if (!int64_sz) { return; } - const uint64_t* int_array_ptr = (const uint64_t*)&scratchpad[0]; - size_t int64_sz = sz * 4; - - for (size_t i = 0; i != sizeof(st) / sizeof(st[0]); i++) + for (size_t i = 0; i != sizeof(st) / sizeof(st[0]); i++) + { + size_t depend_index = 0; + if (i == 0) { - size_t depend_index = 0; - if (i == 0) - { - depend_index = sizeof(st) / sizeof(st[0]) - 1; - } - else - { - depend_index = i - 1; - } - st[i] ^= int_array_ptr[ int_array_ptr[ int_array_ptr[st[depend_index] % int64_sz] % int64_sz] % int64_sz]; + depend_index = sizeof(st) / sizeof(st[0]) - 1; } + else + { + depend_index = i - 1; + } + st[i] ^= int_array_ptr_scratch[int_array_ptr_scratch[int_array_ptr_scratch[st[depend_index] % int64_sz] % int64_sz] % int64_sz]; + } }); return true; } From 85571fdda9e8aa1cf4cc1850b11e670ebbcc3c2b Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 15 Mar 2019 20:14:20 +0100 Subject: [PATCH 4/6] fixed misprint --- src/crypto/wild_keccak.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/crypto/wild_keccak.h b/src/crypto/wild_keccak.h index fda61ff5..2c7c1527 100644 --- a/src/crypto/wild_keccak.h +++ b/src/crypto/wild_keccak.h @@ -93,14 +93,7 @@ namespace crypto }; - //------------------------------------------------------------------ - inline - bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector& scratchpad, uint64_t sz) - { - - const uint64_t* int_array_ptr = (const uint64_t*)&scratchpad[0]; - size_t int64_sz = sz * 4; - } + //------------------------------------------------------------------ inline bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const uint64_t*& int_array_ptr_scratch, uint64_t int64_sz) @@ -130,7 +123,16 @@ namespace crypto }); return true; } + //------------------------------------------------------------------ + inline + bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector& scratchpad, uint64_t sz) + { + const uint64_t* int_array_ptr = (const uint64_t*)&scratchpad[0]; + size_t int64_sz = sz * 4; + return get_wild_keccak2(bd, res, int_array_ptr, int64_sz); + } + //------------------------------------------------------------------ template bool get_wild_keccak_light(const std::string& bd, crypto::hash& res, t_items_accessor cb_get_item) { From ad40b37df144ce4993bb915e2d17ee4132e0f40a Mon Sep 17 00:00:00 2001 From: "crypro.zoidberg" Date: Fri, 15 Mar 2019 20:35:42 +0100 Subject: [PATCH 5/6] fixed misprint2 --- src/crypto/wild_keccak.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crypto/wild_keccak.h b/src/crypto/wild_keccak.h index 2c7c1527..dc842b02 100644 --- a/src/crypto/wild_keccak.h +++ b/src/crypto/wild_keccak.h @@ -96,7 +96,7 @@ namespace crypto //------------------------------------------------------------------ inline - bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const uint64_t*& int_array_ptr_scratch, uint64_t int64_sz) + bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const uint64_t* int_array_ptr_scratch, uint64_t int64_sz) { uint64_t count_access = 0; crypto::wild_keccak2_dbl(reinterpret_cast(bd.data()), bd.size(), reinterpret_cast(&res), sizeof(res), [&](crypto::state_t_m& st) From 56e5cd9d08ccf9a830bdcb2799dc402623436115 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Fri, 15 Mar 2019 23:00:24 +0100 Subject: [PATCH 6/6] commented output dir change (to avoid build script breaking) --- src/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index fcc094a3..20901607 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -168,9 +168,9 @@ if(BUILD_GUI) set(CMAKE_AUTOMOC OFF) # GUI convenience "bundle" - set(GUI_DIR ${CMAKE_CURRENT_BINARY_DIR}/gui) - set_target_properties(Zano PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${GUI_DIR}) - add_custom_command(TARGET Zano POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${HTML_DIR} ${GUI_DIR}/html) + # set(GUI_DIR ${CMAKE_CURRENT_BINARY_DIR}/gui) + # set_target_properties(Zano PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${GUI_DIR}) + # add_custom_command(TARGET Zano POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${HTML_DIR} ${GUI_DIR}/html) endif() if(APPLE)