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 ../../ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ac57925c..20901607 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) 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..dc842b02 100644 --- a/src/crypto/wild_keccak.h +++ b/src/crypto/wild_keccak.h @@ -96,37 +96,43 @@ 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 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; } + //------------------------------------------------------------------ + 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) {