From 00efb88ac7579996529516a3ba1aa86d3a7b36e7 Mon Sep 17 00:00:00 2001
From: pbattu
Date: Tue, 21 May 2019 18:42:14 -0300
Subject: [PATCH] fc changes to support ubuntu-18.04 upgrade
---
.gitignore | 0
.gitmodules | 0
CMakeLists.txt | 15 +-
CMakeModules/ArgumentParser.cmake | 0
CMakeModules/FindBoost.cmake | 0
CMakeModules/FindReadline.cmake | 2 -
CMakeModules/FindVLD.cmake | 0
CMakeModules/ParseLibraryList.cmake | 0
CMakeModules/SetupTargetMacros.cmake | 0
CMakeModules/UseLibraryMacros.cmake | 0
CMakeModules/VersionMacros.cmake | 0
GitVersionGen/GetGitRevisionDescription.cmake | 0
.../GetGitRevisionDescription.cmake.in | 0
README-ecc.md | 0
README.md | 0
fc.natvis | 0
include/fc/actor.hpp | 0
include/fc/aligned.hpp | 0
include/fc/any.hpp | 0
include/fc/api.hpp | 0
include/fc/array.hpp | 0
include/fc/asio.hpp | 0
include/fc/bitutil.hpp | 0
include/fc/bloom_filter.hpp | 0
include/fc/compress/smaz.hpp | 0
include/fc/compress/zlib.hpp | 0
include/fc/container/deque.hpp | 0
include/fc/container/deque_fwd.hpp | 0
include/fc/container/flat.hpp | 0
include/fc/container/flat_fwd.hpp | 0
include/fc/crypto/aes.hpp | 0
include/fc/crypto/base36.hpp | 0
include/fc/crypto/base58.hpp | 0
include/fc/crypto/base64.hpp | 0
include/fc/crypto/bigint.hpp | 0
include/fc/crypto/blowfish.hpp | 0
include/fc/crypto/city.hpp | 0
include/fc/crypto/dh.hpp | 0
include/fc/crypto/digest.hpp | 0
include/fc/crypto/elliptic.hpp | 26 +-
include/fc/crypto/hash_ctr_rng.hpp | 0
include/fc/crypto/hex.hpp | 0
include/fc/crypto/hmac.hpp | 0
include/fc/crypto/md5.hpp | 0
include/fc/crypto/openssl.hpp | 0
include/fc/crypto/pke.hpp | 0
include/fc/crypto/rand.hpp | 0
include/fc/crypto/ripemd160.hpp | 0
include/fc/crypto/sha1.hpp | 0
include/fc/crypto/sha224.hpp | 0
include/fc/crypto/sha256.hpp | 12 +-
include/fc/crypto/sha512.hpp | 0
include/fc/exception/exception.hpp | 0
include/fc/filesystem.hpp | 0
include/fc/fixed_string.hpp | 0
include/fc/fwd.hpp | 0
include/fc/fwd_impl.hpp | 0
include/fc/git_revision.hpp | 0
include/fc/interprocess/container.hpp | 0
include/fc/interprocess/file_mapping.hpp | 0
include/fc/interprocess/file_mutex.hpp | 0
include/fc/interprocess/iprocess.hpp | 0
include/fc/interprocess/mmap_struct.hpp | 0
include/fc/interprocess/process.hpp | 0
include/fc/interprocess/signals.hpp | 0
include/fc/io/buffered_iostream.hpp | 0
include/fc/io/console.hpp | 0
include/fc/io/datastream.hpp | 0
include/fc/io/datastream_back.hpp | 0
include/fc/io/enum_type.hpp | 0
include/fc/io/fstream.hpp | 0
include/fc/io/iobuffer.hpp | 0
include/fc/io/iostream.hpp | 0
include/fc/io/json.hpp | 0
include/fc/io/json_relaxed.hpp | 0
include/fc/io/raw.hpp | 0
include/fc/io/raw_fwd.hpp | 0
include/fc/io/raw_unpack_file.hpp | 0
include/fc/io/raw_variant.hpp | 0
include/fc/io/sstream.hpp | 0
include/fc/io/stdio.hpp | 0
include/fc/io/varint.hpp | 0
include/fc/log/appender.hpp | 0
include/fc/log/console_appender.hpp | 0
include/fc/log/file_appender.hpp | 0
include/fc/log/gelf_appender.hpp | 0
include/fc/log/log_message.hpp | 0
include/fc/log/logger.hpp | 0
include/fc/log/logger_config.hpp | 0
include/fc/make_fused.hpp | 0
include/fc/network/http/connection.hpp | 0
include/fc/network/http/server.hpp | 0
include/fc/network/http/websocket.hpp | 0
include/fc/network/ip.hpp | 0
include/fc/network/ntp.hpp | 0
include/fc/network/rate_limiting.hpp | 0
include/fc/network/resolve.hpp | 0
include/fc/network/tcp_socket.hpp | 0
include/fc/network/tcp_socket_io_hooks.hpp | 0
include/fc/network/udp_socket.hpp | 0
include/fc/network/url.hpp | 0
include/fc/noncopyable.hpp | 0
include/fc/optional.hpp | 0
include/fc/platform_independence.hpp | 0
include/fc/real128.hpp | 0
include/fc/reflect/reflect.hpp | 0
include/fc/reflect/typename.hpp | 2 +-
include/fc/reflect/variant.hpp | 0
include/fc/rpc/api_connection.hpp | 0
include/fc/rpc/binary_api_connection.hpp | 0
include/fc/rpc/bstate.hpp | 0
include/fc/rpc/cli.hpp | 0
include/fc/rpc/http_api.hpp | 0
include/fc/rpc/json_connection.hpp | 0
include/fc/rpc/state.hpp | 0
include/fc/rpc/variant_connection.hpp | 0
include/fc/rpc/variant_stream.hpp | 0
include/fc/rpc/websocket_api.hpp | 0
include/fc/safe.hpp | 0
include/fc/scoped_exit.hpp | 0
include/fc/shared_ptr.hpp | 0
include/fc/signal.hpp | 0
include/fc/signals.hpp | 0
include/fc/smart_ref_fwd.hpp | 0
include/fc/smart_ref_impl.hpp | 0
include/fc/static_variant.hpp | 2 +-
include/fc/string.hpp | 0
include/fc/thread/future.hpp | 0
include/fc/thread/mutex.hpp | 0
.../fc/thread/non_preemptable_scope_check.hpp | 0
include/fc/thread/priority.hpp | 0
include/fc/thread/scoped_lock.hpp | 0
include/fc/thread/spin_lock.hpp | 0
include/fc/thread/spin_yield_lock.hpp | 0
include/fc/thread/task.hpp | 0
include/fc/thread/thread.hpp | 0
include/fc/thread/thread_specific.hpp | 0
include/fc/thread/unique_lock.hpp | 0
include/fc/thread/wait_condition.hpp | 0
include/fc/time.hpp | 0
include/fc/tuple.hpp | 0
include/fc/uint128.hpp | 0
include/fc/unique_ptr.hpp | 0
include/fc/utf8.hpp | 0
include/fc/utility.hpp | 0
include/fc/variant.hpp | 0
include/fc/variant_object.hpp | 0
include/fc/vector.hpp | 0
include/fc/vector_fwd.hpp | 0
include/fc/wait_any.hpp | 0
src/asio.cpp | 0
src/byteswap.hpp | 0
src/compress/miniz.c | 0
src/compress/smaz.cpp | 0
src/compress/zlib.cpp | 0
src/crypto/_digest_common.cpp | 0
src/crypto/_digest_common.hpp | 0
src/crypto/_elliptic_impl_priv.hpp | 0
src/crypto/_elliptic_impl_pub.hpp | 0
src/crypto/aes.cpp | 0
src/crypto/base36.cpp | 0
src/crypto/base58.cpp | 143 +++---
src/crypto/base64.cpp | 0
src/crypto/bigint.cpp | 0
src/crypto/blowfish.cpp | 0
src/crypto/city.cpp | 0
src/crypto/crc.cpp | 0
src/crypto/dh.cpp | 44 +-
src/crypto/elliptic_common.cpp | 13 +-
src/crypto/elliptic_impl_priv.cpp | 0
src/crypto/elliptic_impl_pub.cpp | 0
src/crypto/elliptic_mixed.cpp | 0
src/crypto/elliptic_openssl.cpp | 0
src/crypto/elliptic_secp256k1.cpp | 254 ----------
src/crypto/hex.cpp | 0
src/crypto/md5.cpp | 0
src/crypto/openssl.cpp | 0
src/crypto/pke.cpp | 0
src/crypto/rand.cpp | 0
src/crypto/ripemd160.cpp | 0
src/crypto/sha1.cpp | 0
src/crypto/sha224.cpp | 0
src/crypto/sha256.cpp | 0
src/crypto/sha512.cpp | 0
src/exception.cpp | 0
src/filesystem.cpp | 27 +-
src/git_revision.cpp.in | 0
src/interprocess/file_mapping.cpp | 0
src/interprocess/file_mutex.cpp | 0
src/interprocess/mmap_struct.cpp | 0
src/interprocess/process.cpp | 0
src/interprocess/signals.cpp | 0
src/io/buffered_iostream.cpp | 0
src/io/console.cpp | 0
src/io/datastream.cpp | 0
src/io/fstream.cpp | 0
src/io/iostream.cpp | 0
src/io/json.cpp | 0
src/io/sstream.cpp | 0
src/io/varint.cpp | 0
src/log/appender.cpp | 0
src/log/console_appender.cpp | 0
src/log/console_defines.h | 0
src/log/file_appender.cpp | 1 +
src/log/gelf_appender.cpp | 0
src/log/log_message.cpp | 0
src/log/logger.cpp | 0
src/log/logger_config.cpp | 0
src/network/http/http_connection.cpp | 0
src/network/http/http_server.cpp | 0
src/network/http/websocket.cpp | 0
src/network/ip.cpp | 0
src/network/ntp.cpp | 0
src/network/rate_limiting.cpp | 0
src/network/resolve.cpp | 0
src/network/tcp_socket.cpp | 10 +-
src/network/udp_socket.cpp | 0
src/network/url.cpp | 0
src/real128.cpp | 0
src/rpc/bstate.cpp | 0
src/rpc/cli.cpp | 0
src/rpc/http_api.cpp | 0
src/rpc/json_connection.cpp | 0
src/rpc/state.cpp | 0
src/rpc/websocket_api.cpp | 0
src/shared_ptr.cpp | 0
src/string.cpp | 0
src/thread/context.hpp | 17 +-
src/thread/future.cpp | 0
src/thread/mutex.cpp | 0
src/thread/non_preemptable_scope_check.cpp | 0
src/thread/spin_lock.cpp | 0
src/thread/spin_yield_lock.cpp | 0
src/thread/task.cpp | 0
src/thread/thread.cpp | 0
src/thread/thread_d.hpp | 21 +-
src/thread/thread_specific.cpp | 0
src/time.cpp | 0
src/uint128.cpp | 0
src/utf8.cpp | 0
src/utf8/ReleaseNotes | 0
src/utf8/checked.h | 0
src/utf8/core.h | 0
src/utf8/unchecked.h | 0
src/utf8/utf8cpp.html | 0
src/variant.cpp | 0
src/variant_object.cpp | 0
tests/CMakeLists.txt | 4 +-
tests/all_tests.cpp | 0
tests/api.cpp | 0
tests/bip_lock.cpp | 0
tests/blinding_test.cpp | 3 +-
tests/bloom_test.cpp | 0
tests/compress/compress.cpp | 0
tests/crypto/aes_test.cpp | 0
tests/crypto/base_n_tests.cpp | 0
tests/crypto/bigint_test.cpp | 0
tests/crypto/blind.cpp | 0
tests/crypto/blowfish_test.cpp | 0
tests/crypto/dh_test.cpp | 0
tests/crypto/ecc_test.cpp | 0
tests/crypto/log_test.cpp | 0
tests/crypto/rand_test.cpp | 0
tests/crypto/sha_tests.cpp | 0
tests/hmac_test.cpp | 0
tests/network/http/websocket_test.cpp | 0
tests/rate_limiting.cpp | 0
tests/real128_test.cpp | 0
tests/rpc.cpp | 0
tests/sleep.cpp | 0
tests/thread/task_cancel.cpp | 0
tests/thread/thread_tests.cpp | 95 ++++
tests/utf8_test.cpp | 0
vendor/boost_1.51/include/boost/process.hpp | 25 -
.../boost_1.51/include/boost/process/all.hpp | 40 --
.../include/boost/process/child.hpp | 100 ----
.../include/boost/process/config.hpp | 74 ---
.../include/boost/process/context.hpp | 139 ------
.../boost/process/detail/basic_status.hpp | 69 ---
.../process/detail/basic_status_service.hpp | 323 -------------
.../boost/process/detail/posix_helpers.hpp | 106 -----
.../boost/process/detail/status_impl.hpp | 190 --------
.../boost/process/detail/systembuf.hpp | 228 ---------
.../boost/process/detail/windows_helpers.hpp | 138 ------
.../include/boost/process/environment.hpp | 52 ---
.../include/boost/process/handle.hpp | 231 ---------
.../include/boost/process/operations.hpp | 439 ------------------
.../include/boost/process/pid_type.hpp | 56 ---
.../boost_1.51/include/boost/process/pipe.hpp | 49 --
.../include/boost/process/pistream.hpp | 114 -----
.../include/boost/process/postream.hpp | 115 -----
.../include/boost/process/process.hpp | 213 ---------
.../boost_1.51/include/boost/process/self.hpp | 188 --------
.../include/boost/process/status.hpp | 41 --
.../include/boost/process/stream_behavior.hpp | 326 -------------
.../include/boost/process/stream_ends.hpp | 68 ---
.../include/boost/process/stream_id.hpp | 50 --
.../include/boost/process/stream_type.hpp | 45 --
.../context/asm/fcontext_arm_aapcs_elf_gas.S | 101 ----
.../context/asm/fcontext_i386_ms_pe_masm.asm | 151 ------
.../context/asm/fcontext_i386_sysv_elf_gas.S | 122 -----
.../asm/fcontext_i386_sysv_macho_gas.S | 118 -----
.../context/asm/fcontext_mips32_o32_elf_gas.S | 144 ------
.../context/asm/fcontext_ppc32_sysv_elf_gas.S | 222 ---------
.../context/asm/fcontext_ppc64_sysv_elf_gas.S | 250 ----------
.../asm/fcontext_x86_64_ms_pe_masm.asm | 207 ---------
.../asm/fcontext_x86_64_sysv_elf_gas.S | 116 -----
.../asm/fcontext_x86_64_sysv_macho_gas.S | 111 -----
vendor/boost_1.51/libs/context/fcontext.cpp | 36 --
vendor/boost_1.51/libs/context/seh.cpp | 83 ----
.../libs/context/stack_allocator_posix.cpp | 85 ----
.../libs/context/stack_allocator_windows.cpp | 86 ----
.../libs/context/stack_utils_posix.cpp | 81 ----
.../libs/context/stack_utils_windows.cpp | 84 ----
vendor/diff-match-patch-cpp-stl | 1 -
315 files changed, 282 insertions(+), 5826 deletions(-)
mode change 100644 => 100755 .gitignore
mode change 100644 => 100755 .gitmodules
mode change 100644 => 100755 CMakeLists.txt
mode change 100644 => 100755 CMakeModules/ArgumentParser.cmake
mode change 100644 => 100755 CMakeModules/FindBoost.cmake
mode change 100644 => 100755 CMakeModules/FindReadline.cmake
mode change 100644 => 100755 CMakeModules/FindVLD.cmake
mode change 100644 => 100755 CMakeModules/ParseLibraryList.cmake
mode change 100644 => 100755 CMakeModules/SetupTargetMacros.cmake
mode change 100644 => 100755 CMakeModules/UseLibraryMacros.cmake
mode change 100644 => 100755 CMakeModules/VersionMacros.cmake
mode change 100644 => 100755 GitVersionGen/GetGitRevisionDescription.cmake
mode change 100644 => 100755 GitVersionGen/GetGitRevisionDescription.cmake.in
mode change 100644 => 100755 README-ecc.md
mode change 100644 => 100755 README.md
mode change 100644 => 100755 fc.natvis
mode change 100644 => 100755 include/fc/actor.hpp
mode change 100644 => 100755 include/fc/aligned.hpp
mode change 100644 => 100755 include/fc/any.hpp
mode change 100644 => 100755 include/fc/api.hpp
mode change 100644 => 100755 include/fc/array.hpp
mode change 100644 => 100755 include/fc/asio.hpp
mode change 100644 => 100755 include/fc/bitutil.hpp
mode change 100644 => 100755 include/fc/bloom_filter.hpp
mode change 100644 => 100755 include/fc/compress/smaz.hpp
mode change 100644 => 100755 include/fc/compress/zlib.hpp
mode change 100644 => 100755 include/fc/container/deque.hpp
mode change 100644 => 100755 include/fc/container/deque_fwd.hpp
mode change 100644 => 100755 include/fc/container/flat.hpp
mode change 100644 => 100755 include/fc/container/flat_fwd.hpp
mode change 100644 => 100755 include/fc/crypto/aes.hpp
mode change 100644 => 100755 include/fc/crypto/base36.hpp
mode change 100644 => 100755 include/fc/crypto/base58.hpp
mode change 100644 => 100755 include/fc/crypto/base64.hpp
mode change 100644 => 100755 include/fc/crypto/bigint.hpp
mode change 100644 => 100755 include/fc/crypto/blowfish.hpp
mode change 100644 => 100755 include/fc/crypto/city.hpp
mode change 100644 => 100755 include/fc/crypto/dh.hpp
mode change 100644 => 100755 include/fc/crypto/digest.hpp
mode change 100644 => 100755 include/fc/crypto/elliptic.hpp
mode change 100644 => 100755 include/fc/crypto/hash_ctr_rng.hpp
mode change 100644 => 100755 include/fc/crypto/hex.hpp
mode change 100644 => 100755 include/fc/crypto/hmac.hpp
mode change 100644 => 100755 include/fc/crypto/md5.hpp
mode change 100644 => 100755 include/fc/crypto/openssl.hpp
mode change 100644 => 100755 include/fc/crypto/pke.hpp
mode change 100644 => 100755 include/fc/crypto/rand.hpp
mode change 100644 => 100755 include/fc/crypto/ripemd160.hpp
mode change 100644 => 100755 include/fc/crypto/sha1.hpp
mode change 100644 => 100755 include/fc/crypto/sha224.hpp
mode change 100644 => 100755 include/fc/crypto/sha256.hpp
mode change 100644 => 100755 include/fc/crypto/sha512.hpp
mode change 100644 => 100755 include/fc/exception/exception.hpp
mode change 100644 => 100755 include/fc/filesystem.hpp
mode change 100644 => 100755 include/fc/fixed_string.hpp
mode change 100644 => 100755 include/fc/fwd.hpp
mode change 100644 => 100755 include/fc/fwd_impl.hpp
mode change 100644 => 100755 include/fc/git_revision.hpp
mode change 100644 => 100755 include/fc/interprocess/container.hpp
mode change 100644 => 100755 include/fc/interprocess/file_mapping.hpp
mode change 100644 => 100755 include/fc/interprocess/file_mutex.hpp
mode change 100644 => 100755 include/fc/interprocess/iprocess.hpp
mode change 100644 => 100755 include/fc/interprocess/mmap_struct.hpp
mode change 100644 => 100755 include/fc/interprocess/process.hpp
mode change 100644 => 100755 include/fc/interprocess/signals.hpp
mode change 100644 => 100755 include/fc/io/buffered_iostream.hpp
mode change 100644 => 100755 include/fc/io/console.hpp
mode change 100644 => 100755 include/fc/io/datastream.hpp
mode change 100644 => 100755 include/fc/io/datastream_back.hpp
mode change 100644 => 100755 include/fc/io/enum_type.hpp
mode change 100644 => 100755 include/fc/io/fstream.hpp
mode change 100644 => 100755 include/fc/io/iobuffer.hpp
mode change 100644 => 100755 include/fc/io/iostream.hpp
mode change 100644 => 100755 include/fc/io/json.hpp
mode change 100644 => 100755 include/fc/io/json_relaxed.hpp
mode change 100644 => 100755 include/fc/io/raw.hpp
mode change 100644 => 100755 include/fc/io/raw_fwd.hpp
mode change 100644 => 100755 include/fc/io/raw_unpack_file.hpp
mode change 100644 => 100755 include/fc/io/raw_variant.hpp
mode change 100644 => 100755 include/fc/io/sstream.hpp
mode change 100644 => 100755 include/fc/io/stdio.hpp
mode change 100644 => 100755 include/fc/io/varint.hpp
mode change 100644 => 100755 include/fc/log/appender.hpp
mode change 100644 => 100755 include/fc/log/console_appender.hpp
mode change 100644 => 100755 include/fc/log/file_appender.hpp
mode change 100644 => 100755 include/fc/log/gelf_appender.hpp
mode change 100644 => 100755 include/fc/log/log_message.hpp
mode change 100644 => 100755 include/fc/log/logger.hpp
mode change 100644 => 100755 include/fc/log/logger_config.hpp
mode change 100644 => 100755 include/fc/make_fused.hpp
mode change 100644 => 100755 include/fc/network/http/connection.hpp
mode change 100644 => 100755 include/fc/network/http/server.hpp
mode change 100644 => 100755 include/fc/network/http/websocket.hpp
mode change 100644 => 100755 include/fc/network/ip.hpp
mode change 100644 => 100755 include/fc/network/ntp.hpp
mode change 100644 => 100755 include/fc/network/rate_limiting.hpp
mode change 100644 => 100755 include/fc/network/resolve.hpp
mode change 100644 => 100755 include/fc/network/tcp_socket.hpp
mode change 100644 => 100755 include/fc/network/tcp_socket_io_hooks.hpp
mode change 100644 => 100755 include/fc/network/udp_socket.hpp
mode change 100644 => 100755 include/fc/network/url.hpp
mode change 100644 => 100755 include/fc/noncopyable.hpp
mode change 100644 => 100755 include/fc/optional.hpp
mode change 100644 => 100755 include/fc/platform_independence.hpp
mode change 100644 => 100755 include/fc/real128.hpp
mode change 100644 => 100755 include/fc/reflect/reflect.hpp
mode change 100644 => 100755 include/fc/reflect/typename.hpp
mode change 100644 => 100755 include/fc/reflect/variant.hpp
mode change 100644 => 100755 include/fc/rpc/api_connection.hpp
mode change 100644 => 100755 include/fc/rpc/binary_api_connection.hpp
mode change 100644 => 100755 include/fc/rpc/bstate.hpp
mode change 100644 => 100755 include/fc/rpc/cli.hpp
mode change 100644 => 100755 include/fc/rpc/http_api.hpp
mode change 100644 => 100755 include/fc/rpc/json_connection.hpp
mode change 100644 => 100755 include/fc/rpc/state.hpp
mode change 100644 => 100755 include/fc/rpc/variant_connection.hpp
mode change 100644 => 100755 include/fc/rpc/variant_stream.hpp
mode change 100644 => 100755 include/fc/rpc/websocket_api.hpp
mode change 100644 => 100755 include/fc/safe.hpp
mode change 100644 => 100755 include/fc/scoped_exit.hpp
mode change 100644 => 100755 include/fc/shared_ptr.hpp
mode change 100644 => 100755 include/fc/signal.hpp
mode change 100644 => 100755 include/fc/signals.hpp
mode change 100644 => 100755 include/fc/smart_ref_fwd.hpp
mode change 100644 => 100755 include/fc/smart_ref_impl.hpp
mode change 100644 => 100755 include/fc/static_variant.hpp
mode change 100644 => 100755 include/fc/string.hpp
mode change 100644 => 100755 include/fc/thread/future.hpp
mode change 100644 => 100755 include/fc/thread/mutex.hpp
mode change 100644 => 100755 include/fc/thread/non_preemptable_scope_check.hpp
mode change 100644 => 100755 include/fc/thread/priority.hpp
mode change 100644 => 100755 include/fc/thread/scoped_lock.hpp
mode change 100644 => 100755 include/fc/thread/spin_lock.hpp
mode change 100644 => 100755 include/fc/thread/spin_yield_lock.hpp
mode change 100644 => 100755 include/fc/thread/task.hpp
mode change 100644 => 100755 include/fc/thread/thread.hpp
mode change 100644 => 100755 include/fc/thread/thread_specific.hpp
mode change 100644 => 100755 include/fc/thread/unique_lock.hpp
mode change 100644 => 100755 include/fc/thread/wait_condition.hpp
mode change 100644 => 100755 include/fc/time.hpp
mode change 100644 => 100755 include/fc/tuple.hpp
mode change 100644 => 100755 include/fc/uint128.hpp
mode change 100644 => 100755 include/fc/unique_ptr.hpp
mode change 100644 => 100755 include/fc/utf8.hpp
mode change 100644 => 100755 include/fc/utility.hpp
mode change 100644 => 100755 include/fc/variant.hpp
mode change 100644 => 100755 include/fc/variant_object.hpp
mode change 100644 => 100755 include/fc/vector.hpp
mode change 100644 => 100755 include/fc/vector_fwd.hpp
mode change 100644 => 100755 include/fc/wait_any.hpp
mode change 100644 => 100755 src/asio.cpp
mode change 100644 => 100755 src/byteswap.hpp
mode change 100644 => 100755 src/compress/miniz.c
mode change 100644 => 100755 src/compress/smaz.cpp
mode change 100644 => 100755 src/compress/zlib.cpp
mode change 100644 => 100755 src/crypto/_digest_common.cpp
mode change 100644 => 100755 src/crypto/_digest_common.hpp
mode change 100644 => 100755 src/crypto/_elliptic_impl_priv.hpp
mode change 100644 => 100755 src/crypto/_elliptic_impl_pub.hpp
mode change 100644 => 100755 src/crypto/aes.cpp
mode change 100644 => 100755 src/crypto/base36.cpp
mode change 100644 => 100755 src/crypto/base58.cpp
mode change 100644 => 100755 src/crypto/base64.cpp
mode change 100644 => 100755 src/crypto/bigint.cpp
mode change 100644 => 100755 src/crypto/blowfish.cpp
mode change 100644 => 100755 src/crypto/city.cpp
mode change 100644 => 100755 src/crypto/crc.cpp
mode change 100644 => 100755 src/crypto/dh.cpp
mode change 100644 => 100755 src/crypto/elliptic_common.cpp
mode change 100644 => 100755 src/crypto/elliptic_impl_priv.cpp
mode change 100644 => 100755 src/crypto/elliptic_impl_pub.cpp
mode change 100644 => 100755 src/crypto/elliptic_mixed.cpp
mode change 100644 => 100755 src/crypto/elliptic_openssl.cpp
mode change 100644 => 100755 src/crypto/elliptic_secp256k1.cpp
mode change 100644 => 100755 src/crypto/hex.cpp
mode change 100644 => 100755 src/crypto/md5.cpp
mode change 100644 => 100755 src/crypto/openssl.cpp
mode change 100644 => 100755 src/crypto/pke.cpp
mode change 100644 => 100755 src/crypto/rand.cpp
mode change 100644 => 100755 src/crypto/ripemd160.cpp
mode change 100644 => 100755 src/crypto/sha1.cpp
mode change 100644 => 100755 src/crypto/sha224.cpp
mode change 100644 => 100755 src/crypto/sha256.cpp
mode change 100644 => 100755 src/crypto/sha512.cpp
mode change 100644 => 100755 src/exception.cpp
mode change 100644 => 100755 src/filesystem.cpp
mode change 100644 => 100755 src/git_revision.cpp.in
mode change 100644 => 100755 src/interprocess/file_mapping.cpp
mode change 100644 => 100755 src/interprocess/file_mutex.cpp
mode change 100644 => 100755 src/interprocess/mmap_struct.cpp
mode change 100644 => 100755 src/interprocess/process.cpp
mode change 100644 => 100755 src/interprocess/signals.cpp
mode change 100644 => 100755 src/io/buffered_iostream.cpp
mode change 100644 => 100755 src/io/console.cpp
mode change 100644 => 100755 src/io/datastream.cpp
mode change 100644 => 100755 src/io/fstream.cpp
mode change 100644 => 100755 src/io/iostream.cpp
mode change 100644 => 100755 src/io/json.cpp
mode change 100644 => 100755 src/io/sstream.cpp
mode change 100644 => 100755 src/io/varint.cpp
mode change 100644 => 100755 src/log/appender.cpp
mode change 100644 => 100755 src/log/console_appender.cpp
mode change 100644 => 100755 src/log/console_defines.h
mode change 100644 => 100755 src/log/file_appender.cpp
mode change 100644 => 100755 src/log/gelf_appender.cpp
mode change 100644 => 100755 src/log/log_message.cpp
mode change 100644 => 100755 src/log/logger.cpp
mode change 100644 => 100755 src/log/logger_config.cpp
mode change 100644 => 100755 src/network/http/http_connection.cpp
mode change 100644 => 100755 src/network/http/http_server.cpp
mode change 100644 => 100755 src/network/http/websocket.cpp
mode change 100644 => 100755 src/network/ip.cpp
mode change 100644 => 100755 src/network/ntp.cpp
mode change 100644 => 100755 src/network/rate_limiting.cpp
mode change 100644 => 100755 src/network/resolve.cpp
mode change 100644 => 100755 src/network/tcp_socket.cpp
mode change 100644 => 100755 src/network/udp_socket.cpp
mode change 100644 => 100755 src/network/url.cpp
mode change 100644 => 100755 src/real128.cpp
mode change 100644 => 100755 src/rpc/bstate.cpp
mode change 100644 => 100755 src/rpc/cli.cpp
mode change 100644 => 100755 src/rpc/http_api.cpp
mode change 100644 => 100755 src/rpc/json_connection.cpp
mode change 100644 => 100755 src/rpc/state.cpp
mode change 100644 => 100755 src/rpc/websocket_api.cpp
mode change 100644 => 100755 src/shared_ptr.cpp
mode change 100644 => 100755 src/string.cpp
mode change 100644 => 100755 src/thread/context.hpp
mode change 100644 => 100755 src/thread/future.cpp
mode change 100644 => 100755 src/thread/mutex.cpp
mode change 100644 => 100755 src/thread/non_preemptable_scope_check.cpp
mode change 100644 => 100755 src/thread/spin_lock.cpp
mode change 100644 => 100755 src/thread/spin_yield_lock.cpp
mode change 100644 => 100755 src/thread/task.cpp
mode change 100644 => 100755 src/thread/thread.cpp
mode change 100644 => 100755 src/thread/thread_d.hpp
mode change 100644 => 100755 src/thread/thread_specific.cpp
mode change 100644 => 100755 src/time.cpp
mode change 100644 => 100755 src/uint128.cpp
mode change 100644 => 100755 src/utf8.cpp
mode change 100644 => 100755 src/utf8/ReleaseNotes
mode change 100644 => 100755 src/utf8/checked.h
mode change 100644 => 100755 src/utf8/core.h
mode change 100644 => 100755 src/utf8/unchecked.h
mode change 100644 => 100755 src/utf8/utf8cpp.html
mode change 100644 => 100755 src/variant.cpp
mode change 100644 => 100755 src/variant_object.cpp
mode change 100644 => 100755 tests/CMakeLists.txt
mode change 100644 => 100755 tests/all_tests.cpp
mode change 100644 => 100755 tests/api.cpp
mode change 100644 => 100755 tests/bip_lock.cpp
mode change 100644 => 100755 tests/blinding_test.cpp
mode change 100644 => 100755 tests/bloom_test.cpp
mode change 100644 => 100755 tests/compress/compress.cpp
mode change 100644 => 100755 tests/crypto/aes_test.cpp
mode change 100644 => 100755 tests/crypto/base_n_tests.cpp
mode change 100644 => 100755 tests/crypto/bigint_test.cpp
mode change 100644 => 100755 tests/crypto/blind.cpp
mode change 100644 => 100755 tests/crypto/blowfish_test.cpp
mode change 100644 => 100755 tests/crypto/dh_test.cpp
mode change 100644 => 100755 tests/crypto/ecc_test.cpp
mode change 100644 => 100755 tests/crypto/log_test.cpp
mode change 100644 => 100755 tests/crypto/rand_test.cpp
mode change 100644 => 100755 tests/crypto/sha_tests.cpp
mode change 100644 => 100755 tests/hmac_test.cpp
mode change 100644 => 100755 tests/network/http/websocket_test.cpp
mode change 100644 => 100755 tests/rate_limiting.cpp
mode change 100644 => 100755 tests/real128_test.cpp
mode change 100644 => 100755 tests/rpc.cpp
mode change 100644 => 100755 tests/sleep.cpp
mode change 100644 => 100755 tests/thread/task_cancel.cpp
create mode 100755 tests/thread/thread_tests.cpp
mode change 100644 => 100755 tests/utf8_test.cpp
delete mode 100644 vendor/boost_1.51/include/boost/process.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/all.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/child.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/config.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/context.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/basic_status.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/basic_status_service.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/posix_helpers.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/status_impl.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/systembuf.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/detail/windows_helpers.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/environment.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/handle.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/operations.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/pid_type.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/pipe.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/pistream.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/postream.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/process.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/self.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/status.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/stream_behavior.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/stream_ends.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/stream_id.hpp
delete mode 100644 vendor/boost_1.51/include/boost/process/stream_type.hpp
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_arm_aapcs_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_ms_pe_masm.asm
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_i386_sysv_macho_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_mips32_o32_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_ppc32_sysv_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_ppc64_sysv_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_ms_pe_masm.asm
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_elf_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/asm/fcontext_x86_64_sysv_macho_gas.S
delete mode 100644 vendor/boost_1.51/libs/context/fcontext.cpp
delete mode 100644 vendor/boost_1.51/libs/context/seh.cpp
delete mode 100644 vendor/boost_1.51/libs/context/stack_allocator_posix.cpp
delete mode 100644 vendor/boost_1.51/libs/context/stack_allocator_windows.cpp
delete mode 100644 vendor/boost_1.51/libs/context/stack_utils_posix.cpp
delete mode 100644 vendor/boost_1.51/libs/context/stack_utils_windows.cpp
delete mode 160000 vendor/diff-match-patch-cpp-stl
diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/.gitmodules b/.gitmodules
old mode 100644
new mode 100755
diff --git a/CMakeLists.txt b/CMakeLists.txt
old mode 100644
new mode 100755
index dafcdb0..bd52180
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,7 @@ endif()
SET (ORIGINAL_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(BOOST_COMPONENTS)
-LIST(APPEND BOOST_COMPONENTS thread date_time system filesystem program_options signals serialization chrono unit_test_framework context locale iostreams)
+LIST(APPEND BOOST_COMPONENTS thread date_time filesystem system program_options signals serialization chrono unit_test_framework context locale iostreams)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
IF( ECC_IMPL STREQUAL openssl )
@@ -190,7 +190,6 @@ set( fc_sources
src/io/varint.cpp
src/io/console.cpp
src/filesystem.cpp
- src/interprocess/process.cpp
src/interprocess/signals.cpp
src/interprocess/file_mapping.cpp
src/interprocess/mmap_struct.cpp
@@ -336,15 +335,6 @@ else()
set( ZLIB_LIBRARIES "" )
endif( ZLIB_FOUND )
-find_package( BZip2 )
-if( BZIP2_FOUND )
- MESSAGE( STATUS "bzip2 found" )
- add_definitions( -DHAS_BZIP2 )
-else()
- MESSAGE( STATUS "bzip2 not found" )
- set( BZIP2_LIBRARIES "" )
-endif( BZIP2_FOUND )
-
# This will become unnecessary once we update to websocketpp which fixes upstream issue #395
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWEBSOCKETPP_STRICT_MASKING")
@@ -373,7 +363,6 @@ target_include_directories(fc
"${readline_includes}"
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/vendor/boost_1.51/include
${CMAKE_CURRENT_SOURCE_DIR}/vendor/secp256k1-zkp
)
@@ -381,7 +370,7 @@ target_include_directories(fc
IF(NOT WIN32)
set(LINK_USR_LOCAL_LIB -L/usr/local/lib)
ENDIF()
-target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} )
+target_link_libraries( fc PUBLIC ${LINK_USR_LOCAL_LIB} ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES} ${PLATFORM_SPECIFIC_LIBS} ${RPCRT4} ${CMAKE_DL_LIBS} ${rt_library} ${readline_libraries} ${ECC_LIB} )
if(MSVC)
set_source_files_properties( src/network/http/websocket.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
diff --git a/CMakeModules/ArgumentParser.cmake b/CMakeModules/ArgumentParser.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/FindBoost.cmake b/CMakeModules/FindBoost.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/FindReadline.cmake b/CMakeModules/FindReadline.cmake
old mode 100644
new mode 100755
index f1d0d74..745cfe5
--- a/CMakeModules/FindReadline.cmake
+++ b/CMakeModules/FindReadline.cmake
@@ -45,5 +45,3 @@ mark_as_advanced(
Readline_INCLUDE_DIR
Readline_LIBRARY
)
-
-MESSAGE( STATUS "Found Readline: ${Readline_LIBRARY}" )
diff --git a/CMakeModules/FindVLD.cmake b/CMakeModules/FindVLD.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/ParseLibraryList.cmake b/CMakeModules/ParseLibraryList.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/SetupTargetMacros.cmake b/CMakeModules/SetupTargetMacros.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/UseLibraryMacros.cmake b/CMakeModules/UseLibraryMacros.cmake
old mode 100644
new mode 100755
diff --git a/CMakeModules/VersionMacros.cmake b/CMakeModules/VersionMacros.cmake
old mode 100644
new mode 100755
diff --git a/GitVersionGen/GetGitRevisionDescription.cmake b/GitVersionGen/GetGitRevisionDescription.cmake
old mode 100644
new mode 100755
diff --git a/GitVersionGen/GetGitRevisionDescription.cmake.in b/GitVersionGen/GetGitRevisionDescription.cmake.in
old mode 100644
new mode 100755
diff --git a/README-ecc.md b/README-ecc.md
old mode 100644
new mode 100755
diff --git a/README.md b/README.md
old mode 100644
new mode 100755
diff --git a/fc.natvis b/fc.natvis
old mode 100644
new mode 100755
diff --git a/include/fc/actor.hpp b/include/fc/actor.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/aligned.hpp b/include/fc/aligned.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/any.hpp b/include/fc/any.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/api.hpp b/include/fc/api.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/array.hpp b/include/fc/array.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/asio.hpp b/include/fc/asio.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/bitutil.hpp b/include/fc/bitutil.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/bloom_filter.hpp b/include/fc/bloom_filter.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/compress/smaz.hpp b/include/fc/compress/smaz.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/compress/zlib.hpp b/include/fc/compress/zlib.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/container/deque.hpp b/include/fc/container/deque.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/container/deque_fwd.hpp b/include/fc/container/deque_fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/container/flat.hpp b/include/fc/container/flat.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/container/flat_fwd.hpp b/include/fc/container/flat_fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/aes.hpp b/include/fc/crypto/aes.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/base36.hpp b/include/fc/crypto/base36.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/base58.hpp b/include/fc/crypto/base58.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/base64.hpp b/include/fc/crypto/base64.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/bigint.hpp b/include/fc/crypto/bigint.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/blowfish.hpp b/include/fc/crypto/blowfish.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/city.hpp b/include/fc/crypto/city.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/dh.hpp b/include/fc/crypto/dh.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/digest.hpp b/include/fc/crypto/digest.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/elliptic.hpp b/include/fc/crypto/elliptic.hpp
old mode 100644
new mode 100755
index 7d3046f..bc1eae9
--- a/include/fc/crypto/elliptic.hpp
+++ b/include/fc/crypto/elliptic.hpp
@@ -25,9 +25,7 @@ namespace fc {
typedef fc::array compact_signature;
typedef std::vector range_proof_type;
typedef fc::array extended_key_data;
- typedef fc::sha256 blinded_hash;
- typedef fc::sha256 blind_signature;
-
+
/**
* @class public_key
* @brief contains only the public point of an elliptic curve key.
@@ -38,7 +36,6 @@ namespace fc {
public_key();
public_key(const public_key& k);
~public_key();
-// bool verify( const fc::sha256& digest, const signature& sig );
public_key_data serialize()const;
public_key_point_data serialize_ecc_point()const;
@@ -52,8 +49,6 @@ namespace fc {
public_key child( const fc::sha256& offset )const;
bool valid()const;
- /** Computes new pubkey = generator * offset + old pubkey ?! */
-// public_key mult( const fc::sha256& offset )const;
/** Computes new pubkey = regenerate(offset).pubkey + old pubkey
* = offset * G + 1 * old pubkey ?! */
public_key add( const fc::sha256& offset )const;
@@ -164,8 +159,6 @@ namespace fc {
fc::string to_base58() const { return str(); }
static extended_public_key from_base58( const fc::string& base58 );
- public_key generate_p( int i ) const;
- public_key generate_q( int i ) const;
private:
sha256 c;
int child_num, parent_fp;
@@ -192,25 +185,10 @@ namespace fc {
static extended_private_key generate_master( const fc::string& seed );
static extended_private_key generate_master( const char* seed, uint32_t seed_len );
- // Oleg Andreev's blind signature scheme,
- // see http://blog.oleganza.com/post/77474860538/blind-signatures
- public_key blind_public_key( const extended_public_key& bob, int i ) const;
- blinded_hash blind_hash( const fc::sha256& hash, int i ) const;
- blind_signature blind_sign( const blinded_hash& hash, int i ) const;
- // WARNING! This may produce non-canonical signatures!
- compact_signature unblind_signature( const extended_public_key& bob,
- const blind_signature& sig,
- const fc::sha256& hash, int i ) const;
-
private:
extended_private_key private_derive_rest( const fc::sha512& hash,
int num ) const;
- private_key generate_a( int i ) const;
- private_key generate_b( int i ) const;
- private_key generate_c( int i ) const;
- private_key generate_d( int i ) const;
- private_key_secret compute_p( int i ) const;
- private_key_secret compute_q( int i, const private_key_secret& p ) const;
+
sha256 c;
int child_num, parent_fp;
uint8_t depth;
diff --git a/include/fc/crypto/hash_ctr_rng.hpp b/include/fc/crypto/hash_ctr_rng.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/hex.hpp b/include/fc/crypto/hex.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/hmac.hpp b/include/fc/crypto/hmac.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/md5.hpp b/include/fc/crypto/md5.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/openssl.hpp b/include/fc/crypto/openssl.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/pke.hpp b/include/fc/crypto/pke.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/rand.hpp b/include/fc/crypto/rand.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/ripemd160.hpp b/include/fc/crypto/ripemd160.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/sha1.hpp b/include/fc/crypto/sha1.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/sha224.hpp b/include/fc/crypto/sha224.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/crypto/sha256.hpp b/include/fc/crypto/sha256.hpp
old mode 100644
new mode 100755
index 58bba9e..39b436b
--- a/include/fc/crypto/sha256.hpp
+++ b/include/fc/crypto/sha256.hpp
@@ -119,16 +119,6 @@ namespace std
};
}
-namespace boost
-{
- template<>
- struct hash
- {
- size_t operator()( const fc::sha256& s )const
- {
- return s._hash[3];//*((size_t*)&s);
- }
- };
-}
+
#include
FC_REFLECT_TYPENAME( fc::sha256 )
diff --git a/include/fc/crypto/sha512.hpp b/include/fc/crypto/sha512.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/exception/exception.hpp b/include/fc/exception/exception.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/filesystem.hpp b/include/fc/filesystem.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/fixed_string.hpp b/include/fc/fixed_string.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/fwd.hpp b/include/fc/fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/fwd_impl.hpp b/include/fc/fwd_impl.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/git_revision.hpp b/include/fc/git_revision.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/container.hpp b/include/fc/interprocess/container.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/file_mapping.hpp b/include/fc/interprocess/file_mapping.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/file_mutex.hpp b/include/fc/interprocess/file_mutex.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/iprocess.hpp b/include/fc/interprocess/iprocess.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/mmap_struct.hpp b/include/fc/interprocess/mmap_struct.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/process.hpp b/include/fc/interprocess/process.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/interprocess/signals.hpp b/include/fc/interprocess/signals.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/buffered_iostream.hpp b/include/fc/io/buffered_iostream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/console.hpp b/include/fc/io/console.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/datastream.hpp b/include/fc/io/datastream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/datastream_back.hpp b/include/fc/io/datastream_back.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/enum_type.hpp b/include/fc/io/enum_type.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/fstream.hpp b/include/fc/io/fstream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/iobuffer.hpp b/include/fc/io/iobuffer.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/iostream.hpp b/include/fc/io/iostream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/json.hpp b/include/fc/io/json.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/json_relaxed.hpp b/include/fc/io/json_relaxed.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/raw.hpp b/include/fc/io/raw.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/raw_fwd.hpp b/include/fc/io/raw_fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/raw_unpack_file.hpp b/include/fc/io/raw_unpack_file.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/raw_variant.hpp b/include/fc/io/raw_variant.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/sstream.hpp b/include/fc/io/sstream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/stdio.hpp b/include/fc/io/stdio.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/io/varint.hpp b/include/fc/io/varint.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/appender.hpp b/include/fc/log/appender.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/console_appender.hpp b/include/fc/log/console_appender.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/file_appender.hpp b/include/fc/log/file_appender.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/gelf_appender.hpp b/include/fc/log/gelf_appender.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/log_message.hpp b/include/fc/log/log_message.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/logger.hpp b/include/fc/log/logger.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/log/logger_config.hpp b/include/fc/log/logger_config.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/make_fused.hpp b/include/fc/make_fused.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/http/connection.hpp b/include/fc/network/http/connection.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/http/server.hpp b/include/fc/network/http/server.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/http/websocket.hpp b/include/fc/network/http/websocket.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/ip.hpp b/include/fc/network/ip.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/ntp.hpp b/include/fc/network/ntp.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/rate_limiting.hpp b/include/fc/network/rate_limiting.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/resolve.hpp b/include/fc/network/resolve.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/tcp_socket.hpp b/include/fc/network/tcp_socket.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/tcp_socket_io_hooks.hpp b/include/fc/network/tcp_socket_io_hooks.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/udp_socket.hpp b/include/fc/network/udp_socket.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/network/url.hpp b/include/fc/network/url.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/noncopyable.hpp b/include/fc/noncopyable.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/optional.hpp b/include/fc/optional.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/platform_independence.hpp b/include/fc/platform_independence.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/real128.hpp b/include/fc/real128.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/reflect/reflect.hpp b/include/fc/reflect/reflect.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/reflect/typename.hpp b/include/fc/reflect/typename.hpp
old mode 100644
new mode 100755
index 312c927..5cd55c9
--- a/include/fc/reflect/typename.hpp
+++ b/include/fc/reflect/typename.hpp
@@ -15,7 +15,7 @@ namespace fc {
class exception;
namespace ip { class address; }
- template class get_typename{};
+ template struct get_typename;
template<> struct get_typename { static const char* name() { return "int32_t"; } };
template<> struct get_typename { static const char* name() { return "int64_t"; } };
template<> struct get_typename { static const char* name() { return "int16_t"; } };
diff --git a/include/fc/reflect/variant.hpp b/include/fc/reflect/variant.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/api_connection.hpp b/include/fc/rpc/api_connection.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/binary_api_connection.hpp b/include/fc/rpc/binary_api_connection.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/bstate.hpp b/include/fc/rpc/bstate.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/cli.hpp b/include/fc/rpc/cli.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/http_api.hpp b/include/fc/rpc/http_api.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/json_connection.hpp b/include/fc/rpc/json_connection.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/state.hpp b/include/fc/rpc/state.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/variant_connection.hpp b/include/fc/rpc/variant_connection.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/variant_stream.hpp b/include/fc/rpc/variant_stream.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/rpc/websocket_api.hpp b/include/fc/rpc/websocket_api.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/safe.hpp b/include/fc/safe.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/scoped_exit.hpp b/include/fc/scoped_exit.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/shared_ptr.hpp b/include/fc/shared_ptr.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/signal.hpp b/include/fc/signal.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/signals.hpp b/include/fc/signals.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/smart_ref_fwd.hpp b/include/fc/smart_ref_fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/smart_ref_impl.hpp b/include/fc/smart_ref_impl.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp
old mode 100644
new mode 100755
index 9aab790..d6206c2
--- a/include/fc/static_variant.hpp
+++ b/include/fc/static_variant.hpp
@@ -382,5 +382,5 @@ struct visitor {
s.visit( to_static_variant(ar[1]) );
}
- template struct get_typename { static const char* name() { return typeid(static_variant).name(); } };
+ template struct get_typename { static const char* name() { return typeid(static_variant).name(); } };
} // namespace fc
diff --git a/include/fc/string.hpp b/include/fc/string.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/mutex.hpp b/include/fc/thread/mutex.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/non_preemptable_scope_check.hpp b/include/fc/thread/non_preemptable_scope_check.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/priority.hpp b/include/fc/thread/priority.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/scoped_lock.hpp b/include/fc/thread/scoped_lock.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/spin_lock.hpp b/include/fc/thread/spin_lock.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/spin_yield_lock.hpp b/include/fc/thread/spin_yield_lock.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/task.hpp b/include/fc/thread/task.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/thread.hpp b/include/fc/thread/thread.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/thread_specific.hpp b/include/fc/thread/thread_specific.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/unique_lock.hpp b/include/fc/thread/unique_lock.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/thread/wait_condition.hpp b/include/fc/thread/wait_condition.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/time.hpp b/include/fc/time.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/tuple.hpp b/include/fc/tuple.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/uint128.hpp b/include/fc/uint128.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/unique_ptr.hpp b/include/fc/unique_ptr.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/utf8.hpp b/include/fc/utf8.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/utility.hpp b/include/fc/utility.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/variant.hpp b/include/fc/variant.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/variant_object.hpp b/include/fc/variant_object.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/vector.hpp b/include/fc/vector.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/vector_fwd.hpp b/include/fc/vector_fwd.hpp
old mode 100644
new mode 100755
diff --git a/include/fc/wait_any.hpp b/include/fc/wait_any.hpp
old mode 100644
new mode 100755
diff --git a/src/asio.cpp b/src/asio.cpp
old mode 100644
new mode 100755
diff --git a/src/byteswap.hpp b/src/byteswap.hpp
old mode 100644
new mode 100755
diff --git a/src/compress/miniz.c b/src/compress/miniz.c
old mode 100644
new mode 100755
diff --git a/src/compress/smaz.cpp b/src/compress/smaz.cpp
old mode 100644
new mode 100755
diff --git a/src/compress/zlib.cpp b/src/compress/zlib.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/_digest_common.cpp b/src/crypto/_digest_common.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/_digest_common.hpp b/src/crypto/_digest_common.hpp
old mode 100644
new mode 100755
diff --git a/src/crypto/_elliptic_impl_priv.hpp b/src/crypto/_elliptic_impl_priv.hpp
old mode 100644
new mode 100755
diff --git a/src/crypto/_elliptic_impl_pub.hpp b/src/crypto/_elliptic_impl_pub.hpp
old mode 100644
new mode 100755
diff --git a/src/crypto/aes.cpp b/src/crypto/aes.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/base36.cpp b/src/crypto/base36.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/base58.cpp b/src/crypto/base58.cpp
old mode 100644
new mode 100755
index e1d5d33..ad1b7de
--- a/src/crypto/base58.cpp
+++ b/src/crypto/base58.cpp
@@ -66,74 +66,72 @@ public:
/** C++ wrapper for BIGNUM (OpenSSL bignum) */
-class CBigNum : public BIGNUM
+class CBigNum
{
+ BIGNUM* bn;
public:
CBigNum()
- {
- BN_init(this);
- }
+ : bn(BN_new()) {}
CBigNum(const CBigNum& b)
+ : CBigNum()
{
- BN_init(this);
- if (!BN_copy(this, &b))
+ if (!BN_copy(bn, b.bn))
{
- BN_clear_free(this);
+ BN_clear_free(bn);
throw bignum_error("CBigNum::CBigNum(const CBigNum&) : BN_copy failed");
}
}
CBigNum& operator=(const CBigNum& b)
{
- if (!BN_copy(this, &b))
+ if (!BN_copy(bn, b.bn))
throw bignum_error("CBigNum::operator= : BN_copy failed");
return (*this);
}
~CBigNum()
{
- BN_clear_free(this);
+ BN_clear_free(bn);
}
//CBigNum(char n) is not portable. Use 'signed char' or 'unsigned char'.
- CBigNum(signed char n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
- CBigNum(short n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
- CBigNum(int n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
- //CBigNum(long n) { BN_init(this); if (n >= 0) setulong(n); else setint64(n); }
- CBigNum(int64_t n) { BN_init(this); setint64(n); }
- CBigNum(unsigned char n) { BN_init(this); setulong(n); }
- CBigNum(unsigned short n) { BN_init(this); setulong(n); }
- CBigNum(unsigned int n) { BN_init(this); setulong(n); }
- //CBigNum(unsigned long n) { BN_init(this); setulong(n); }
- CBigNum(uint64_t n) { BN_init(this); setuint64(n); }
+ CBigNum(signed char n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); }
+ CBigNum(short n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); }
+ CBigNum(int n) :CBigNum() { if (n >= 0) setulong(n); else setint64(n); }
+ CBigNum(int64_t n) :CBigNum() { setint64(n); }
+ CBigNum(unsigned char n) :CBigNum() { setulong(n); }
+ CBigNum(unsigned short n) :CBigNum() { setulong(n); }
+ CBigNum(unsigned int n) :CBigNum() { setulong(n); }
+ CBigNum(uint64_t n) :CBigNum() { setuint64(n); }
+
explicit CBigNum(const std::vector& vch)
+ : CBigNum()
{
- BN_init(this);
setvch(vch);
}
void setulong(unsigned long n)
{
- if (!BN_set_word(this, n))
+ if (!BN_set_word(bn, n))
throw bignum_error("CBigNum conversion from unsigned long : BN_set_word failed");
}
unsigned long getulong() const
{
- return BN_get_word(this);
+ return BN_get_word(bn);
}
unsigned int getuint() const
{
- return BN_get_word(this);
+ return BN_get_word(bn);
}
int getint() const
{
- unsigned long n = BN_get_word(this);
- if (!BN_is_negative(this))
+ unsigned long n = BN_get_word(bn);
+ if (!BN_is_negative(bn))
return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::max() : n);
else
return (n > (unsigned long)std::numeric_limits::max() ? std::numeric_limits::min() : -(int)n);
@@ -171,7 +169,7 @@ public:
pch[1] = (nSize >> 16) & 0xff;
pch[2] = (nSize >> 8) & 0xff;
pch[3] = (nSize) & 0xff;
- BN_mpi2bn(pch, p - pch, this);
+ BN_mpi2bn(pch, p - pch, bn);
}
void setuint64(uint64_t n)
@@ -198,7 +196,7 @@ public:
pch[1] = (nSize >> 16) & 0xff;
pch[2] = (nSize >> 8) & 0xff;
pch[3] = (nSize) & 0xff;
- BN_mpi2bn(pch, p - pch, this);
+ BN_mpi2bn(pch, p - pch, bn);
}
@@ -214,16 +212,16 @@ public:
vch2[3] = (nSize >> 0) & 0xff;
// swap data to big endian
reverse_copy(vch.begin(), vch.end(), vch2.begin() + 4);
- BN_mpi2bn(&vch2[0], vch2.size(), this);
+ BN_mpi2bn(&vch2[0], vch2.size(), bn);
}
std::vector getvch() const
{
- unsigned int nSize = BN_bn2mpi(this, NULL);
+ unsigned int nSize = BN_bn2mpi(bn, NULL);
if (nSize <= 4)
return std::vector();
std::vector vch(nSize);
- BN_bn2mpi(this, &vch[0]);
+ BN_bn2mpi(bn, &vch[0]);
vch.erase(vch.begin(), vch.begin() + 4);
reverse(vch.begin(), vch.end());
return vch;
@@ -237,16 +235,16 @@ public:
if (nSize >= 1) vch[4] = (nCompact >> 16) & 0xff;
if (nSize >= 2) vch[5] = (nCompact >> 8) & 0xff;
if (nSize >= 3) vch[6] = (nCompact >> 0) & 0xff;
- BN_mpi2bn(&vch[0], vch.size(), this);
+ BN_mpi2bn(&vch[0], vch.size(), bn);
return *this;
}
unsigned int GetCompact() const
{
- unsigned int nSize = BN_bn2mpi(this, NULL);
+ unsigned int nSize = BN_bn2mpi(bn, NULL);
std::vector vch(nSize);
nSize -= 4;
- BN_bn2mpi(this, &vch[0]);
+ BN_bn2mpi(bn, &vch[0]);
unsigned int nCompact = nSize << 24;
if (nSize >= 1) nCompact |= (vch[4] << 16);
if (nSize >= 2) nCompact |= (vch[5] << 8);
@@ -281,7 +279,7 @@ public:
*this += n;
}
if (fNegative)
- *this = 0 - *this;
+ BN_set_negative(bn, 1);
}
std::string ToString(int nBase=10) const
@@ -291,20 +289,20 @@ public:
CBigNum bn0 = 0;
std::string str;
CBigNum bn = *this;
- BN_set_negative(&bn, false);
+ BN_set_negative(bn.bn, false);
CBigNum dv;
CBigNum rem;
- if (BN_cmp(&bn, &bn0) == 0)
+ if (BN_cmp(bn.bn, bn0.bn) == 0)
return "0";
- while (BN_cmp(&bn, &bn0) > 0)
+ while (BN_cmp(bn.bn, bn0.bn) > 0)
{
- if (!BN_div(&dv, &rem, &bn, &bnBase, pctx))
+ if (!BN_div(dv.bn, rem.bn, bn.bn, bnBase.bn, pctx))
throw bignum_error("CBigNum::ToString() : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
str += "0123456789abcdef"[c];
}
- if (BN_is_negative(this))
+ if (BN_is_negative(this->bn))
str += "-";
reverse(str.begin(), str.end());
return str;
@@ -319,45 +317,50 @@ public:
bool operator!() const
{
- return BN_is_zero(this);
+ return BN_is_zero(bn);
}
CBigNum& operator+=(const CBigNum& b)
{
- if (!BN_add(this, this, &b))
+ if (!BN_add(bn, bn, b.bn))
throw bignum_error("CBigNum::operator+= : BN_add failed");
return *this;
}
CBigNum& operator-=(const CBigNum& b)
{
- *this = *this - b;
+ if (!BN_sub(bn, bn, b.bn))
+ throw bignum_error("CBigNum::operator-= : BN_sub failed");
return *this;
}
CBigNum& operator*=(const CBigNum& b)
{
CAutoBN_CTX pctx;
- if (!BN_mul(this, this, &b, pctx))
+ if (!BN_mul(bn, bn, b.bn, pctx))
throw bignum_error("CBigNum::operator*= : BN_mul failed");
return *this;
}
CBigNum& operator/=(const CBigNum& b)
{
- *this = *this / b;
+ CAutoBN_CTX pctx;
+ if (!BN_div(bn, NULL, bn, b.bn, pctx))
+ throw bignum_error("CBigNum::operator/= : BN_div failed");
return *this;
}
CBigNum& operator%=(const CBigNum& b)
{
- *this = *this % b;
+ CAutoBN_CTX pctx;
+ if (!BN_div(NULL, bn, bn, b.bn, pctx))
+ throw bignum_error("CBigNum::operator%= : BN_div failed");
return *this;
}
CBigNum& operator<<=(unsigned int shift)
{
- if (!BN_lshift(this, this, shift))
+ if (!BN_lshift(bn, bn, shift))
throw bignum_error("CBigNum:operator<<= : BN_lshift failed");
return *this;
}
@@ -368,13 +371,13 @@ public:
// if built on ubuntu 9.04 or 9.10, probably depends on version of openssl
CBigNum a = 1;
a <<= shift;
- if (BN_cmp(&a, this) > 0)
+ if (BN_cmp(a.bn, bn) > 0)
{
*this = 0;
return *this;
}
- if (!BN_rshift(this, this, shift))
+ if (!BN_rshift(bn, bn, shift))
throw bignum_error("CBigNum:operator>>= : BN_rshift failed");
return *this;
}
@@ -383,7 +386,7 @@ public:
CBigNum& operator++()
{
// prefix operator
- if (!BN_add(this, this, BN_value_one()))
+ if (!BN_add(bn, bn, BN_value_one()))
throw bignum_error("CBigNum::operator++ : BN_add failed");
return *this;
}
@@ -400,7 +403,7 @@ public:
{
// prefix operator
CBigNum r;
- if (!BN_sub(&r, this, BN_value_one()))
+ if (!BN_sub(r.bn, bn, BN_value_one()))
throw bignum_error("CBigNum::operator-- : BN_sub failed");
*this = r;
return *this;
@@ -414,10 +417,12 @@ public:
return ret;
}
-
- friend inline const CBigNum operator-(const CBigNum& a, const CBigNum& b);
- friend inline const CBigNum operator/(const CBigNum& a, const CBigNum& b);
- friend inline const CBigNum operator%(const CBigNum& a, const CBigNum& b);
+ const BIGNUM* to_bignum() const {
+ return bn;
+ }
+ BIGNUM* to_bignum() {
+ return bn;
+ }
};
@@ -425,7 +430,7 @@ public:
inline const CBigNum operator+(const CBigNum& a, const CBigNum& b)
{
CBigNum r;
- if (!BN_add(&r, &a, &b))
+ if (!BN_add(r.to_bignum(), a.to_bignum(), b.to_bignum()))
throw bignum_error("CBigNum::operator+ : BN_add failed");
return r;
}
@@ -433,7 +438,7 @@ inline const CBigNum operator+(const CBigNum& a, const CBigNum& b)
inline const CBigNum operator-(const CBigNum& a, const CBigNum& b)
{
CBigNum r;
- if (!BN_sub(&r, &a, &b))
+ if (!BN_sub(r.to_bignum(), a.to_bignum(), b.to_bignum()))
throw bignum_error("CBigNum::operator- : BN_sub failed");
return r;
}
@@ -441,7 +446,7 @@ inline const CBigNum operator-(const CBigNum& a, const CBigNum& b)
inline const CBigNum operator-(const CBigNum& a)
{
CBigNum r(a);
- BN_set_negative(&r, !BN_is_negative(&r));
+ BN_set_negative(r.to_bignum(), !BN_is_negative(r.to_bignum()));
return r;
}
@@ -449,7 +454,7 @@ inline const CBigNum operator*(const CBigNum& a, const CBigNum& b)
{
CAutoBN_CTX pctx;
CBigNum r;
- if (!BN_mul(&r, &a, &b, pctx))
+ if (!BN_mul(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx))
throw bignum_error("CBigNum::operator* : BN_mul failed");
return r;
}
@@ -458,7 +463,7 @@ inline const CBigNum operator/(const CBigNum& a, const CBigNum& b)
{
CAutoBN_CTX pctx;
CBigNum r;
- if (!BN_div(&r, NULL, &a, &b, pctx))
+ if (!BN_div(r.to_bignum(), NULL, a.to_bignum(), b.to_bignum(), pctx))
throw bignum_error("CBigNum::operator/ : BN_div failed");
return r;
}
@@ -467,7 +472,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b)
{
CAutoBN_CTX pctx;
CBigNum r;
- if (!BN_mod(&r, &a, &b, pctx))
+ if (!BN_mod(r.to_bignum(), a.to_bignum(), b.to_bignum(), pctx))
throw bignum_error("CBigNum::operator% : BN_div failed");
return r;
}
@@ -475,7 +480,7 @@ inline const CBigNum operator%(const CBigNum& a, const CBigNum& b)
inline const CBigNum operator<<(const CBigNum& a, unsigned int shift)
{
CBigNum r;
- if (!BN_lshift(&r, &a, shift))
+ if (!BN_lshift(r.to_bignum(), a.to_bignum(), shift))
throw bignum_error("CBigNum:operator<< : BN_lshift failed");
return r;
}
@@ -487,12 +492,12 @@ inline const CBigNum operator>>(const CBigNum& a, unsigned int shift)
return r;
}
-inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) == 0); }
-inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) != 0); }
-inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) <= 0); }
-inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) >= 0); }
-inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) < 0); }
-inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(&a, &b) > 0); }
+inline bool operator==(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) == 0); }
+inline bool operator!=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) != 0); }
+inline bool operator<=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) <= 0); }
+inline bool operator>=(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) >= 0); }
+inline bool operator<(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) < 0); }
+inline bool operator>(const CBigNum& a, const CBigNum& b) { return (BN_cmp(a.to_bignum(), b.to_bignum()) > 0); }
static const char* pszBase58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -522,7 +527,7 @@ inline std::string EncodeBase58(const unsigned char* pbegin, const unsigned char
CBigNum rem;
while (bn > bn0)
{
- if (!BN_div(&dv, &rem, &bn, &bn58, pctx))
+ if (!BN_div(dv.to_bignum(), rem.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx))
throw bignum_error("EncodeBase58 : BN_div failed");
bn = dv;
unsigned int c = rem.getulong();
@@ -572,7 +577,7 @@ inline bool DecodeBase58(const char* psz, std::vector& vchRet)
break;
}
bnChar.setulong(p1 - pszBase58);
- if (!BN_mul(&bn, &bn, &bn58, pctx))
+ if (!BN_mul(bn.to_bignum(), bn.to_bignum(), bn58.to_bignum(), pctx))
throw bignum_error("DecodeBase58 : BN_mul failed");
bn += bnChar;
}
diff --git a/src/crypto/base64.cpp b/src/crypto/base64.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/bigint.cpp b/src/crypto/bigint.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/blowfish.cpp b/src/crypto/blowfish.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/city.cpp b/src/crypto/city.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/crc.cpp b/src/crypto/crc.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/dh.cpp b/src/crypto/dh.cpp
old mode 100644
new mode 100755
index cbd7dcc..7e87437
--- a/src/crypto/dh.cpp
+++ b/src/crypto/dh.cpp
@@ -12,10 +12,19 @@ namespace fc {
bool diffie_hellman::generate_params( int s, uint8_t g )
{
- ssl_dh dh = DH_generate_parameters( s, g, NULL, NULL );
+ ssl_dh dh(DH_new());
+ DH_generate_parameters_ex(dh.obj, s, g, NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const BIGNUM* bn_p; // must not be free'd!
+ DH_get0_pqg(dh.obj, &bn_p, NULL, NULL);
+ p.resize( BN_num_bytes( bn_p ) );
+ if( p.size() )
+ BN_bn2bin( bn_p, (unsigned char*)&p.front() );
+#else
p.resize( BN_num_bytes( dh->p ) );
if( p.size() )
BN_bn2bin( dh->p, (unsigned char*)&p.front() );
+#endif
this->g = g;
return fc::validate( dh, valid );
}
@@ -25,8 +34,14 @@ namespace fc {
if( !p.size() )
return valid = false;
ssl_dh dh = DH_new();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
+ const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+ DH_set0_pqg(dh.obj, bn_p, NULL, bn_g);
+#else
dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+#endif
return fc::validate( dh, valid );
}
@@ -35,8 +50,14 @@ namespace fc {
if( !p.size() )
return valid = false;
ssl_dh dh = DH_new();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
+ const auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+ DH_set0_pqg(dh.obj, bn_p, NULL, bn_g);
+#else
dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+#endif
if( !fc::validate( dh, valid ) )
{
@@ -44,21 +65,42 @@ namespace fc {
}
DH_generate_key(dh);
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ const BIGNUM* bn_pub_key; // must not be free'd!
+ const BIGNUM* bn_priv_key; // must not be free'd!
+ DH_get0_key(dh.obj, &bn_pub_key, &bn_priv_key);
+ pub_key.resize( BN_num_bytes( bn_pub_key ) );
+ priv_key.resize( BN_num_bytes( bn_priv_key ) );
+ if( pub_key.size() )
+ BN_bn2bin( bn_pub_key, (unsigned char*)&pub_key.front() );
+ if( priv_key.size() )
+ BN_bn2bin( bn_priv_key, (unsigned char*)&priv_key.front() );
+#else
pub_key.resize( BN_num_bytes( dh->pub_key ) );
priv_key.resize( BN_num_bytes( dh->priv_key ) );
if( pub_key.size() )
BN_bn2bin( dh->pub_key, (unsigned char*)&pub_key.front() );
if( priv_key.size() )
BN_bn2bin( dh->priv_key, (unsigned char*)&priv_key.front() );
+#endif
return true;
}
bool diffie_hellman::compute_shared_key( const char* buf, uint32_t s ) {
ssl_dh dh = DH_new();
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ auto bn_p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
+ auto bn_pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL );
+ auto bn_priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL );
+ auto bn_g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+ DH_set0_pqg(dh.obj, bn_p, NULL, bn_g);
+ DH_set0_key(dh.obj, bn_pub_key, bn_priv_key);
+#else
dh->p = BN_bin2bn( (unsigned char*)&p.front(), p.size(), NULL );
dh->pub_key = BN_bin2bn( (unsigned char*)&pub_key.front(), pub_key.size(), NULL );
dh->priv_key = BN_bin2bn( (unsigned char*)&priv_key.front(), priv_key.size(), NULL );
dh->g = BN_bin2bn( (unsigned char*)&g, 1, NULL );
+#endif
int check;
DH_check(dh,&check);
diff --git a/src/crypto/elliptic_common.cpp b/src/crypto/elliptic_common.cpp
old mode 100644
new mode 100755
index 66b75d0..16a57cb
--- a/src/crypto/elliptic_common.cpp
+++ b/src/crypto/elliptic_common.cpp
@@ -231,11 +231,12 @@ namespace fc { namespace ecc {
static fc::string _to_base58( const extended_key_data& key )
{
- char *buffer = (char*)alloca(key.size() + 4);
+ size_t buf_len = key.size() + 4;
+ char *buffer = (char*)alloca(buf_len);
memcpy( buffer, key.begin(), key.size() );
fc::sha256 double_hash = fc::sha256::hash( fc::sha256::hash( key.begin(), key.size() ));
memcpy( buffer + key.size(), double_hash.data(), 4 );
- return fc::to_base58( buffer, sizeof(buffer) );
+ return fc::to_base58( buffer, buf_len );
}
static void _parse_extended_data( unsigned char* buffer, fc::string base58 )
@@ -301,9 +302,6 @@ namespace fc { namespace ecc {
return extended_public_key( get_public_key(), c, child_num, parent_fp, depth );
}
- public_key extended_public_key::generate_p(int i) const { return derive_normal_child(2*i + 0); }
- public_key extended_public_key::generate_q(int i) const { return derive_normal_child(2*i + 1); }
-
extended_private_key extended_private_key::derive_child(int i) const
{
return i < 0 ? derive_hardened_child(i) : derive_normal_child(i);
@@ -346,11 +344,6 @@ namespace fc { namespace ecc {
return from_base58( _to_base58( data ) );
}
- private_key extended_private_key::generate_a(int i) const { return derive_hardened_child(4*i + 0); }
- private_key extended_private_key::generate_b(int i) const { return derive_hardened_child(4*i + 1); }
- private_key extended_private_key::generate_c(int i) const { return derive_hardened_child(4*i + 2); }
- private_key extended_private_key::generate_d(int i) const { return derive_hardened_child(4*i + 3); }
-
fc::string extended_private_key::str() const
{
return _to_base58( serialize_extended() );
diff --git a/src/crypto/elliptic_impl_priv.cpp b/src/crypto/elliptic_impl_priv.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/elliptic_impl_pub.cpp b/src/crypto/elliptic_impl_pub.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/elliptic_mixed.cpp b/src/crypto/elliptic_mixed.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/elliptic_openssl.cpp b/src/crypto/elliptic_openssl.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/elliptic_secp256k1.cpp b/src/crypto/elliptic_secp256k1.cpp
old mode 100644
new mode 100755
index 91edc18..515d086
--- a/src/crypto/elliptic_secp256k1.cpp
+++ b/src/crypto/elliptic_secp256k1.cpp
@@ -185,164 +185,6 @@ namespace fc { namespace ecc {
return result;
}
- static void to_bignum( const unsigned char* in, ssl_bignum& out, unsigned int len )
- {
- if ( *in & 0x80 )
- {
- unsigned char *buffer = (unsigned char*)alloca(len + 1);
- *buffer = 0;
- memcpy( buffer + 1, in, len );
- BN_bin2bn( buffer, sizeof(buffer), out );
- }
- else
- {
- BN_bin2bn( in, len, out );
- }
- }
-
- static void to_bignum( const private_key_secret& in, ssl_bignum& out )
- {
- to_bignum( (unsigned char*) in.data(), out, in.data_size() );
- }
-
- static void from_bignum( const ssl_bignum& in, unsigned char* out, unsigned int len )
- {
- unsigned int l = BN_num_bytes( in );
- if ( l > len )
- {
- unsigned char *buffer = (unsigned char*)alloca(l);
- BN_bn2bin( in, buffer );
- memcpy( out, buffer + l - len, len );
- }
- else
- {
- memset( out, 0, len - l );
- BN_bn2bin( in, out + len - l );
- }
- }
-
- static void from_bignum( const ssl_bignum& in, private_key_secret& out )
- {
- from_bignum( in, (unsigned char*) out.data(), out.data_size() );
- }
-
- static void invert( const private_key_secret& in, private_key_secret& out )
- {
- ssl_bignum bn_in;
- to_bignum( in, bn_in );
- ssl_bignum bn_n;
- to_bignum( detail::get_curve_order(), bn_n );
- ssl_bignum bn_inv;
- bn_ctx ctx( BN_CTX_new() );
- FC_ASSERT( BN_mod_inverse( bn_inv, bn_in, bn_n, ctx ) );
- from_bignum( bn_inv, out );
- }
-
- static void to_point( const public_key_data& in, ec_point& out )
- {
- bn_ctx ctx( BN_CTX_new() );
- const ec_group& curve = detail::get_curve();
- private_key_secret x;
- memcpy( x.data(), in.begin() + 1, x.data_size() );
- ssl_bignum bn_x;
- to_bignum( x, bn_x );
- FC_ASSERT( EC_POINT_set_compressed_coordinates_GFp( curve, out, bn_x, *in.begin() & 1, ctx ) > 0 );
- }
-
- static void from_point( const ec_point& in, public_key_data& out )
- {
- bn_ctx ctx( BN_CTX_new() );
- const ec_group& curve = detail::get_curve();
- ssl_bignum bn_x;
- ssl_bignum bn_y;
- FC_ASSERT( EC_POINT_get_affine_coordinates_GFp( curve, in, bn_x, bn_y, ctx ) > 0 );
- private_key_secret x;
- from_bignum( bn_x, x );
- memcpy( out.begin() + 1, x.data(), out.size() - 1 );
- *out.begin() = BN_is_bit_set( bn_y, 0 ) ? 3 : 2;
- }
-
-// static void print(const unsigned char* data) {
-// for (int i = 0; i < 32; i++) {
-// printf("%02x", *data++);
-// }
-// }
-//
-// static void print(private_key_secret key) {
-// print((unsigned char*) key.data());
-// }
-//
-// static void print(public_key_data key) {
-// print((unsigned char*) key.begin() + 1);
-// }
-
- static void canonicalize( unsigned char *int256 )
- {
- fc::sha256 biggi( (char*) int256, 32 );
- if ( detail::get_half_curve_order() >= biggi )
- {
- return; // nothing to do
- }
- ssl_bignum bn_k;
- to_bignum( int256, bn_k, 32 );
- ssl_bignum bn_n;
- to_bignum( detail::get_curve_order(), bn_n );
- FC_ASSERT( BN_sub( bn_k, bn_n, bn_k ) );
- from_bignum( bn_k, int256, 32 );
- }
-
- static public_key compute_k( const private_key_secret& a, const private_key_secret& c,
- const public_key& p )
- {
- private_key_secret prod = a;
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) c.data() ) > 0 );
- invert( prod, prod );
- public_key_data P = p.serialize();
- FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) P.begin(), P.size(), (unsigned char*) prod.data() ) );
-// printf("K: "); print(P); printf("\n");
- return public_key( P );
- }
-
- static public_key compute_t( const private_key_secret& a, const private_key_secret& b,
- const private_key_secret& c, const private_key_secret& d,
- const public_key_data& p, const public_key_data& q )
- {
- private_key_secret prod;
- invert( c, prod ); // prod == c^-1
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) d.data() ) > 0 );
- // prod == c^-1 * d
-
- public_key_data accu = p;
- FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) );
- // accu == prod * P == c^-1 * d * P
-
- ec_point point_accu( EC_POINT_new( detail::get_curve() ) );
- to_point( accu, point_accu );
- ec_point point_q( EC_POINT_new( detail::get_curve() ) );
- to_point( q, point_q );
- bn_ctx ctx(BN_CTX_new());
- FC_ASSERT( EC_POINT_add( detail::get_curve(), point_accu, point_accu, point_q, ctx ) > 0 );
- from_point( point_accu, accu );
- // accu == c^-1 * a * P + Q
-
- FC_ASSERT( secp256k1_ec_pubkey_tweak_add( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) b.data() ) );
- // accu == c^-1 * a * P + Q + b*G
-
- public_key_data k = compute_k( a, c, p ).serialize();
- memcpy( prod.data(), k.begin() + 1, prod.data_size() );
- // prod == Kx
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) prod.data(), (unsigned char*) a.data() ) > 0 );
- // prod == Kx * a
- invert( prod, prod );
- // prod == (Kx * a)^-1
-
- FC_ASSERT( secp256k1_ec_pubkey_tweak_mul( detail::_get_context(), (unsigned char*) accu.begin(), accu.size(), (unsigned char*) prod.data() ) );
- // accu == (c^-1 * a * P + Q + b*G) * (Kx * a)^-1
-
-// printf("T: "); print(accu); printf("\n");
- return public_key( accu );
- }
-
extended_private_key::extended_private_key( const private_key& k, const sha256& c,
int child, int parent, uint8_t depth )
: private_key(k), c(c), child_num(child), parent_fp(parent), depth(depth) { }
@@ -358,102 +200,6 @@ namespace fc { namespace ecc {
return result;
}
- public_key extended_private_key::blind_public_key( const extended_public_key& bob, int i ) const
- {
- private_key_secret a = generate_a(i).get_secret();
- private_key_secret b = generate_b(i).get_secret();
- private_key_secret c = generate_c(i).get_secret();
- private_key_secret d = generate_d(i).get_secret();
- public_key_data p = bob.generate_p(i).serialize();
- public_key_data q = bob.generate_q(i).serialize();
-// printf("a: "); print(a); printf("\n");
-// printf("b: "); print(b); printf("\n");
-// printf("c: "); print(c); printf("\n");
-// printf("d: "); print(d); printf("\n");
-// printf("P: "); print(p); printf("\n");
-// printf("Q: "); print(q); printf("\n");
- return compute_t( a, b, c, d, p, q );
- }
-
- blinded_hash extended_private_key::blind_hash( const fc::sha256& hash, int i ) const
- {
- private_key_secret a = generate_a(i).get_secret();
- private_key_secret b = generate_b(i).get_secret();
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) hash.data() ) > 0 );
- FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) a.data(), (unsigned char*) b.data() ) > 0 );
-// printf("hash: "); print(hash); printf("\n");
-// printf("blinded: "); print(a); printf("\n");
- return a;
- }
-
- private_key_secret extended_private_key::compute_p( int i ) const
- {
- private_key_secret p_inv = derive_normal_child( 2*i ).get_secret();
- invert( p_inv, p_inv );
-// printf("p: "); print(p_inv); printf("\n");
- return p_inv;
- }
-
- private_key_secret extended_private_key::compute_q( int i, const private_key_secret& p ) const
- {
- private_key_secret q = derive_normal_child( 2*i + 1 ).get_secret();
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) q.data(), (unsigned char*) p.data() ) > 0 );
-// printf("q: "); print(q); printf("\n");
- return q;
- }
-
- blind_signature extended_private_key::blind_sign( const blinded_hash& hash, int i ) const
- {
- private_key_secret p = compute_p( i );
- private_key_secret q = compute_q( i, p );
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) hash.data() ) > 0 );
- FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) p.data(), (unsigned char*) q.data() ) > 0 );
-// printf("blind_sig: "); print(p); printf("\n");
- return p;
- }
-
- compact_signature extended_private_key::unblind_signature( const extended_public_key& bob,
- const blind_signature& sig,
- const fc::sha256& hash,
- int i ) const
- {
- private_key_secret a = generate_a(i).get_secret();
- private_key_secret b = generate_b(i).get_secret();
- private_key_secret c = generate_c(i).get_secret();
- private_key_secret d = generate_d(i).get_secret();
- public_key p = bob.generate_p(i);
- public_key q = bob.generate_q(i);
- public_key_data k = compute_k( a, c, p );
- public_key_data t = compute_t( a, b, c, d, p, q ).serialize();
-
- FC_ASSERT( secp256k1_ec_privkey_tweak_mul( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) sig.data() ) > 0 );
- FC_ASSERT( secp256k1_ec_privkey_tweak_add( detail::_get_context(), (unsigned char*) c.data(), (unsigned char*) d.data() ) > 0 );
-
- compact_signature result;
- memcpy( result.begin() + 1, k.begin() + 1, 32 );
- memcpy( result.begin() + 33, c.data(), 32 );
- canonicalize( result.begin() + 33 );
-// printf("unblinded: "); print(result.begin() + 33); printf("\n");
- for ( int i = 0; i < 4; i++ )
- {
- unsigned char pubkey[33];
- int pklen = 33;
- if ( secp256k1_ecdsa_recover_compact( detail::_get_context(), (unsigned char*) hash.data(),
- (unsigned char*) result.begin() + 1,
- pubkey, &pklen, 1, i ) )
- {
- if ( !memcmp( t.begin(), pubkey, sizeof(pubkey) ) )
- {
- *result.begin() = 27 + 4 + i;
- return result;
-// } else {
-// printf("Candidate: "); print( pubkey ); printf("\n");
- }
- }
- }
- FC_ASSERT( 0, "Failed to unblind - use different i" );
- }
-
commitment_type blind( const blind_factor_type& blind, uint64_t value )
{
commitment_type result;
diff --git a/src/crypto/hex.cpp b/src/crypto/hex.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/md5.cpp b/src/crypto/md5.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/openssl.cpp b/src/crypto/openssl.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/pke.cpp b/src/crypto/pke.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/rand.cpp b/src/crypto/rand.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/ripemd160.cpp b/src/crypto/ripemd160.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/sha1.cpp b/src/crypto/sha1.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/sha224.cpp b/src/crypto/sha224.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp
old mode 100644
new mode 100755
diff --git a/src/crypto/sha512.cpp b/src/crypto/sha512.cpp
old mode 100644
new mode 100755
diff --git a/src/exception.cpp b/src/exception.cpp
old mode 100644
new mode 100755
diff --git a/src/filesystem.cpp b/src/filesystem.cpp
old mode 100644
new mode 100755
index a7151c5..3046d56
--- a/src/filesystem.cpp
+++ b/src/filesystem.cpp
@@ -245,10 +245,16 @@ namespace fc {
void remove_all( const path& p ) { boost::filesystem::remove_all(p); }
void copy( const path& f, const path& t ) {
try {
- boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t) );
+ boost::system::error_code ec;
+ boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t), ec );
+ if( ec )
+ {
+ FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${code} : ${message}",
+ ("srcfile",f)("dstfile",t)("code",ec.value())("message",ec.message()) );
+ }
} catch ( boost::system::system_error& e ) {
FC_THROW( "Copy from ${srcfile} to ${dstfile} failed because ${reason}",
- ("srcfile",f)("dstfile",t)("reason",e.what() ) );
+ ("srcfile",f)("dstfile",t)("reason",std::string(e.what()) ) );
} catch ( ... ) {
FC_THROW( "Copy from ${srcfile} to ${dstfile} failed",
("srcfile",f)("dstfile",t)("inner", fc::except_str() ) );
@@ -262,7 +268,7 @@ namespace fc {
catch ( boost::system::system_error& e )
{
FC_THROW( "Resize file '${f}' to size ${s} failed: ${reason}",
- ("f",f)("s",t)( "reason", e.what() ) );
+ ("f",f)("s",t)( "reason", std::string(e.what()) ) );
}
catch ( ... )
{
@@ -301,13 +307,14 @@ namespace fc {
void rename( const path& f, const path& t ) {
try {
boost::filesystem::rename( boost::filesystem::path(f), boost::filesystem::path(t) );
- } catch ( boost::system::system_error& ) {
- try{
- boost::filesystem::copy( boost::filesystem::path(f), boost::filesystem::path(t) );
- boost::filesystem::remove( boost::filesystem::path(f));
- } catch ( boost::system::system_error& e ) {
- FC_THROW( "Rename from ${srcfile} to ${dstfile} failed because ${reason}",
- ("srcfile",f)("dstfile",t)("reason",e.what() ) );
+ } catch ( boost::system::system_error& er ) {
+ try {
+ copy( f, t );
+ remove( f );
+ } catch ( fc::exception& e ) {
+ FC_RETHROW_EXCEPTION( e, error,
+ "Rename from ${srcfile} to ${dstfile} failed due to ${reason}, trying to copy then remove",
+ ("srcfile",f)("dstfile",t)("reason",std::string(er.what())) );
}
} catch ( ... ) {
FC_THROW( "Rename from ${srcfile} to ${dstfile} failed",
diff --git a/src/git_revision.cpp.in b/src/git_revision.cpp.in
old mode 100644
new mode 100755
diff --git a/src/interprocess/file_mapping.cpp b/src/interprocess/file_mapping.cpp
old mode 100644
new mode 100755
diff --git a/src/interprocess/file_mutex.cpp b/src/interprocess/file_mutex.cpp
old mode 100644
new mode 100755
diff --git a/src/interprocess/mmap_struct.cpp b/src/interprocess/mmap_struct.cpp
old mode 100644
new mode 100755
diff --git a/src/interprocess/process.cpp b/src/interprocess/process.cpp
old mode 100644
new mode 100755
diff --git a/src/interprocess/signals.cpp b/src/interprocess/signals.cpp
old mode 100644
new mode 100755
diff --git a/src/io/buffered_iostream.cpp b/src/io/buffered_iostream.cpp
old mode 100644
new mode 100755
diff --git a/src/io/console.cpp b/src/io/console.cpp
old mode 100644
new mode 100755
diff --git a/src/io/datastream.cpp b/src/io/datastream.cpp
old mode 100644
new mode 100755
diff --git a/src/io/fstream.cpp b/src/io/fstream.cpp
old mode 100644
new mode 100755
diff --git a/src/io/iostream.cpp b/src/io/iostream.cpp
old mode 100644
new mode 100755
diff --git a/src/io/json.cpp b/src/io/json.cpp
old mode 100644
new mode 100755
diff --git a/src/io/sstream.cpp b/src/io/sstream.cpp
old mode 100644
new mode 100755
diff --git a/src/io/varint.cpp b/src/io/varint.cpp
old mode 100644
new mode 100755
diff --git a/src/log/appender.cpp b/src/log/appender.cpp
old mode 100644
new mode 100755
diff --git a/src/log/console_appender.cpp b/src/log/console_appender.cpp
old mode 100644
new mode 100755
diff --git a/src/log/console_defines.h b/src/log/console_defines.h
old mode 100644
new mode 100755
diff --git a/src/log/file_appender.cpp b/src/log/file_appender.cpp
old mode 100644
new mode 100755
index 204686a..dabdf3f
--- a/src/log/file_appender.cpp
+++ b/src/log/file_appender.cpp
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
namespace fc {
diff --git a/src/log/gelf_appender.cpp b/src/log/gelf_appender.cpp
old mode 100644
new mode 100755
diff --git a/src/log/log_message.cpp b/src/log/log_message.cpp
old mode 100644
new mode 100755
diff --git a/src/log/logger.cpp b/src/log/logger.cpp
old mode 100644
new mode 100755
diff --git a/src/log/logger_config.cpp b/src/log/logger_config.cpp
old mode 100644
new mode 100755
diff --git a/src/network/http/http_connection.cpp b/src/network/http/http_connection.cpp
old mode 100644
new mode 100755
diff --git a/src/network/http/http_server.cpp b/src/network/http/http_server.cpp
old mode 100644
new mode 100755
diff --git a/src/network/http/websocket.cpp b/src/network/http/websocket.cpp
old mode 100644
new mode 100755
diff --git a/src/network/ip.cpp b/src/network/ip.cpp
old mode 100644
new mode 100755
diff --git a/src/network/ntp.cpp b/src/network/ntp.cpp
old mode 100644
new mode 100755
diff --git a/src/network/rate_limiting.cpp b/src/network/rate_limiting.cpp
old mode 100644
new mode 100755
diff --git a/src/network/resolve.cpp b/src/network/resolve.cpp
old mode 100644
new mode 100755
diff --git a/src/network/tcp_socket.cpp b/src/network/tcp_socket.cpp
old mode 100644
new mode 100755
index 1c980fc..b40f496
--- a/src/network/tcp_socket.cpp
+++ b/src/network/tcp_socket.cpp
@@ -177,13 +177,13 @@ namespace fc {
keepalive_settings.keepaliveinterval = (ULONG)(interval.count() / fc::milliseconds(1).count());
DWORD dwBytesRet = 0;
- if (WSAIoctl(my->_sock.native(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings),
+ if (WSAIoctl(my->_sock.native_handle(), SIO_KEEPALIVE_VALS, &keepalive_settings, sizeof(keepalive_settings),
NULL, 0, &dwBytesRet, NULL, NULL) == SOCKET_ERROR)
wlog("Error setting TCP keepalive values");
#elif !defined(__clang__) || (__clang_major__ >= 6)
// This should work for modern Linuxes and for OSX >= Mountain Lion
int timeout_sec = interval.count() / fc::seconds(1).count();
- if (setsockopt(my->_sock.native(), IPPROTO_TCP,
+ if (setsockopt(my->_sock.native_handle(), IPPROTO_TCP,
#if defined( __APPLE__ )
TCP_KEEPALIVE,
#else
@@ -192,7 +192,7 @@ namespace fc {
(char*)&timeout_sec, sizeof(timeout_sec)) < 0)
wlog("Error setting TCP keepalive idle time");
# if !defined(__APPLE__) || defined(TCP_KEEPINTVL) // TCP_KEEPINTVL not defined before 10.9
- if (setsockopt(my->_sock.native(), IPPROTO_TCP, TCP_KEEPINTVL,
+ if (setsockopt(my->_sock.native_handle(), IPPROTO_TCP, TCP_KEEPINTVL,
(char*)&timeout_sec, sizeof(timeout_sec)) < 0)
wlog("Error setting TCP keepalive interval");
# endif // !__APPLE__ || TCP_KEEPINTVL
@@ -224,7 +224,7 @@ namespace fc {
if (detail::have_so_reuseport)
{
int reuseport_value = 1;
- if (setsockopt(my->_sock.native(), SOL_SOCKET, SO_REUSEPORT,
+ if (setsockopt(my->_sock.native_handle(), SOL_SOCKET, SO_REUSEPORT,
(char*)&reuseport_value, sizeof(reuseport_value)) < 0)
{
if (errno == ENOPROTOOPT)
@@ -291,7 +291,7 @@ namespace fc {
if (detail::have_so_reuseport)
{
int reuseport_value = 1;
- if (setsockopt(my->_accept.native(), SOL_SOCKET, SO_REUSEPORT,
+ if (setsockopt(my->_accept.native_handle(), SOL_SOCKET, SO_REUSEPORT,
(char*)&reuseport_value, sizeof(reuseport_value)) < 0)
{
if (errno == ENOPROTOOPT)
diff --git a/src/network/udp_socket.cpp b/src/network/udp_socket.cpp
old mode 100644
new mode 100755
diff --git a/src/network/url.cpp b/src/network/url.cpp
old mode 100644
new mode 100755
diff --git a/src/real128.cpp b/src/real128.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/bstate.cpp b/src/rpc/bstate.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/cli.cpp b/src/rpc/cli.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/http_api.cpp b/src/rpc/http_api.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/json_connection.cpp b/src/rpc/json_connection.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/state.cpp b/src/rpc/state.cpp
old mode 100644
new mode 100755
diff --git a/src/rpc/websocket_api.cpp b/src/rpc/websocket_api.cpp
old mode 100644
new mode 100755
diff --git a/src/shared_ptr.cpp b/src/shared_ptr.cpp
old mode 100644
new mode 100755
diff --git a/src/string.cpp b/src/string.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/context.hpp b/src/thread/context.hpp
old mode 100644
new mode 100755
index f6e8a77..18a060c
--- a/src/thread/context.hpp
+++ b/src/thread/context.hpp
@@ -6,7 +6,15 @@
#include
-#if BOOST_VERSION >= 105400
+#define BOOST_COROUTINES_NO_DEPRECATION_WARNING // Boost 1.61
+#define BOOST_COROUTINE_NO_DEPRECATION_WARNING // Boost 1.62
+
+#if BOOST_VERSION >= 106100
+ #include
+ namespace bc = boost::context::detail;
+ namespace bco = boost::coroutines;
+ typedef bco::stack_allocator stack_allocator;
+#elif BOOST_VERSION >= 105400
# include
namespace bc = boost::context;
namespace bco = boost::coroutines;
@@ -47,8 +55,13 @@ namespace fc {
bco::stack_context stack_ctx;
#endif
+#if BOOST_VERSION >= 106100
+ using context_fn = void (*)(bc::transfer_t);
+#else
+ using context_fn = void(*)(intptr_t);
+#endif
- context( void (*sf)(intptr_t), stack_allocator& alloc, fc::thread* t )
+ context( context_fn sf, stack_allocator& alloc, fc::thread* t )
: caller_context(0),
stack_alloc(&alloc),
next_blocked(0),
diff --git a/src/thread/future.cpp b/src/thread/future.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/mutex.cpp b/src/thread/mutex.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/non_preemptable_scope_check.cpp b/src/thread/non_preemptable_scope_check.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/spin_lock.cpp b/src/thread/spin_lock.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/spin_yield_lock.cpp b/src/thread/spin_yield_lock.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/task.cpp b/src/thread/task.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/thread.cpp b/src/thread/thread.cpp
old mode 100644
new mode 100755
diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp
old mode 100644
new mode 100755
index 941b2fa..74b59d3
--- a/src/thread/thread_d.hpp
+++ b/src/thread/thread_d.hpp
@@ -18,6 +18,7 @@ namespace fc {
class thread_d {
public:
+ using context_pair = std::pair;
thread_d(fc::thread& s)
:self(s), boost_thread(0),
task_in_queue(0),
@@ -397,7 +398,11 @@ namespace fc {
}
// slog( "jump to %p from %p", next, prev );
// fc_dlog( logger::get("fc_context"), "from ${from} to ${to}", ( "from", int64_t(prev) )( "to", int64_t(next) ) );
-#if BOOST_VERSION >= 105600
+#if BOOST_VERSION >= 106100
+ auto p = context_pair{nullptr, prev};
+ auto t = bc::jump_fcontext( next->my_context, &p );
+ static_cast(t.data)->second->my_context = t.fctx;
+#elif BOOST_VERSION >= 105600
bc::jump_fcontext( &prev->my_context, next->my_context, 0 );
#elif BOOST_VERSION >= 105300
bc::jump_fcontext( prev->my_context, next->my_context, 0 );
@@ -439,7 +444,11 @@ namespace fc {
// slog( "jump to %p from %p", next, prev );
// fc_dlog( logger::get("fc_context"), "from ${from} to ${to}", ( "from", int64_t(prev) )( "to", int64_t(next) ) );
-#if BOOST_VERSION >= 105600
+#if BOOST_VERSION >= 106100
+ auto p = context_pair{this, prev};
+ auto t = bc::jump_fcontext( next->my_context, &p );
+ static_cast(t.data)->second->my_context = t.fctx;
+#elif BOOST_VERSION >= 105600
bc::jump_fcontext( &prev->my_context, next->my_context, (intptr_t)this );
#elif BOOST_VERSION >= 105300
bc::jump_fcontext( prev->my_context, next->my_context, (intptr_t)this );
@@ -467,9 +476,17 @@ namespace fc {
return true;
}
+#if BOOST_VERSION >= 106100
+ static void start_process_tasks( bc::transfer_t my )
+ {
+ auto p = static_cast(my.data);
+ auto self = static_cast(p->first);
+ p->second->my_context = my.fctx;
+#else
static void start_process_tasks( intptr_t my )
{
thread_d* self = (thread_d*)my;
+#endif
try
{
self->process_tasks();
diff --git a/src/thread/thread_specific.cpp b/src/thread/thread_specific.cpp
old mode 100644
new mode 100755
diff --git a/src/time.cpp b/src/time.cpp
old mode 100644
new mode 100755
diff --git a/src/uint128.cpp b/src/uint128.cpp
old mode 100644
new mode 100755
diff --git a/src/utf8.cpp b/src/utf8.cpp
old mode 100644
new mode 100755
diff --git a/src/utf8/ReleaseNotes b/src/utf8/ReleaseNotes
old mode 100644
new mode 100755
diff --git a/src/utf8/checked.h b/src/utf8/checked.h
old mode 100644
new mode 100755
diff --git a/src/utf8/core.h b/src/utf8/core.h
old mode 100644
new mode 100755
diff --git a/src/utf8/unchecked.h b/src/utf8/unchecked.h
old mode 100644
new mode 100755
diff --git a/src/utf8/utf8cpp.html b/src/utf8/utf8cpp.html
old mode 100644
new mode 100755
diff --git a/src/variant.cpp b/src/variant.cpp
old mode 100644
new mode 100755
diff --git a/src/variant_object.cpp b/src/variant_object.cpp
old mode 100644
new mode 100755
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
old mode 100644
new mode 100755
index 1043e50..c3f125d
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -23,9 +23,6 @@ target_link_libraries( real128_test fc )
add_executable( hmac_test hmac_test.cpp )
target_link_libraries( hmac_test fc )
-add_executable( blinding_test blinding_test.cpp )
-target_link_libraries( blinding_test fc )
-
add_executable( ecc_test crypto/ecc_test.cpp )
target_link_libraries( ecc_test fc )
@@ -51,6 +48,7 @@ add_executable( all_tests all_tests.cpp
crypto/sha_tests.cpp
network/http/websocket_test.cpp
thread/task_cancel.cpp
+ thread/thread_tests.cpp
bloom_test.cpp
real128_test.cpp
utf8_test.cpp
diff --git a/tests/all_tests.cpp b/tests/all_tests.cpp
old mode 100644
new mode 100755
diff --git a/tests/api.cpp b/tests/api.cpp
old mode 100644
new mode 100755
diff --git a/tests/bip_lock.cpp b/tests/bip_lock.cpp
old mode 100644
new mode 100755
diff --git a/tests/blinding_test.cpp b/tests/blinding_test.cpp
old mode 100644
new mode 100755
index 318f161..b363ab1
--- a/tests/blinding_test.cpp
+++ b/tests/blinding_test.cpp
@@ -42,7 +42,7 @@ static fc::string BLIND_T_X = "80deff382af8a8e4a5f297588e44d5bf858f30a524f74b13e
static fc::string BLINDED_HASH = "7196e80cdafdfdfb7496323ad24bf47dda8447febd7426e444facc04940c7309";
static fc::string BLIND_SIG = "40d6a477d849cc860df8ad159481f2ffc5b4dc3131b86a799d7d10460824dd53";
static fc::string UNBLINDED = "700092a72a05e33509f9b068aa1d7c5336d8b5692b4157da199d7ec1e10fd7c0";
-
+/*
BOOST_AUTO_TEST_CASE(test_extended_keys_1)
{
char seed[16];
@@ -302,3 +302,4 @@ BOOST_AUTO_TEST_CASE(openssl_blinding)
// printf("\nunblinded: "); print(sig->s);
// printf("\n");
}
+*/
\ No newline at end of file
diff --git a/tests/bloom_test.cpp b/tests/bloom_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/compress/compress.cpp b/tests/compress/compress.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/aes_test.cpp b/tests/crypto/aes_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/base_n_tests.cpp b/tests/crypto/base_n_tests.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/bigint_test.cpp b/tests/crypto/bigint_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/blind.cpp b/tests/crypto/blind.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/blowfish_test.cpp b/tests/crypto/blowfish_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/dh_test.cpp b/tests/crypto/dh_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/ecc_test.cpp b/tests/crypto/ecc_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/log_test.cpp b/tests/crypto/log_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/rand_test.cpp b/tests/crypto/rand_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/crypto/sha_tests.cpp b/tests/crypto/sha_tests.cpp
old mode 100644
new mode 100755
diff --git a/tests/hmac_test.cpp b/tests/hmac_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/network/http/websocket_test.cpp b/tests/network/http/websocket_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/rate_limiting.cpp b/tests/rate_limiting.cpp
old mode 100644
new mode 100755
diff --git a/tests/real128_test.cpp b/tests/real128_test.cpp
old mode 100644
new mode 100755
diff --git a/tests/rpc.cpp b/tests/rpc.cpp
old mode 100644
new mode 100755
diff --git a/tests/sleep.cpp b/tests/sleep.cpp
old mode 100644
new mode 100755
diff --git a/tests/thread/task_cancel.cpp b/tests/thread/task_cancel.cpp
old mode 100644
new mode 100755
diff --git a/tests/thread/thread_tests.cpp b/tests/thread/thread_tests.cpp
new file mode 100755
index 0000000..1b7ed8e
--- /dev/null
+++ b/tests/thread/thread_tests.cpp
@@ -0,0 +1,95 @@
+#include
+
+#include
+
+using namespace fc;
+
+BOOST_AUTO_TEST_SUITE(thread_tests)
+
+BOOST_AUTO_TEST_CASE(executes_task)
+{
+ bool called = false;
+ fc::thread thread("my");
+ thread.async([&called]{called = true;}).wait();
+ BOOST_CHECK(called);
+}
+
+BOOST_AUTO_TEST_CASE(returns_value_from_function)
+{
+ fc::thread thread("my");
+ BOOST_CHECK_EQUAL(10, thread.async([]{return 10;}).wait());
+}
+
+BOOST_AUTO_TEST_CASE(executes_multiple_tasks)
+{
+ bool called1 = false;
+ bool called2 = false;
+
+ fc::thread thread("my");
+ auto future1 = thread.async([&called1]{called1 = true;});
+ auto future2 = thread.async([&called2]{called2 = true;});
+
+ future2.wait();
+ future1.wait();
+
+ BOOST_CHECK(called1);
+ BOOST_CHECK(called2);
+}
+
+BOOST_AUTO_TEST_CASE(calls_tasks_in_order)
+{
+ std::string result;
+
+ fc::thread thread("my");
+ auto future1 = thread.async([&result]{result += "hello ";});
+ auto future2 = thread.async([&result]{result += "world";});
+
+ future2.wait();
+ future1.wait();
+
+ BOOST_CHECK_EQUAL("hello world", result);
+}
+
+BOOST_AUTO_TEST_CASE(yields_execution)
+{
+ std::string result;
+
+ fc::thread thread("my");
+ auto future1 = thread.async([&result]{fc::yield(); result += "world";});
+ auto future2 = thread.async([&result]{result += "hello ";});
+
+ future2.wait();
+ future1.wait();
+
+ BOOST_CHECK_EQUAL("hello world", result);
+}
+
+BOOST_AUTO_TEST_CASE(quits_infinite_loop)
+{
+ fc::thread thread("my");
+ auto f = thread.async([]{while (true) fc::yield();});
+
+ thread.quit();
+ BOOST_CHECK_THROW(f.wait(), fc::canceled_exception);
+}
+
+BOOST_AUTO_TEST_CASE(reschedules_yielded_task)
+{
+ int reschedule_count = 0;
+
+ fc::thread thread("my");
+ auto future = thread.async([&reschedule_count]
+ {
+ while (reschedule_count < 10)
+ {
+ fc::yield();
+ reschedule_count++;
+ }
+ });
+
+ future.wait();
+ BOOST_CHECK_EQUAL(10, reschedule_count);
+}
+
+BOOST_AUTO_TEST_SUITE_END()
+
diff --git a/tests/utf8_test.cpp b/tests/utf8_test.cpp
old mode 100644
new mode 100755
diff --git a/vendor/boost_1.51/include/boost/process.hpp b/vendor/boost_1.51/include/boost/process.hpp
deleted file mode 100644
index 98e3c89..0000000
--- a/vendor/boost_1.51/include/boost/process.hpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
-// Copyright (c) 2009 Boris Schaeling
-// Copyright (c) 2010 Felipe Tanus, Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process.hpp
- *
- * Convenience header that includes all public Boost.Process header files.
- */
-
-#ifndef BOOST_PROCESS_HPP
-#define BOOST_PROCESS_HPP
-
-#include
-
-#endif
diff --git a/vendor/boost_1.51/include/boost/process/all.hpp b/vendor/boost_1.51/include/boost/process/all.hpp
deleted file mode 100644
index f30e566..0000000
--- a/vendor/boost_1.51/include/boost/process/all.hpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
-// Copyright (c) 2009 Boris Schaeling
-// Copyright (c) 2010 Felipe Tanus, Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/all.hpp
- *
- * Convenience header that includes all public Boost.Process header files.
- */
-
-#ifndef BOOST_PROCESS_ALL_HPP
-#define BOOST_PROCESS_ALL_HPP
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#endif
diff --git a/vendor/boost_1.51/include/boost/process/child.hpp b/vendor/boost_1.51/include/boost/process/child.hpp
deleted file mode 100644
index 1441e56..0000000
--- a/vendor/boost_1.51/include/boost/process/child.hpp
+++ /dev/null
@@ -1,100 +0,0 @@
-//
-// Boost.Process
-// ~~~~~~~~~~~~~
-//
-// Copyright (c) 2006, 2007 Julio M. Merino Vidal
-// Copyright (c) 2008 Ilya Sokolov, Boris Schaeling
-// Copyright (c) 2009 Boris Schaeling
-// Copyright (c) 2010 Felipe Tanus, Boris Schaeling
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-
-/**
- * \file boost/process/child.hpp
- *
- * Includes the declaration of the child class.
- */
-
-#ifndef BOOST_PROCESS_CHILD_HPP
-#define BOOST_PROCESS_CHILD_HPP
-
-#include
-
-#if defined(BOOST_POSIX_API)
-#elif defined(BOOST_WINDOWS_API)
-# include
-#else
-# error "Unsupported platform."
-#endif
-
-#include
-#include
-#include
-#include
-#include