1
0
Fork 0
forked from lthn/blockchain

Merge branch 'master' into frontend

This commit is contained in:
wildkif 2019-03-22 17:47:06 +02:00
commit 34b4237314
4 changed files with 31 additions and 23 deletions

View file

@ -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 ../../

View file

@ -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)

View file

@ -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"

View file

@ -96,37 +96,43 @@ namespace crypto
//------------------------------------------------------------------
inline
bool get_wild_keccak2(const std::string& bd, crypto::hash& res, const std::vector<crypto::hash>& 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<crypto::regular_f>(reinterpret_cast<const uint8_t*>(bd.data()), bd.size(), reinterpret_cast<uint8_t*>(&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<crypto::hash>& 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<class t_items_accessor>
bool get_wild_keccak_light(const std::string& bd, crypto::hash& res, t_items_accessor cb_get_item)
{