From ea803e7338f9c33c86ae430440820df2907d34f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 9 Jul 2019 09:37:03 +0200 Subject: [PATCH 1/2] interpreter: Use keccak256 from ethash directly --- libaleth-interpreter/VM.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libaleth-interpreter/VM.cpp b/libaleth-interpreter/VM.cpp index f31ba27a67a..eac8008692d 100644 --- a/libaleth-interpreter/VM.cpp +++ b/libaleth-interpreter/VM.cpp @@ -445,7 +445,9 @@ void VM::interpretCases() uint64_t inOff = (uint64_t)m_SP[0]; uint64_t inSize = (uint64_t)m_SP[1]; - m_SPP[0] = (u256)sha3(bytesConstRef(m_mem.data() + inOff, inSize)); + + const auto h = ethash::keccak256(m_mem.data() + inOff, inSize); + m_SPP[0] = static_cast(h256{h.bytes, h256::ConstructFromPointer}); } NEXT From b9dac1164599a76bf93715fee9cbb1c8b997b189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 9 Jul 2019 12:37:52 +0200 Subject: [PATCH 2/2] interpreter: Remove devcore library from dependencies --- libaleth-interpreter/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/libaleth-interpreter/CMakeLists.txt b/libaleth-interpreter/CMakeLists.txt index ebfcdf26476..3c939f16c11 100644 --- a/libaleth-interpreter/CMakeLists.txt +++ b/libaleth-interpreter/CMakeLists.txt @@ -11,13 +11,23 @@ set( VMConfig.h VMOpt.cpp ) + +set( + dependencies + aleth-buildinfo + ethash::ethash + evmc::evmc + evmc::instructions + Boost::boost +) + add_library(aleth-interpreter STATIC ${sources}) -target_link_libraries(aleth-interpreter PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions) +target_link_libraries(aleth-interpreter PRIVATE ${dependencies}) if(ALETH_INTERPRETER_SHARED) # Build aleth-interpreter additionally as a shared library to include it in the package add_library(aleth-interpreter-shared SHARED ${sources}) - target_link_libraries(aleth-interpreter-shared PRIVATE devcore aleth-buildinfo evmc::evmc evmc::instructions) + target_link_libraries(aleth-interpreter-shared PRIVATE ${dependencies}) set_target_properties(aleth-interpreter-shared PROPERTIES OUTPUT_NAME aleth-interpreter) install(TARGETS aleth-interpreter-shared EXPORT alethTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}