Use optimized OpenSSL implementations when possible

This commit is contained in:
Mike Ellery
2019-03-26 10:40:47 -07:00
committed by seelabs
parent 61bd06177f
commit f8a4ac6ad7
2 changed files with 12 additions and 5 deletions

View File

@@ -205,6 +205,10 @@ option (boost_show_deprecated
"Allow boost to fail on deprecated usage. Only useful if you're trying\ "Allow boost to fail on deprecated usage. Only useful if you're trying\
to find deprecated calls." to find deprecated calls."
OFF) OFF)
option (beast_hashers
"Use local implementations for sha/ripemd hashes (experimental, not recommended)"
OFF)
if (WIN32) if (WIN32)
option (beast_disable_autolink "Disables autolinking of system libraries on WIN32" OFF) option (beast_disable_autolink "Disables autolinking of system libraries on WIN32" OFF)
else () else ()
@@ -577,6 +581,9 @@ target_compile_definitions (opts
BOOST_BEAST_ALLOW_DEPRECATED BOOST_BEAST_ALLOW_DEPRECATED
BOOST_FILESYSTEM_DEPRECATED BOOST_FILESYSTEM_DEPRECATED
> >
$<$<BOOL:${beast_hashers}>:
USE_BEAST_HASHER
>
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1> $<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1> $<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
$<$<BOOL:${single_io_service_thread}>:RIPPLE_SINGLE_IO_SERVICE_THREAD=1> $<$<BOOL:${single_io_service_thread}>:RIPPLE_SINGLE_IO_SERVICE_THREAD=1>

View File

@@ -122,14 +122,14 @@ private:
// Aliases to choose the correct digest implementation // Aliases to choose the correct digest implementation
#if RIPPLE_USE_OPENSSL #if USE_BEAST_HASHER
using ripemd160_hasher = openssl_ripemd160_hasher;
using sha256_hasher = openssl_sha256_hasher;
using sha512_hasher = openssl_sha512_hasher;
#else
using ripemd160_hasher = beast::ripemd160_hasher; using ripemd160_hasher = beast::ripemd160_hasher;
using sha256_hasher = beast::sha256_hasher; using sha256_hasher = beast::sha256_hasher;
using sha512_hasher = beast::sha512_hasher; using sha512_hasher = beast::sha512_hasher;
#else
using ripemd160_hasher = openssl_ripemd160_hasher;
using sha256_hasher = openssl_sha256_hasher;
using sha512_hasher = openssl_sha512_hasher;
#endif #endif
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------