mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 16:33:32 -05:00
Compare commits
124 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f103b6b45 | ||
|
|
39609c9183 | ||
|
|
2adb7b2b74 | ||
|
|
faa7095865 | ||
|
|
e0701f9dad | ||
|
|
14aacf8636 | ||
|
|
c764441337 | ||
|
|
05fae12a63 | ||
|
|
8059ce67f9 | ||
|
|
10111fd7f9 | ||
|
|
2d25bec2df | ||
|
|
cab244d468 | ||
|
|
4001488888 | ||
|
|
9bec1521b8 | ||
|
|
7bde3ed5f7 | ||
|
|
2e738509bb | ||
|
|
f5447088cb | ||
|
|
7f2f50a8d9 | ||
|
|
5747ccfafc | ||
|
|
93081eb1f6 | ||
|
|
4bf65c8669 | ||
|
|
1a6fc3a665 | ||
|
|
8dede14ac8 | ||
|
|
20687a397e | ||
|
|
454f97fa0f | ||
|
|
8149fc7dcb | ||
|
|
a39ab89236 | ||
|
|
5b8501fb57 | ||
|
|
039be2ab75 | ||
|
|
718c7e0fc1 | ||
|
|
ef7951b91d | ||
|
|
214b1f021b | ||
|
|
81b18c0741 | ||
|
|
8e83f72456 | ||
|
|
c2ae625032 | ||
|
|
60566dc84c | ||
|
|
4ea8fe694d | ||
|
|
669d1ab008 | ||
|
|
e87d5111a2 | ||
|
|
56158779de | ||
|
|
efb322df66 | ||
|
|
e673d541c1 | ||
|
|
a98db529fb | ||
|
|
1a9eaaad8f | ||
|
|
be5fbca9b6 | ||
|
|
2feb264375 | ||
|
|
00990f2649 | ||
|
|
d78713be48 | ||
|
|
77367abe13 | ||
|
|
cd046f6fd0 | ||
|
|
63b7ec2887 | ||
|
|
a1e8f1c3e5 | ||
|
|
6db480a1ab | ||
|
|
a7acd9de6d | ||
|
|
a64f4d1870 | ||
|
|
9bfe59b630 | ||
|
|
1a4bf16521 | ||
|
|
a4d5d0a75a | ||
|
|
c40f1f9f66 | ||
|
|
15e5052dd0 | ||
|
|
f9f7963453 | ||
|
|
02240eff8c | ||
|
|
d64c963e5e | ||
|
|
c6292ce9ee | ||
|
|
cd652e2644 | ||
|
|
6f5ef0fe0f | ||
|
|
01fa968763 | ||
|
|
8e6f3ad99e | ||
|
|
b1f2479ec1 | ||
|
|
ecceba8ecd | ||
|
|
cb5f4a9c17 | ||
|
|
3a8ebfdcb6 | ||
|
|
0dcafeb571 | ||
|
|
a1d7ee4c6b | ||
|
|
03e70ba2ed | ||
|
|
19ef8c5d65 | ||
|
|
63baa9e263 | ||
|
|
1248bd5859 | ||
|
|
5c951ddb8a | ||
|
|
4ab0ad928d | ||
|
|
e67eb47796 | ||
|
|
a6656a8c49 | ||
|
|
a903d0a5bd | ||
|
|
ceaebfd877 | ||
|
|
5156ff11a8 | ||
|
|
e0143a92a8 | ||
|
|
f682d9a2e9 | ||
|
|
3bece0ff40 | ||
|
|
e6c456a970 | ||
|
|
923d1d712f | ||
|
|
ae8459bd35 | ||
|
|
3a7be07c62 | ||
|
|
e1cc0000c6 | ||
|
|
1210e8e95c | ||
|
|
a45fbd9cae | ||
|
|
f6d45f7990 | ||
|
|
b9464f993b | ||
|
|
f8f73b0cd7 | ||
|
|
df6ab2edd8 | ||
|
|
8bf7600154 | ||
|
|
a30501956f | ||
|
|
c287a40a20 | ||
|
|
04f50c24e2 | ||
|
|
7627b23212 | ||
|
|
e90e7febfb | ||
|
|
733b85a132 | ||
|
|
35ba786e63 | ||
|
|
446810a837 | ||
|
|
c6a68c3e51 | ||
|
|
ca8bef3ade | ||
|
|
d735caa334 | ||
|
|
eb54cc0e0f | ||
|
|
84c67c37cd | ||
|
|
b44f38a362 | ||
|
|
8ed4088d0a | ||
|
|
cdcea2a4f9 | ||
|
|
f0d80326ec | ||
|
|
cb8fc26cbe | ||
|
|
5ec5b5ed00 | ||
|
|
67e29c1af1 | ||
|
|
4bd94a79a4 | ||
|
|
80e597d951 | ||
|
|
2e269f5b8c | ||
|
|
57b8e35903 |
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,3 +1,48 @@
|
|||||||
|
# v6.16.3
|
||||||
|
- [#2778](https://github.com/xmrig/xmrig/pull/2778) Fixed `READY threads X/X` display after algorithm switching.
|
||||||
|
- [#2782](https://github.com/xmrig/xmrig/pull/2782) Updated GhostRider documentation.
|
||||||
|
- [#2815](https://github.com/xmrig/xmrig/pull/2815) Fixed `cn-heavy` in 32-bit builds.
|
||||||
|
- [#2827](https://github.com/xmrig/xmrig/pull/2827) GhostRider: set correct priority for helper threads.
|
||||||
|
- [#2837](https://github.com/xmrig/xmrig/pull/2837) RandomX: don't restart mining threads when the seed changes.
|
||||||
|
- [#2848](https://github.com/xmrig/xmrig/pull/2848) GhostRider: added support for `client.reconnect` method.
|
||||||
|
- [#2856](https://github.com/xmrig/xmrig/pull/2856) Fix for short responses from some Raptoreum pools.
|
||||||
|
- [#2873](https://github.com/xmrig/xmrig/pull/2873) Fixed GhostRider benchmark on single-core systems.
|
||||||
|
- [#2882](https://github.com/xmrig/xmrig/pull/2882) Fixed ARMv7 compilation.
|
||||||
|
- [#2893](https://github.com/xmrig/xmrig/pull/2893) KawPow OpenCL: use separate UV loop for building programs.
|
||||||
|
|
||||||
|
# v6.16.2
|
||||||
|
- [#2751](https://github.com/xmrig/xmrig/pull/2751) Fixed crash on CPUs supporting VAES and running GCC-compiled xmrig.
|
||||||
|
- [#2761](https://github.com/xmrig/xmrig/pull/2761) Fixed broken auto-tuning in GCC Windows build.
|
||||||
|
- [#2771](https://github.com/xmrig/xmrig/issues/2771) Fixed environment variables support for GhostRider and KawPow.
|
||||||
|
- [#2769](https://github.com/xmrig/xmrig/pull/2769) Performance fixes:
|
||||||
|
- Fixed several performance bottlenecks introduced in v6.16.1.
|
||||||
|
- Fixed overall GCC-compiled build performance, it's the same speed as MSVC build now.
|
||||||
|
- **Linux builds are up to 10% faster now compared to v6.16.0 GCC build.**
|
||||||
|
- **Windows builds are up to 5% faster now compared to v6.16.0 MSVC build.**
|
||||||
|
|
||||||
|
# v6.16.1
|
||||||
|
- [#2729](https://github.com/xmrig/xmrig/pull/2729) GhostRider fixes:
|
||||||
|
- Added average hashrate display.
|
||||||
|
- Fixed the number of threads shown at startup.
|
||||||
|
- Fixed `--threads` or `-t` command line option (but `--cpu-max-threads-hint` is recommended to use).
|
||||||
|
- [#2738](https://github.com/xmrig/xmrig/pull/2738) GhostRider fixes:
|
||||||
|
- Fixed "difficulty is not a number" error when diff is high on some pools.
|
||||||
|
- Fixed GhostRider compilation when `WITH_KAWPOW=OFF`.
|
||||||
|
- [#2740](https://github.com/xmrig/xmrig/pull/2740) Added VAES support for Cryptonight variants **+4% speedup on Zen3**.
|
||||||
|
- VAES instructions are available on Intel Ice Lake/AMD Zen3 and newer CPUs.
|
||||||
|
- +4% speedup on Ryzen 5 5600X.
|
||||||
|
|
||||||
|
# v6.16.0
|
||||||
|
- [#2712](https://github.com/xmrig/xmrig/pull/2712) **GhostRider algorithm (Raptoreum) support**: read the [RELEASE NOTES](src/crypto/ghostrider/README.md) for quick start guide and performance comparisons.
|
||||||
|
- [#2682](https://github.com/xmrig/xmrig/pull/2682) Fixed: use cn-heavy optimization only for Vermeer CPUs.
|
||||||
|
- [#2684](https://github.com/xmrig/xmrig/pull/2684) MSR mod: fix for error 183.
|
||||||
|
|
||||||
|
# v6.15.3
|
||||||
|
- [#2614](https://github.com/xmrig/xmrig/pull/2614) OpenCL fixes for non-AMD platforms.
|
||||||
|
- [#2623](https://github.com/xmrig/xmrig/pull/2623) Fixed compiling without kawpow.
|
||||||
|
- [#2636](https://github.com/xmrig/xmrig/pull/2636) [#2639](https://github.com/xmrig/xmrig/pull/2639) AstroBWT speedup (up to +35%).
|
||||||
|
- [#2646](https://github.com/xmrig/xmrig/pull/2646) Fixed MSVC compilation error.
|
||||||
|
|
||||||
# v6.15.2
|
# v6.15.2
|
||||||
- [#2606](https://github.com/xmrig/xmrig/pull/2606) Fixed: AstroBWT auto-config ignored `max-threads-hint`.
|
- [#2606](https://github.com/xmrig/xmrig/pull/2606) Fixed: AstroBWT auto-config ignored `max-threads-hint`.
|
||||||
- Fixed possible crash on Windows (regression in v6.15.1).
|
- Fixed possible crash on Windows (regression in v6.15.1).
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
|
|||||||
option(WITH_ARGON2 "Enable Argon2 algorithms family" ON)
|
option(WITH_ARGON2 "Enable Argon2 algorithms family" ON)
|
||||||
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
|
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
|
||||||
option(WITH_KAWPOW "Enable KawPow algorithms family" ON)
|
option(WITH_KAWPOW "Enable KawPow algorithms family" ON)
|
||||||
|
option(WITH_GHOSTRIDER "Enable GhostRider algorithm" ON)
|
||||||
option(WITH_HTTP "Enable HTTP protocol support (client/server)" ON)
|
option(WITH_HTTP "Enable HTTP protocol support (client/server)" ON)
|
||||||
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
|
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
|
||||||
option(WITH_TLS "Enable OpenSSL support" ON)
|
option(WITH_TLS "Enable OpenSSL support" ON)
|
||||||
@@ -18,6 +19,8 @@ option(WITH_MSR "Enable MSR mod & 1st-gen Ryzen fix" ON)
|
|||||||
option(WITH_ENV_VARS "Enable environment variables support in config file" ON)
|
option(WITH_ENV_VARS "Enable environment variables support in config file" ON)
|
||||||
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
|
option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
|
||||||
option(WITH_OPENCL "Enable OpenCL backend" ON)
|
option(WITH_OPENCL "Enable OpenCL backend" ON)
|
||||||
|
set(WITH_OPENCL_VERSION 200 CACHE STRING "Target OpenCL version")
|
||||||
|
set_property(CACHE WITH_OPENCL_VERSION PROPERTY STRINGS 120 200 210 220)
|
||||||
option(WITH_CUDA "Enable CUDA backend" ON)
|
option(WITH_CUDA "Enable CUDA backend" ON)
|
||||||
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
|
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
|
||||||
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
|
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
|
||||||
@@ -25,6 +28,7 @@ option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
|
|||||||
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
|
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
|
||||||
option(WITH_PROFILING "Enable profiling for developers" OFF)
|
option(WITH_PROFILING "Enable profiling for developers" OFF)
|
||||||
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
|
option(WITH_SSE4_1 "Enable SSE 4.1 for Blake2" ON)
|
||||||
|
option(WITH_VAES "Enable VAES instructions for Cryptonight" ON)
|
||||||
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
|
option(WITH_BENCHMARK "Enable builtin RandomX benchmark and stress test" ON)
|
||||||
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
|
option(WITH_SECURE_JIT "Enable secure access to JIT memory" OFF)
|
||||||
option(WITH_DMI "Enable DMI/SMBIOS reader" ON)
|
option(WITH_DMI "Enable DMI/SMBIOS reader" ON)
|
||||||
@@ -126,6 +130,19 @@ set(SOURCES_CRYPTO
|
|||||||
src/crypto/common/VirtualMemory.cpp
|
src/crypto/common/VirtualMemory.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||||
|
set_source_files_properties(src/crypto/cn/CnHash.cpp PROPERTIES COMPILE_FLAGS "-Ofast -fno-tree-vectorize")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (WITH_VAES)
|
||||||
|
add_definitions(-DXMRIG_VAES)
|
||||||
|
set(HEADERS_CRYPTO "${HEADERS_CRYPTO}" src/crypto/cn/CryptoNight_x86_vaes.h)
|
||||||
|
set(SOURCES_CRYPTO "${SOURCES_CRYPTO}" src/crypto/cn/CryptoNight_x86_vaes.cpp)
|
||||||
|
if (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
||||||
|
set_source_files_properties(src/crypto/cn/CryptoNight_x86_vaes.cpp PROPERTIES COMPILE_FLAGS "-Ofast -fno-tree-vectorize -mavx2 -mvaes")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (WITH_HWLOC)
|
if (WITH_HWLOC)
|
||||||
list(APPEND HEADERS_CRYPTO
|
list(APPEND HEADERS_CRYPTO
|
||||||
src/crypto/common/NUMAMemoryPool.h
|
src/crypto/common/NUMAMemoryPool.h
|
||||||
@@ -184,6 +201,7 @@ include(cmake/randomx.cmake)
|
|||||||
include(cmake/argon2.cmake)
|
include(cmake/argon2.cmake)
|
||||||
include(cmake/astrobwt.cmake)
|
include(cmake/astrobwt.cmake)
|
||||||
include(cmake/kawpow.cmake)
|
include(cmake/kawpow.cmake)
|
||||||
|
include(cmake/ghostrider.cmake)
|
||||||
include(cmake/OpenSSL.cmake)
|
include(cmake/OpenSSL.cmake)
|
||||||
include(cmake/asm.cmake)
|
include(cmake/asm.cmake)
|
||||||
|
|
||||||
@@ -219,7 +237,7 @@ if (WITH_DEBUG_LOG)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES})
|
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES} ${SOURCES_OS} ${HEADERS_CRYPTO} ${SOURCES_CRYPTO} ${SOURCES_SYSLOG} ${TLS_SOURCES} ${XMRIG_ASM_SOURCES})
|
||||||
target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB} ${ARGON2_LIBRARY} ${ETHASH_LIBRARY})
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${XMRIG_ASM_LIBRARY} ${OPENSSL_LIBRARIES} ${UV_LIBRARIES} ${EXTRA_LIBS} ${CPUID_LIB} ${ARGON2_LIBRARY} ${ETHASH_LIBRARY} ${GHOSTRIDER_LIBRARY})
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/bin/WinRing0/WinRing0x64.sys" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
@@ -227,6 +245,7 @@ if (WIN32)
|
|||||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/benchmark_10M.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/benchmark_10M.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/pool_mine_example.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/pool_mine_example.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/solo_mine_example.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/solo_mine_example.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
|
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/scripts/rtm_ghostrider_example.cmd" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_BUILD_TYPE STREQUAL Release AND NOT CMAKE_GENERATOR STREQUAL Xcode)
|
if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_BUILD_TYPE STREQUAL Release AND NOT CMAKE_GENERATOR STREQUAL Xcode)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
[](https://github.com/xmrig/xmrig/stargazers)
|
[](https://github.com/xmrig/xmrig/stargazers)
|
||||||
[](https://github.com/xmrig/xmrig/network)
|
[](https://github.com/xmrig/xmrig/network)
|
||||||
|
|
||||||
XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and AstroBWT unified CPU/GPU miner and [RandomX benchmark](https://xmrig.com/benchmark). Official binaries are available for Windows, Linux, macOS and FreeBSD.
|
XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight, AstroBWT and [GhostRider](https://github.com/xmrig/xmrig/tree/master/src/crypto/ghostrider#readme) unified CPU/GPU miner and [RandomX benchmark](https://xmrig.com/benchmark). Official binaries are available for Windows, Linux, macOS and FreeBSD.
|
||||||
|
|
||||||
## Mining backends
|
## Mining backends
|
||||||
- **CPU** (x64/ARMv8)
|
- **CPU** (x64/ARMv8)
|
||||||
|
|||||||
@@ -9,10 +9,23 @@ if (NOT CMAKE_SYSTEM_PROCESSOR)
|
|||||||
message(WARNING "CMAKE_SYSTEM_PROCESSOR not defined")
|
message(WARNING "CMAKE_SYSTEM_PROCESSOR not defined")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||||
|
set(VAES_SUPPORTED ON)
|
||||||
|
else()
|
||||||
|
CHECK_CXX_COMPILER_FLAG("-mavx2 -mvaes" VAES_SUPPORTED)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (NOT VAES_SUPPORTED)
|
||||||
|
set(WITH_VAES OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (XMRIG_64_BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
|
if (XMRIG_64_BIT AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64)$")
|
||||||
add_definitions(-DRAPIDJSON_SSE2)
|
add_definitions(-DRAPIDJSON_SSE2)
|
||||||
else()
|
else()
|
||||||
set(WITH_SSE4_1 OFF)
|
set(WITH_SSE4_1 OFF)
|
||||||
|
set(WITH_VAES OFF)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT ARM_TARGET)
|
if (NOT ARM_TARGET)
|
||||||
@@ -29,8 +42,6 @@ if (ARM_TARGET AND ARM_TARGET GREATER 6)
|
|||||||
|
|
||||||
message(STATUS "Use ARM_TARGET=${ARM_TARGET} (${CMAKE_SYSTEM_PROCESSOR})")
|
message(STATUS "Use ARM_TARGET=${ARM_TARGET} (${CMAKE_SYSTEM_PROCESSOR})")
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
|
|
||||||
if (ARM_TARGET EQUAL 8)
|
if (ARM_TARGET EQUAL 8)
|
||||||
CHECK_CXX_COMPILER_FLAG(-march=armv8-a+crypto XMRIG_ARM_CRYPTO)
|
CHECK_CXX_COMPILER_FLAG(-march=armv8-a+crypto XMRIG_ARM_CRYPTO)
|
||||||
|
|
||||||
|
|||||||
8
cmake/ghostrider.cmake
Normal file
8
cmake/ghostrider.cmake
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
if (WITH_GHOSTRIDER)
|
||||||
|
add_definitions(/DXMRIG_ALGO_GHOSTRIDER)
|
||||||
|
add_subdirectory(src/crypto/ghostrider)
|
||||||
|
set(GHOSTRIDER_LIBRARY ghostrider)
|
||||||
|
else()
|
||||||
|
remove_definitions(/DXMRIG_ALGO_GHOSTRIDER)
|
||||||
|
set(GHOSTRIDER_LIBRARY "")
|
||||||
|
endif()
|
||||||
23
scripts/rtm_ghostrider_example.cmd
Normal file
23
scripts/rtm_ghostrider_example.cmd
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
:: Example batch file for mining Raptoreum at a pool
|
||||||
|
::
|
||||||
|
:: Format:
|
||||||
|
:: xmrig.exe -a gr -o <pool address>:<pool port> -u <pool username/wallet> -p <pool password>
|
||||||
|
::
|
||||||
|
:: Fields:
|
||||||
|
:: pool address The host name of the pool stratum or its IP address, for example raptoreumemporium.com
|
||||||
|
:: pool port The port of the pool's stratum to connect to, for example 3333. Check your pool's getting started page.
|
||||||
|
:: pool username/wallet For most pools, this is the wallet address you want to mine to. Some pools require a username
|
||||||
|
:: pool password For most pools this can be just 'x'. For pools using usernames, you may need to provide a password as configured on the pool.
|
||||||
|
::
|
||||||
|
:: List of Raptoreum mining pools:
|
||||||
|
:: https://miningpoolstats.stream/raptoreum
|
||||||
|
::
|
||||||
|
:: Choose pools outside of top 5 to help Raptoreum network be more decentralized!
|
||||||
|
:: Smaller pools also often have smaller fees/payout limits.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
:: Use this command line to connect to non-SSL port
|
||||||
|
xmrig.exe -a gr -o raptoreumemporium.com:3008 -u WALLET_ADDRESS -p x
|
||||||
|
:: Or use this command line to connect to an SSL port
|
||||||
|
:: xmrig.exe -a gr -o rtm.suprnova.cc:4273 --tls -u WALLET_ADDRESS -p x
|
||||||
|
pause
|
||||||
4
src/3rdparty/getopt/getopt.h
vendored
4
src/3rdparty/getopt/getopt.h
vendored
@@ -109,11 +109,7 @@ char *optarg; /* argument associated with option */
|
|||||||
extern char __declspec(dllimport) *__progname;
|
extern char __declspec(dllimport) *__progname;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
|
||||||
static char EMSG[] = "";
|
static char EMSG[] = "";
|
||||||
#else
|
|
||||||
#define EMSG ""
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int getopt_internal(int, char * const *, const char *,
|
static int getopt_internal(int, char * const *, const char *,
|
||||||
const struct option *, int *, int);
|
const struct option *, int *, int);
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ xmrig::Hashrate::Hashrate(size_t threads) :
|
|||||||
m_timestamps[i] = new uint64_t[kBucketSize]();
|
m_timestamps[i] = new uint64_t[kBucketSize]();
|
||||||
m_top[i] = 0;
|
m_top[i] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_earliestTimestamp = std::numeric_limits<uint64_t>::max();
|
||||||
|
m_totalCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -66,6 +69,14 @@ xmrig::Hashrate::~Hashrate()
|
|||||||
delete [] m_counts;
|
delete [] m_counts;
|
||||||
delete [] m_timestamps;
|
delete [] m_timestamps;
|
||||||
delete [] m_top;
|
delete [] m_top;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
double xmrig::Hashrate::average() const
|
||||||
|
{
|
||||||
|
const uint64_t ts = Chrono::steadyMSecs();
|
||||||
|
return (ts > m_earliestTimestamp) ? (m_totalCount * 1e3 / (ts - m_earliestTimestamp)) : 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -167,4 +178,11 @@ void xmrig::Hashrate::addData(size_t index, uint64_t count, uint64_t timestamp)
|
|||||||
m_timestamps[index][top] = timestamp;
|
m_timestamps[index][top] = timestamp;
|
||||||
|
|
||||||
m_top[index] = (top + 1) & kBucketMask;
|
m_top[index] = (top + 1) & kBucketMask;
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
if (m_earliestTimestamp == std::numeric_limits<uint64_t>::max()) {
|
||||||
|
m_earliestTimestamp = timestamp;
|
||||||
|
}
|
||||||
|
m_totalCount = count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ public:
|
|||||||
inline void add(size_t threadId, uint64_t count, uint64_t timestamp) { addData(threadId + 1U, count, timestamp); }
|
inline void add(size_t threadId, uint64_t count, uint64_t timestamp) { addData(threadId + 1U, count, timestamp); }
|
||||||
inline void add(uint64_t count, uint64_t timestamp) { addData(0U, count, timestamp); }
|
inline void add(uint64_t count, uint64_t timestamp) { addData(0U, count, timestamp); }
|
||||||
|
|
||||||
|
double average() const;
|
||||||
|
|
||||||
static const char *format(double h, char *buf, size_t size);
|
static const char *format(double h, char *buf, size_t size);
|
||||||
static rapidjson::Value normalize(double d);
|
static rapidjson::Value normalize(double d);
|
||||||
|
|
||||||
@@ -72,6 +74,9 @@ private:
|
|||||||
uint32_t* m_top;
|
uint32_t* m_top;
|
||||||
uint64_t** m_counts;
|
uint64_t** m_counts;
|
||||||
uint64_t** m_timestamps;
|
uint64_t** m_timestamps;
|
||||||
|
|
||||||
|
uint64_t m_earliestTimestamp;
|
||||||
|
uint64_t m_totalCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ class Worker : public IWorker
|
|||||||
public:
|
public:
|
||||||
Worker(size_t id, int64_t affinity, int priority);
|
Worker(size_t id, int64_t affinity, int priority);
|
||||||
|
|
||||||
|
size_t threads() const override { return 1; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline int64_t affinity() const { return m_affinity; }
|
inline int64_t affinity() const { return m_affinity; }
|
||||||
inline size_t id() const override { return m_id; }
|
inline size_t id() const override { return m_id; }
|
||||||
|
|||||||
@@ -239,6 +239,9 @@ xmrig::IWorker *xmrig::Workers<CpuLaunchData>::create(Thread<CpuLaunchData> *han
|
|||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
return new CpuWorker<5>(handle->id(), handle->config());
|
return new CpuWorker<5>(handle->id(), handle->config());
|
||||||
|
|
||||||
|
case 8:
|
||||||
|
return new CpuWorker<8>(handle->id(), handle->config());
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public:
|
|||||||
virtual const VirtualMemory *memory() const = 0;
|
virtual const VirtualMemory *memory() const = 0;
|
||||||
virtual size_t id() const = 0;
|
virtual size_t id() const = 0;
|
||||||
virtual size_t intensity() const = 0;
|
virtual size_t intensity() const = 0;
|
||||||
|
virtual size_t threads() const = 0;
|
||||||
virtual void hashrateData(uint64_t &hashCount, uint64_t &timeStamp, uint64_t &rawHashes) const = 0;
|
virtual void hashrateData(uint64_t &hashCount, uint64_t &timeStamp, uint64_t &rawHashes) const = 0;
|
||||||
virtual void jobEarlyNotification(const Job &job) = 0;
|
virtual void jobEarlyNotification(const Job &job) = 0;
|
||||||
virtual void start() = 0;
|
virtual void start() = 0;
|
||||||
|
|||||||
@@ -76,18 +76,20 @@ public:
|
|||||||
{
|
{
|
||||||
m_workersMemory.clear();
|
m_workersMemory.clear();
|
||||||
m_hugePages.reset();
|
m_hugePages.reset();
|
||||||
m_memory = memory;
|
m_memory = memory;
|
||||||
m_started = 0;
|
m_started = 0;
|
||||||
m_errors = 0;
|
m_totalStarted = 0;
|
||||||
m_threads = threads.size();
|
m_errors = 0;
|
||||||
m_ways = 0;
|
m_threads = threads.size();
|
||||||
m_ts = Chrono::steadyMSecs();
|
m_ways = 0;
|
||||||
|
m_ts = Chrono::steadyMSecs();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool started(IWorker *worker, bool ready)
|
inline bool started(IWorker *worker, bool ready)
|
||||||
{
|
{
|
||||||
if (ready) {
|
if (ready) {
|
||||||
m_started++;
|
m_started++;
|
||||||
|
m_totalStarted += worker->threads();
|
||||||
|
|
||||||
if (m_workersMemory.insert(worker->memory()).second) {
|
if (m_workersMemory.insert(worker->memory()).second) {
|
||||||
m_hugePages += worker->memory()->hugePages();
|
m_hugePages += worker->memory()->hugePages();
|
||||||
@@ -112,7 +114,7 @@ public:
|
|||||||
LOG_INFO("%s" GREEN_BOLD(" READY") " threads %s%zu/%zu (%zu)" CLEAR " huge pages %s%1.0f%% %zu/%zu" CLEAR " memory " CYAN_BOLD("%zu KB") BLACK_BOLD(" (%" PRIu64 " ms)"),
|
LOG_INFO("%s" GREEN_BOLD(" READY") " threads %s%zu/%zu (%zu)" CLEAR " huge pages %s%1.0f%% %zu/%zu" CLEAR " memory " CYAN_BOLD("%zu KB") BLACK_BOLD(" (%" PRIu64 " ms)"),
|
||||||
Tags::cpu(),
|
Tags::cpu(),
|
||||||
m_errors == 0 ? CYAN_BOLD_S : YELLOW_BOLD_S,
|
m_errors == 0 ? CYAN_BOLD_S : YELLOW_BOLD_S,
|
||||||
m_started, m_threads, m_ways,
|
m_totalStarted, std::max(m_totalStarted, m_threads), m_ways,
|
||||||
(m_hugePages.isFullyAllocated() ? GREEN_BOLD_S : (m_hugePages.allocated == 0 ? RED_BOLD_S : YELLOW_BOLD_S)),
|
(m_hugePages.isFullyAllocated() ? GREEN_BOLD_S : (m_hugePages.allocated == 0 ? RED_BOLD_S : YELLOW_BOLD_S)),
|
||||||
m_hugePages.percent(),
|
m_hugePages.percent(),
|
||||||
m_hugePages.allocated, m_hugePages.total,
|
m_hugePages.allocated, m_hugePages.total,
|
||||||
@@ -127,6 +129,7 @@ private:
|
|||||||
size_t m_errors = 0;
|
size_t m_errors = 0;
|
||||||
size_t m_memory = 0;
|
size_t m_memory = 0;
|
||||||
size_t m_started = 0;
|
size_t m_started = 0;
|
||||||
|
size_t m_totalStarted = 0;
|
||||||
size_t m_threads = 0;
|
size_t m_threads = 0;
|
||||||
size_t m_ways = 0;
|
size_t m_ways = 0;
|
||||||
uint64_t m_ts = 0;
|
uint64_t m_ts = 0;
|
||||||
|
|||||||
@@ -122,8 +122,15 @@ std::vector<xmrig::CpuLaunchData> xmrig::CpuConfig::get(const Miner *miner, cons
|
|||||||
const size_t count = threads.count();
|
const size_t count = threads.count();
|
||||||
out.reserve(count);
|
out.reserve(count);
|
||||||
|
|
||||||
|
std::vector<int64_t> affinities;
|
||||||
|
affinities.reserve(count);
|
||||||
|
|
||||||
|
for (const auto& thread : threads.data()) {
|
||||||
|
affinities.emplace_back(thread.affinity());
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto &thread : threads.data()) {
|
for (const auto &thread : threads.data()) {
|
||||||
out.emplace_back(miner, algorithm, *this, thread, count);
|
out.emplace_back(miner, algorithm, *this, thread, count, affinities);
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
@@ -200,6 +207,7 @@ void xmrig::CpuConfig::generate()
|
|||||||
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
|
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
|
||||||
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
|
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
|
||||||
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
|
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
|
||||||
|
count += xmrig::generate<Algorithm::GHOSTRIDER>(m_threads, m_limit);
|
||||||
|
|
||||||
m_shouldSave |= count > 0;
|
m_shouldSave |= count > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,6 +161,15 @@ size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
template<>
|
||||||
|
size_t inline generate<Algorithm::GHOSTRIDER>(Threads<CpuThreads>& threads, uint32_t limit)
|
||||||
|
{
|
||||||
|
return generate(Algorithm::kGHOSTRIDER, threads, Algorithm::GHOSTRIDER_RTM, limit);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
} /* namespace xmrig */
|
} /* namespace xmrig */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
|
||||||
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads) :
|
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads, const std::vector<int64_t>& affinities) :
|
||||||
algorithm(algorithm),
|
algorithm(algorithm),
|
||||||
assembly(config.assembly()),
|
assembly(config.assembly()),
|
||||||
astrobwtAVX2(config.astrobwtAVX2()),
|
astrobwtAVX2(config.astrobwtAVX2()),
|
||||||
@@ -44,7 +44,8 @@ xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorit
|
|||||||
affinity(thread.affinity()),
|
affinity(thread.affinity()),
|
||||||
miner(miner),
|
miner(miner),
|
||||||
threads(threads),
|
threads(threads),
|
||||||
intensity(std::min<uint32_t>(thread.intensity(), algorithm.maxIntensity()))
|
intensity(std::max<uint32_t>(std::min<uint32_t>(thread.intensity(), algorithm.maxIntensity()), algorithm.minIntensity())),
|
||||||
|
affinities(affinities)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class Miner;
|
|||||||
class CpuLaunchData
|
class CpuLaunchData
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads);
|
CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread, size_t threads, const std::vector<int64_t>& affinities);
|
||||||
|
|
||||||
bool isEqual(const CpuLaunchData &other) const;
|
bool isEqual(const CpuLaunchData &other) const;
|
||||||
CnHash::AlgoVariant av() const;
|
CnHash::AlgoVariant av() const;
|
||||||
@@ -68,6 +68,7 @@ public:
|
|||||||
const Miner *miner;
|
const Miner *miner;
|
||||||
const size_t threads;
|
const size_t threads;
|
||||||
const uint32_t intensity;
|
const uint32_t intensity;
|
||||||
|
const std::vector<int64_t> affinities;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public:
|
|||||||
CpuThread(const rapidjson::Value &value);
|
CpuThread(const rapidjson::Value &value);
|
||||||
|
|
||||||
inline bool isEqual(const CpuThread &other) const { return other.m_affinity == m_affinity && other.m_intensity == m_intensity; }
|
inline bool isEqual(const CpuThread &other) const { return other.m_affinity == m_affinity && other.m_intensity == m_intensity; }
|
||||||
inline bool isValid() const { return m_intensity <= 5; }
|
inline bool isValid() const { return m_intensity <= 8; }
|
||||||
inline int64_t affinity() const { return m_affinity; }
|
inline int64_t affinity() const { return m_affinity; }
|
||||||
inline uint32_t intensity() const { return m_intensity == 0 ? 1 : m_intensity; }
|
inline uint32_t intensity() const { return m_intensity == 0 ? 1 : m_intensity; }
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
#include "crypto/rx/Rx.h"
|
#include "crypto/rx/Rx.h"
|
||||||
#include "crypto/rx/RxDataset.h"
|
#include "crypto/rx/RxDataset.h"
|
||||||
#include "crypto/rx/RxVm.h"
|
#include "crypto/rx/RxVm.h"
|
||||||
|
#include "crypto/ghostrider/ghostrider.h"
|
||||||
#include "net/JobResults.h"
|
#include "net/JobResults.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -82,7 +83,8 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
|||||||
{
|
{
|
||||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||||
// cn-heavy optimization for Zen3 CPUs
|
// cn-heavy optimization for Zen3 CPUs
|
||||||
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3)) {
|
const bool is_vermeer = (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3) && (Cpu::info()->model() == 0x21);
|
||||||
|
if ((N == 1) && (m_av == CnHash::AV_SINGLE) && (m_algorithm.family() == Algorithm::CN_HEAVY) && (m_assembly != Assembly::NONE) && is_vermeer) {
|
||||||
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
std::lock_guard<std::mutex> lock(cn_heavyZen3MemoryMutex);
|
||||||
if (!cn_heavyZen3Memory) {
|
if (!cn_heavyZen3Memory) {
|
||||||
// Round up number of threads to the multiple of 8
|
// Round up number of threads to the multiple of 8
|
||||||
@@ -96,6 +98,10 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
|||||||
{
|
{
|
||||||
m_memory = new VirtualMemory(m_algorithm.l3() * N, data.hugePages, false, true, node());
|
m_memory = new VirtualMemory(m_algorithm.l3() * N, data.hugePages, false, true, node());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
m_ghHelper = ghostrider::create_helper_thread(affinity(), data.priority, data.affinities);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -114,6 +120,10 @@ xmrig::CpuWorker<N>::~CpuWorker()
|
|||||||
{
|
{
|
||||||
delete m_memory;
|
delete m_memory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
ghostrider::destroy_helper_thread(m_ghHelper);
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -124,7 +134,7 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
|||||||
RxDataset *dataset = Rx::dataset(m_job.currentJob(), node());
|
RxDataset *dataset = Rx::dataset(m_job.currentJob(), node());
|
||||||
|
|
||||||
while (dataset == nullptr) {
|
while (dataset == nullptr) {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||||
|
|
||||||
if (Nonce::sequence(Nonce::CPU) == 0) {
|
if (Nonce::sequence(Nonce::CPU) == 0) {
|
||||||
return;
|
return;
|
||||||
@@ -153,6 +163,12 @@ bool xmrig::CpuWorker<N>::selfTest()
|
|||||||
|
|
||||||
allocateCnCtx();
|
allocateCnCtx();
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (m_algorithm.family() == Algorithm::GHOSTRIDER) {
|
||||||
|
return (N == 8) && verify(Algorithm::GHOSTRIDER_RTM, test_output_gr);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (m_algorithm.family() == Algorithm::CN) {
|
if (m_algorithm.family() == Algorithm::CN) {
|
||||||
const bool rc = verify(Algorithm::CN_0, test_output_v0) &&
|
const bool rc = verify(Algorithm::CN_0, test_output_v0) &&
|
||||||
verify(Algorithm::CN_1, test_output_v1) &&
|
verify(Algorithm::CN_1, test_output_v1) &&
|
||||||
@@ -230,7 +246,7 @@ void xmrig::CpuWorker<N>::start()
|
|||||||
while (Nonce::sequence(Nonce::CPU) > 0) {
|
while (Nonce::sequence(Nonce::CPU) > 0) {
|
||||||
if (Nonce::isPaused()) {
|
if (Nonce::isPaused()) {
|
||||||
do {
|
do {
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||||
}
|
}
|
||||||
while (Nonce::isPaused() && Nonce::sequence(Nonce::CPU) > 0);
|
while (Nonce::isPaused() && Nonce::sequence(Nonce::CPU) > 0);
|
||||||
|
|
||||||
@@ -299,16 +315,30 @@ void xmrig::CpuWorker<N>::start()
|
|||||||
else
|
else
|
||||||
# endif
|
# endif
|
||||||
{
|
{
|
||||||
|
switch (job.algorithm().family()) {
|
||||||
|
|
||||||
# ifdef XMRIG_ALGO_ASTROBWT
|
# ifdef XMRIG_ALGO_ASTROBWT
|
||||||
if (job.algorithm().family() == Algorithm::ASTROBWT) {
|
case Algorithm::ASTROBWT:
|
||||||
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize, m_astrobwtAVX2)) {
|
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize, m_astrobwtAVX2)) {
|
||||||
valid = false;
|
valid = false;
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
else
|
|
||||||
# endif
|
# endif
|
||||||
{
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
case Algorithm::GHOSTRIDER:
|
||||||
|
if (N == 8) {
|
||||||
|
ghostrider::hash_octa(m_job.blob(), job.size(), m_hash, m_ctx, m_ghHelper);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
valid = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
default:
|
||||||
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
|
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nextRound()) {
|
if (!nextRound()) {
|
||||||
@@ -367,6 +397,37 @@ bool xmrig::CpuWorker<N>::nextRound()
|
|||||||
template<size_t N>
|
template<size_t N>
|
||||||
bool xmrig::CpuWorker<N>::verify(const Algorithm &algorithm, const uint8_t *referenceValue)
|
bool xmrig::CpuWorker<N>::verify(const Algorithm &algorithm, const uint8_t *referenceValue)
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (algorithm == Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
uint8_t blob[N * 80] = {};
|
||||||
|
for (size_t i = 0; i < N; ++i) {
|
||||||
|
blob[i * 80 + 0] = static_cast<uint8_t>(i);
|
||||||
|
blob[i * 80 + 4] = 0x10;
|
||||||
|
blob[i * 80 + 5] = 0x02;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t hash1[N * 32] = {};
|
||||||
|
ghostrider::hash_octa(blob, 80, hash1, m_ctx, 0, false);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N; ++i) {
|
||||||
|
blob[i * 80 + 0] = static_cast<uint8_t>(i);
|
||||||
|
blob[i * 80 + 4] = 0x43;
|
||||||
|
blob[i * 80 + 5] = 0x05;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t hash2[N * 32] = {};
|
||||||
|
ghostrider::hash_octa(blob, 80, hash2, m_ctx, 0, false);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N * 32; ++i) {
|
||||||
|
if ((hash1[i] ^ hash2[i]) != referenceValue[i]) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
cn_hash_fun func = fn(algorithm);
|
cn_hash_fun func = fn(algorithm);
|
||||||
if (!func) {
|
if (!func) {
|
||||||
return false;
|
return false;
|
||||||
@@ -483,6 +544,7 @@ template class CpuWorker<2>;
|
|||||||
template class CpuWorker<3>;
|
template class CpuWorker<3>;
|
||||||
template class CpuWorker<4>;
|
template class CpuWorker<4>;
|
||||||
template class CpuWorker<5>;
|
template class CpuWorker<5>;
|
||||||
|
template class CpuWorker<8>;
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,11 @@ namespace xmrig {
|
|||||||
class RxVm;
|
class RxVm;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
namespace ghostrider { struct HelperThread; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
template<size_t N>
|
template<size_t N>
|
||||||
class CpuWorker : public Worker
|
class CpuWorker : public Worker
|
||||||
{
|
{
|
||||||
@@ -47,6 +52,15 @@ public:
|
|||||||
CpuWorker(size_t id, const CpuLaunchData &data);
|
CpuWorker(size_t id, const CpuLaunchData &data);
|
||||||
~CpuWorker() override;
|
~CpuWorker() override;
|
||||||
|
|
||||||
|
size_t threads() const override
|
||||||
|
{
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
return ((m_algorithm.family() == Algorithm::GHOSTRIDER) && m_ghHelper) ? 2 : 1;
|
||||||
|
# else
|
||||||
|
return 1;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool selfTest() override;
|
bool selfTest() override;
|
||||||
void hashrateData(uint64_t &hashCount, uint64_t &timeStamp, uint64_t &rawHashes) const override;
|
void hashrateData(uint64_t &hashCount, uint64_t &timeStamp, uint64_t &rawHashes) const override;
|
||||||
@@ -87,6 +101,10 @@ private:
|
|||||||
randomx_vm *m_vm = nullptr;
|
randomx_vm *m_vm = nullptr;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
ghostrider::HelperThread* m_ghHelper = nullptr;
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||||
uint32_t m_benchSize = 0;
|
uint32_t m_benchSize = 0;
|
||||||
# endif
|
# endif
|
||||||
@@ -102,6 +120,7 @@ extern template class CpuWorker<2>;
|
|||||||
extern template class CpuWorker<3>;
|
extern template class CpuWorker<3>;
|
||||||
extern template class CpuWorker<4>;
|
extern template class CpuWorker<4>;
|
||||||
extern template class CpuWorker<5>;
|
extern template class CpuWorker<5>;
|
||||||
|
extern template class CpuWorker<8>;
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ public:
|
|||||||
|
|
||||||
enum Flag : uint32_t {
|
enum Flag : uint32_t {
|
||||||
FLAG_AES,
|
FLAG_AES,
|
||||||
|
FLAG_VAES,
|
||||||
FLAG_AVX,
|
FLAG_AVX,
|
||||||
FLAG_AVX2,
|
FLAG_AVX2,
|
||||||
FLAG_AVX512F,
|
FLAG_AVX512F,
|
||||||
@@ -90,6 +91,7 @@ public:
|
|||||||
virtual Assembly::Id assembly() const = 0;
|
virtual Assembly::Id assembly() const = 0;
|
||||||
virtual bool has(Flag feature) const = 0;
|
virtual bool has(Flag feature) const = 0;
|
||||||
virtual bool hasAES() const = 0;
|
virtual bool hasAES() const = 0;
|
||||||
|
virtual bool hasVAES() const = 0;
|
||||||
virtual bool hasAVX() const = 0;
|
virtual bool hasAVX() const = 0;
|
||||||
virtual bool hasAVX2() const = 0;
|
virtual bool hasAVX2() const = 0;
|
||||||
virtual bool hasBMI2() const = 0;
|
virtual bool hasBMI2() const = 0;
|
||||||
@@ -111,6 +113,7 @@ public:
|
|||||||
virtual size_t packages() const = 0;
|
virtual size_t packages() const = 0;
|
||||||
virtual size_t threads() const = 0;
|
virtual size_t threads() const = 0;
|
||||||
virtual Vendor vendor() const = 0;
|
virtual Vendor vendor() const = 0;
|
||||||
|
virtual uint32_t model() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include "crypto/cn/CryptoNight_monero.h"
|
||||||
|
#ifdef XMRIG_VAES
|
||||||
|
# include "crypto/cn/CryptoNight_x86_vaes.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "backend/cpu/platform/BasicCpuInfo.h"
|
#include "backend/cpu/platform/BasicCpuInfo.h"
|
||||||
#include "3rdparty/rapidjson/document.h"
|
#include "3rdparty/rapidjson/document.h"
|
||||||
#include "crypto/common/Assembly.h"
|
#include "crypto/common/Assembly.h"
|
||||||
@@ -52,8 +58,8 @@
|
|||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
constexpr size_t kCpuFlagsSize = 14;
|
constexpr size_t kCpuFlagsSize = 15;
|
||||||
static const std::array<const char *, kCpuFlagsSize> flagNames = { "aes", "avx", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "xop", "popcnt", "cat_l3", "vm" };
|
static const std::array<const char *, kCpuFlagsSize> flagNames = { "aes", "vaes", "avx", "avx2", "avx512f", "bmi2", "osxsave", "pdpe1gb", "sse2", "ssse3", "sse4.1", "xop", "popcnt", "cat_l3", "vm" };
|
||||||
static_assert(kCpuFlagsSize == ICpuInfo::FLAG_MAX, "kCpuFlagsSize and FLAG_MAX mismatch");
|
static_assert(kCpuFlagsSize == ICpuInfo::FLAG_MAX, "kCpuFlagsSize and FLAG_MAX mismatch");
|
||||||
|
|
||||||
|
|
||||||
@@ -140,6 +146,7 @@ static inline bool has_osxsave() { return has_feature(PROCESSOR_INFO,
|
|||||||
static inline bool has_aes_ni() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 25); }
|
static inline bool has_aes_ni() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 25); }
|
||||||
static inline bool has_avx() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 28) && has_osxsave() && has_xcr_avx(); }
|
static inline bool has_avx() { return has_feature(PROCESSOR_INFO, ECX_Reg, 1 << 28) && has_osxsave() && has_xcr_avx(); }
|
||||||
static inline bool has_avx2() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 5) && has_osxsave() && has_xcr_avx(); }
|
static inline bool has_avx2() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 5) && has_osxsave() && has_xcr_avx(); }
|
||||||
|
static inline bool has_vaes() { return has_feature(EXTENDED_FEATURES, ECX_Reg, 1 << 9) && has_osxsave() && has_xcr_avx(); }
|
||||||
static inline bool has_avx512f() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 16) && has_osxsave() && has_xcr_avx512(); }
|
static inline bool has_avx512f() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 16) && has_osxsave() && has_xcr_avx512(); }
|
||||||
static inline bool has_bmi2() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 8); }
|
static inline bool has_bmi2() { return has_feature(EXTENDED_FEATURES, EBX_Reg, 1 << 8); }
|
||||||
static inline bool has_pdpe1gb() { return has_feature(PROCESSOR_EXT_INFO, EDX_Reg, 1 << 26); }
|
static inline bool has_pdpe1gb() { return has_feature(PROCESSOR_EXT_INFO, EDX_Reg, 1 << 26); }
|
||||||
@@ -178,6 +185,7 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
|||||||
m_flags.set(FLAG_AES, has_aes_ni());
|
m_flags.set(FLAG_AES, has_aes_ni());
|
||||||
m_flags.set(FLAG_AVX, has_avx());
|
m_flags.set(FLAG_AVX, has_avx());
|
||||||
m_flags.set(FLAG_AVX2, has_avx2());
|
m_flags.set(FLAG_AVX2, has_avx2());
|
||||||
|
m_flags.set(FLAG_VAES, has_vaes());
|
||||||
m_flags.set(FLAG_AVX512F, has_avx512f());
|
m_flags.set(FLAG_AVX512F, has_avx512f());
|
||||||
m_flags.set(FLAG_BMI2, has_bmi2());
|
m_flags.set(FLAG_BMI2, has_bmi2());
|
||||||
m_flags.set(FLAG_OSXSAVE, has_osxsave());
|
m_flags.set(FLAG_OSXSAVE, has_osxsave());
|
||||||
@@ -292,6 +300,9 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
cn_sse41_enabled = has(FLAG_SSE41);
|
||||||
|
cn_vaes_enabled = has(FLAG_VAES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -361,6 +372,12 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (f == Algorithm::GHOSTRIDER) {
|
||||||
|
return CpuThreads(std::max<size_t>(count / 2, 1), 8);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return CpuThreads(std::max<size_t>(count / 2, 1), 1);
|
return CpuThreads(std::max<size_t>(count / 2, 1), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ protected:
|
|||||||
inline Assembly::Id assembly() const override { return m_assembly; }
|
inline Assembly::Id assembly() const override { return m_assembly; }
|
||||||
inline bool has(Flag flag) const override { return m_flags.test(flag); }
|
inline bool has(Flag flag) const override { return m_flags.test(flag); }
|
||||||
inline bool hasAES() const override { return has(FLAG_AES); }
|
inline bool hasAES() const override { return has(FLAG_AES); }
|
||||||
|
inline bool hasVAES() const override { return has(FLAG_VAES); }
|
||||||
inline bool hasAVX() const override { return has(FLAG_AVX); }
|
inline bool hasAVX() const override { return has(FLAG_AVX); }
|
||||||
inline bool hasAVX2() const override { return has(FLAG_AVX2); }
|
inline bool hasAVX2() const override { return has(FLAG_AVX2); }
|
||||||
inline bool hasBMI2() const override { return has(FLAG_BMI2); }
|
inline bool hasBMI2() const override { return has(FLAG_BMI2); }
|
||||||
@@ -62,6 +63,14 @@ protected:
|
|||||||
inline size_t packages() const override { return 1; }
|
inline size_t packages() const override { return 1; }
|
||||||
inline size_t threads() const override { return m_threads; }
|
inline size_t threads() const override { return m_threads; }
|
||||||
inline Vendor vendor() const override { return m_vendor; }
|
inline Vendor vendor() const override { return m_vendor; }
|
||||||
|
inline uint32_t model() const override
|
||||||
|
{
|
||||||
|
# ifndef XMRIG_ARM
|
||||||
|
return m_model;
|
||||||
|
# else
|
||||||
|
return 0;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Arch m_arch = ARCH_UNKNOWN;
|
Arch m_arch = ARCH_UNKNOWN;
|
||||||
|
|||||||
@@ -99,8 +99,14 @@ const char *xmrig::BasicCpuInfo::backend() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &, uint32_t) const
|
xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint32_t) const
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (algorithm.family() == Algorithm::GHOSTRIDER) {
|
||||||
|
return CpuThreads(threads(), 8);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return CpuThreads(threads());
|
return CpuThreads(threads());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -269,8 +269,10 @@ xmrig::CpuThreads xmrig::HwlocCpuInfo::allThreads(const Algorithm &algorithm, ui
|
|||||||
CpuThreads threads;
|
CpuThreads threads;
|
||||||
threads.reserve(m_threads);
|
threads.reserve(m_threads);
|
||||||
|
|
||||||
|
const uint32_t intensity = (algorithm.family() == Algorithm::GHOSTRIDER) ? 8 : 0;
|
||||||
|
|
||||||
for (const int32_t pu : m_units) {
|
for (const int32_t pu : m_units) {
|
||||||
threads.add(pu, 0);
|
threads.add(pu, intensity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (threads.isEmpty()) {
|
if (threads.isEmpty()) {
|
||||||
@@ -296,6 +298,18 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
|||||||
cores.reserve(m_cores);
|
cores.reserve(m_cores);
|
||||||
findByType(cache, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); });
|
findByType(cache, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); });
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if ((algorithm == Algorithm::GHOSTRIDER_RTM) && (PUs > cores.size()) && (PUs < cores.size() * 2)) {
|
||||||
|
// Don't use E-cores on Alder Lake
|
||||||
|
cores.erase(std::remove_if(cores.begin(), cores.end(), [](hwloc_obj_t c) { return hwloc_bitmap_weight(c->cpuset) == 1; }), cores.end());
|
||||||
|
|
||||||
|
// This shouldn't happen, but check it anyway
|
||||||
|
if (cores.empty()) {
|
||||||
|
findByType(cache, HWLOC_OBJ_CORE, [&cores](hwloc_obj_t found) { cores.emplace_back(found); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
size_t L3 = cache->attr->cache.size;
|
size_t L3 = cache->attr->cache.size;
|
||||||
const bool L3_exclusive = isCacheExclusive(cache);
|
const bool L3_exclusive = isCacheExclusive(cache);
|
||||||
size_t L2 = 0;
|
size_t L2 = 0;
|
||||||
@@ -351,6 +365,15 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
|
|||||||
cacheHashes = std::min(cacheHashes, limit);
|
cacheHashes = std::min(cacheHashes, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (algorithm == Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
// GhostRider implementation runs 8 hashes at a time
|
||||||
|
intensity = 8;
|
||||||
|
// Always 1 thread per core (it uses additional helper thread when possible)
|
||||||
|
cacheHashes = std::min(cacheHashes, cores.size());
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (cacheHashes >= PUs) {
|
if (cacheHashes >= PUs) {
|
||||||
for (hwloc_obj_t core : cores) {
|
for (hwloc_obj_t core : cores) {
|
||||||
const std::vector<hwloc_obj_t> units = findByType(core, HWLOC_OBJ_PU);
|
const std::vector<hwloc_obj_t> units = findByType(core, HWLOC_OBJ_PU);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
static const char astrobwt_cl[12493] = {
|
static const char astrobwt_cl[12489] = {
|
||||||
0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,
|
0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,
|
||||||
0x73,0x68,0x6f,0x72,0x74,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x69,0x6e,0x74,0x20,0x75,0x69,0x6e,
|
0x73,0x68,0x6f,0x72,0x74,0x20,0x75,0x69,0x6e,0x74,0x31,0x36,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x69,0x6e,0x74,0x20,0x75,0x69,0x6e,
|
||||||
0x74,0x33,0x32,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x3b,0x0a,0x74,
|
0x74,0x33,0x32,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x3b,0x0a,0x74,
|
||||||
@@ -260,140 +260,140 @@ static const char astrobwt_cl[12493] = {
|
|||||||
0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,
|
0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x6f,0x75,0x74,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x29,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x33,
|
||||||
0x32,0x5f,0x74,0x29,0x5d,0x20,0x26,0x3d,0x20,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x3e,0x3e,0x28,0x28,0x34,0x2d,0x28,0x6f,0x75,0x74,0x70,0x75,
|
0x32,0x5f,0x74,0x29,0x5d,0x20,0x26,0x3d,0x20,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x3e,0x3e,0x28,0x28,0x34,0x2d,0x28,0x6f,0x75,0x74,0x70,0x75,
|
||||||
0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x3c,0x3c,0x33,0x29,0x3b,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,
|
0x74,0x5f,0x73,0x69,0x7a,0x65,0x26,0x33,0x29,0x29,0x3c,0x3c,0x33,0x29,0x3b,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,
|
||||||
0x20,0x32,0x34,0x20,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x36,0x34,0x28,0x61,0x2c,0x62,0x2c,0x63,0x29,0x20,0x28,0x28,0x28,0x61,0x29,0x20,0x3c,0x3c,
|
0x20,0x32,0x34,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x36,0x34,0x28,0x61,0x2c,0x62,0x2c,0x63,0x29,0x20,0x28,0x28,0x28,0x61,0x29,0x20,0x3c,0x3c,0x20,
|
||||||
0x20,0x62,0x29,0x20,0x7c,0x20,0x28,0x28,0x61,0x29,0x20,0x3e,0x3e,0x20,0x63,0x29,0x29,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,
|
0x62,0x29,0x20,0x7c,0x20,0x28,0x28,0x61,0x29,0x20,0x3e,0x3e,0x20,0x63,0x29,0x29,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,
|
||||||
0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x72,0x63,0x5b,0x32,0x5d,0x5b,0x52,0x4f,0x55,0x4e,0x44,0x53,0x5d,0x3d,0x7b,0x0a,0x7b,0x30,0x78,0x30,
|
0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x72,0x63,0x5b,0x32,0x5d,0x5b,0x52,0x4f,0x55,0x4e,0x44,0x53,0x5d,0x3d,0x7b,0x0a,0x7b,0x30,0x78,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
||||||
0x38,0x30,0x38,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,
|
0x30,0x38,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
||||||
0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,
|
0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
||||||
0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,
|
0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x38,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x38,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,
|
||||||
0x38,0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,
|
0x30,0x30,0x39,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x41,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
0x30,0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x39,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,
|
0x30,0x38,0x42,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x39,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x33,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x33,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,
|
||||||
0x38,0x30,0x30,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,
|
0x30,0x30,0x32,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,
|
0x30,0x30,0x41,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x38,0x31,0x55,0x4c,0x2c,0x0a,0x30,0x78,0x38,0x30,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x38,0x30,0x55,0x4c,0x2c,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x30,
|
||||||
0x30,0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x38,0x55,0x4c,0x7d,0x2c,0x0a,0x7b,0x30,
|
0x30,0x30,0x31,0x55,0x4c,0x2c,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x38,0x30,0x30,0x30,0x38,0x30,0x30,0x38,0x55,0x4c,0x7d,0x2c,0x0a,0x7b,0x30,0x55,
|
||||||
|
0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x0a,0x30,
|
||||||
0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x0a,
|
0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x0a,
|
||||||
0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,
|
0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x7d,
|
||||||
0x0a,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,0x2c,0x30,0x55,0x4c,
|
0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x72,0x6f,0x5b,0x32,0x35,0x5d,0x5b,
|
||||||
0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x72,0x6f,0x5b,0x32,0x35,0x5d,
|
0x32,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x36,0x34,0x7d,0x2c,0x7b,0x34,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x34,0x33,0x2c,0x32,0x31,0x7d,0x2c,0x7b,0x32,0x31,
|
||||||
0x5b,0x32,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x36,0x34,0x7d,0x2c,0x7b,0x34,0x34,0x2c,0x32,0x30,0x7d,0x2c,0x7b,0x34,0x33,0x2c,0x32,0x31,0x7d,0x2c,0x7b,0x32,
|
0x2c,0x34,0x33,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x35,0x30,0x7d,0x2c,0x0a,0x7b,0x20,0x31,0x2c,0x36,0x33,0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x35,0x38,0x7d,0x2c,0x7b,0x32,
|
||||||
0x31,0x2c,0x34,0x33,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x35,0x30,0x7d,0x2c,0x0a,0x7b,0x20,0x31,0x2c,0x36,0x33,0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x35,0x38,0x7d,0x2c,0x7b,
|
0x35,0x2c,0x33,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x35,0x36,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x34,0x36,0x7d,0x2c,0x0a,0x7b,0x36,0x32,0x2c,0x32,0x7d,0x2c,0x7b,0x35,
|
||||||
0x32,0x35,0x2c,0x33,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x35,0x36,0x7d,0x2c,0x7b,0x31,0x38,0x2c,0x34,0x36,0x7d,0x2c,0x0a,0x7b,0x36,0x32,0x2c,0x32,0x7d,0x2c,0x7b,
|
0x35,0x2c,0x39,0x7d,0x2c,0x7b,0x33,0x39,0x2c,0x32,0x35,0x7d,0x2c,0x7b,0x34,0x31,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x20,0x32,0x2c,0x36,0x32,0x7d,0x2c,0x0a,0x7b,0x32,
|
||||||
0x35,0x35,0x2c,0x39,0x7d,0x2c,0x7b,0x33,0x39,0x2c,0x32,0x35,0x7d,0x2c,0x7b,0x34,0x31,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x20,0x32,0x2c,0x36,0x32,0x7d,0x2c,0x0a,0x7b,
|
0x38,0x2c,0x33,0x36,0x7d,0x2c,0x7b,0x32,0x30,0x2c,0x34,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x36,0x31,0x7d,0x2c,0x7b,0x34,0x35,0x2c,0x31,0x39,0x7d,0x2c,0x7b,0x36,
|
||||||
0x32,0x38,0x2c,0x33,0x36,0x7d,0x2c,0x7b,0x32,0x30,0x2c,0x34,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x36,0x31,0x7d,0x2c,0x7b,0x34,0x35,0x2c,0x31,0x39,0x7d,0x2c,0x7b,
|
0x31,0x2c,0x33,0x7d,0x2c,0x0a,0x7b,0x32,0x37,0x2c,0x33,0x37,0x7d,0x2c,0x7b,0x33,0x36,0x2c,0x32,0x38,0x7d,0x2c,0x7b,0x31,0x30,0x2c,0x35,0x34,0x7d,0x2c,0x7b,0x31,
|
||||||
0x36,0x31,0x2c,0x33,0x7d,0x2c,0x0a,0x7b,0x32,0x37,0x2c,0x33,0x37,0x7d,0x2c,0x7b,0x33,0x36,0x2c,0x32,0x38,0x7d,0x2c,0x7b,0x31,0x30,0x2c,0x35,0x34,0x7d,0x2c,0x7b,
|
0x35,0x2c,0x34,0x39,0x7d,0x2c,0x7b,0x35,0x36,0x2c,0x38,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,
|
||||||
0x31,0x35,0x2c,0x34,0x39,0x7d,0x2c,0x7b,0x35,0x36,0x2c,0x38,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,
|
0x20,0x69,0x6e,0x74,0x20,0x61,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x36,0x2c,0x31,0x32,0x2c,0x31,0x38,0x2c,0x32,0x34,0x2c,0x0a,0x31,0x2c,0x37,0x2c,0x31,
|
||||||
0x74,0x20,0x69,0x6e,0x74,0x20,0x61,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x36,0x2c,0x31,0x32,0x2c,0x31,0x38,0x2c,0x32,0x34,0x2c,0x0a,0x31,0x2c,0x37,0x2c,
|
0x33,0x2c,0x31,0x39,0x2c,0x32,0x30,0x2c,0x0a,0x32,0x2c,0x38,0x2c,0x31,0x34,0x2c,0x31,0x35,0x2c,0x32,0x31,0x2c,0x0a,0x33,0x2c,0x39,0x2c,0x31,0x30,0x2c,0x31,0x36,
|
||||||
0x31,0x33,0x2c,0x31,0x39,0x2c,0x32,0x30,0x2c,0x0a,0x32,0x2c,0x38,0x2c,0x31,0x34,0x2c,0x31,0x35,0x2c,0x32,0x31,0x2c,0x0a,0x33,0x2c,0x39,0x2c,0x31,0x30,0x2c,0x31,
|
0x2c,0x32,0x32,0x2c,0x0a,0x34,0x2c,0x35,0x2c,0x31,0x31,0x2c,0x31,0x37,0x2c,0x32,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,
|
||||||
0x36,0x2c,0x32,0x32,0x2c,0x0a,0x34,0x2c,0x35,0x2c,0x31,0x31,0x2c,0x31,0x37,0x2c,0x32,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,
|
0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x62,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,0x2c,0x32,
|
||||||
0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x62,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,0x2c,
|
0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x0a,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x0a,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x0a,0x34,0x2c,
|
||||||
0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x0a,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x0a,0x33,0x2c,0x34,0x2c,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x0a,0x34,
|
0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,
|
||||||
0x2c,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,
|
0x63,0x5b,0x32,0x35,0x5d,0x5b,0x33,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x31,0x2c,0x32,0x7d,0x2c,0x7b,0x20,0x31,0x2c,0x32,0x2c,0x33,0x7d,0x2c,0x7b,0x20,0x32,
|
||||||
0x20,0x63,0x5b,0x32,0x35,0x5d,0x5b,0x33,0x5d,0x3d,0x7b,0x0a,0x7b,0x20,0x30,0x2c,0x31,0x2c,0x32,0x7d,0x2c,0x7b,0x20,0x31,0x2c,0x32,0x2c,0x33,0x7d,0x2c,0x7b,0x20,
|
0x2c,0x33,0x2c,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x34,0x2c,0x30,0x7d,0x2c,0x7b,0x20,0x34,0x2c,0x30,0x2c,0x31,0x7d,0x2c,0x0a,0x7b,0x20,0x35,0x2c,0x36,0x2c,0x37,
|
||||||
0x32,0x2c,0x33,0x2c,0x34,0x7d,0x2c,0x7b,0x20,0x33,0x2c,0x34,0x2c,0x30,0x7d,0x2c,0x7b,0x20,0x34,0x2c,0x30,0x2c,0x31,0x7d,0x2c,0x0a,0x7b,0x20,0x35,0x2c,0x36,0x2c,
|
0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x37,0x2c,0x38,0x7d,0x2c,0x7b,0x20,0x37,0x2c,0x38,0x2c,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x39,0x2c,0x35,0x7d,0x2c,0x7b,0x20,0x39,
|
||||||
0x37,0x7d,0x2c,0x7b,0x20,0x36,0x2c,0x37,0x2c,0x38,0x7d,0x2c,0x7b,0x20,0x37,0x2c,0x38,0x2c,0x39,0x7d,0x2c,0x7b,0x20,0x38,0x2c,0x39,0x2c,0x35,0x7d,0x2c,0x7b,0x20,
|
0x2c,0x35,0x2c,0x36,0x7d,0x2c,0x0a,0x7b,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x7d,0x2c,0x7b,0x31,0x31,0x2c,0x31,0x32,0x2c,0x31,0x33,0x7d,0x2c,0x7b,0x31,0x32,
|
||||||
0x39,0x2c,0x35,0x2c,0x36,0x7d,0x2c,0x0a,0x7b,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,0x32,0x7d,0x2c,0x7b,0x31,0x31,0x2c,0x31,0x32,0x2c,0x31,0x33,0x7d,0x2c,0x7b,0x31,
|
0x2c,0x31,0x33,0x2c,0x31,0x34,0x7d,0x2c,0x7b,0x31,0x33,0x2c,0x31,0x34,0x2c,0x31,0x30,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x31,0x30,0x2c,0x31,0x31,0x7d,0x2c,0x0a,0x7b,
|
||||||
0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x7d,0x2c,0x7b,0x31,0x33,0x2c,0x31,0x34,0x2c,0x31,0x30,0x7d,0x2c,0x7b,0x31,0x34,0x2c,0x31,0x30,0x2c,0x31,0x31,0x7d,0x2c,0x0a,
|
0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x7d,0x2c,0x7b,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x7d,0x2c,0x7b,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x7d,0x2c,
|
||||||
0x7b,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x7d,0x2c,0x7b,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x7d,0x2c,0x7b,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x7d,
|
0x7b,0x31,0x38,0x2c,0x31,0x39,0x2c,0x31,0x35,0x7d,0x2c,0x7b,0x31,0x39,0x2c,0x31,0x35,0x2c,0x31,0x36,0x7d,0x2c,0x0a,0x7b,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,
|
||||||
0x2c,0x7b,0x31,0x38,0x2c,0x31,0x39,0x2c,0x31,0x35,0x7d,0x2c,0x7b,0x31,0x39,0x2c,0x31,0x35,0x2c,0x31,0x36,0x7d,0x2c,0x0a,0x7b,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,
|
0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x7d,0x2c,0x7b,0x32,0x33,0x2c,0x32,0x34,0x2c,0x32,
|
||||||
0x32,0x7d,0x2c,0x7b,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x7d,0x2c,0x7b,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x7d,0x2c,0x7b,0x32,0x33,0x2c,0x32,0x34,0x2c,
|
0x30,0x7d,0x2c,0x7b,0x32,0x34,0x2c,0x32,0x30,0x2c,0x32,0x31,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,
|
||||||
0x32,0x30,0x7d,0x2c,0x7b,0x32,0x34,0x2c,0x32,0x30,0x2c,0x32,0x31,0x7d,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x63,0x6f,0x6e,
|
0x74,0x20,0x69,0x6e,0x74,0x20,0x64,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,0x30,0x2c,0x31,0x31,0x2c,0x31,
|
||||||
0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x64,0x5b,0x32,0x35,0x5d,0x3d,0x7b,0x0a,0x30,0x2c,0x31,0x2c,0x32,0x2c,0x33,0x2c,0x34,0x2c,0x0a,0x31,0x30,0x2c,0x31,0x31,0x2c,
|
0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x2c,0x0a,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x2c,0x0a,0x35,0x2c,0x36,0x2c,0x37,0x2c,0x38,
|
||||||
0x31,0x32,0x2c,0x31,0x33,0x2c,0x31,0x34,0x2c,0x0a,0x32,0x30,0x2c,0x32,0x31,0x2c,0x32,0x32,0x2c,0x32,0x33,0x2c,0x32,0x34,0x2c,0x0a,0x35,0x2c,0x36,0x2c,0x37,0x2c,
|
0x2c,0x39,0x2c,0x0a,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,
|
||||||
0x38,0x2c,0x39,0x2c,0x0a,0x31,0x35,0x2c,0x31,0x36,0x2c,0x31,0x37,0x2c,0x31,0x38,0x2c,0x31,0x39,0x0a,0x7d,0x3b,0x0a,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,
|
0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,0x31,
|
||||||
0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,
|
0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,
|
||||||
0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,
|
0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,
|
||||||
0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x73,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,
|
0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,0x33,
|
||||||
0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x2c,0x75,0x69,0x6e,0x74,
|
0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,
|
||||||
0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,
|
0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x3d,0x67,
|
||||||
0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x3d,
|
0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,
|
||||||
0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,
|
0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,0x74,0x75,
|
||||||
0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,0x74,
|
0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,0x3b,0x0a,0x63,0x6f,0x6e,0x73,
|
||||||
0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,0x3b,0x0a,0x63,0x6f,0x6e,
|
0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,
|
||||||
0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x3d,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,
|
0x5f,0x74,0x29,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2a,0x67,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,
|
||||||
0x34,0x5f,0x74,0x29,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x74,0x72,0x69,0x64,0x65,0x29,0x2a,0x67,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,
|
0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,
|
||||||
0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,
|
0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x73,0x2b,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
||||||
0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x73,0x2b,0x69,0x6e,0x70,0x75,0x74,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,0x5d,
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x73,0x5b,0x67,
|
0x2b,0x31,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,
|
||||||
0x5d,0x2b,0x31,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,
|
0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,
|
0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,
|
||||||
0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x30,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,
|
0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,
|
||||||
0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,
|
0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,
|
||||||
0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,
|
0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x75,0x69,
|
||||||
0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x75,
|
0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,
|
0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x77,0x6f,0x72,0x64,0x73,0x3b,0x20,0x2b,0x2b,0x69,0x2c,0x2b,0x2b,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x41,
|
||||||
0x5f,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x77,0x6f,0x72,0x64,0x73,0x3b,0x20,0x2b,0x2b,0x69,0x2c,0x2b,0x2b,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,
|
0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x2a,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x2b,0x2b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,
|
||||||
0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x2a,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x2b,0x2b,0x77,0x6f,0x72,0x64,0x49,0x6e,
|
0x65,0x78,0x3b,0x0a,0x69,0x66,0x28,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x3d,0x31,0x37,0x29,0x0a,0x7b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,
|
||||||
0x64,0x65,0x78,0x3b,0x0a,0x69,0x66,0x28,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x3d,0x31,0x37,0x29,0x0a,0x7b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,
|
0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,
|
||||||
0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x52,0x4f,0x55,0x4e,0x44,0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,
|
0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,
|
||||||
0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,
|
0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,
|
||||||
0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,
|
0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,
|
||||||
0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,
|
0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,
|
||||||
0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,
|
0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,
|
||||||
0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,
|
0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,
|
||||||
0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,
|
0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x0a,0x7d,0x0a,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x30,
|
||||||
0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,
|
0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x3d,0x30,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,
|
||||||
0x3d,0x30,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x74,0x61,0x69,0x6c,0x3d,0x30,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,
|
0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,
|
||||||
0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x70,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,
|
0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x29,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,
|
||||||
0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x29,0x69,0x6e,0x70,0x75,0x74,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
0x3d,0x30,0x3b,0x20,0x69,0x3c,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x74,0x61,0x69,0x6c,0x7c,0x3d,0x28,0x75,
|
||||||
0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x74,0x61,0x69,0x6c,0x7c,0x3d,
|
0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x70,0x5b,0x69,0x5d,0x29,0x3c,0x3c,0x28,0x69,0x2a,0x38,0x29,0x3b,0x0a,0x7d,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,
|
||||||
0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x70,0x5b,0x69,0x5d,0x29,0x3c,0x3c,0x28,0x69,0x2a,0x38,0x29,0x3b,0x0a,0x7d,0x0a,0x41,0x5b,0x77,0x6f,0x72,
|
0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x74,0x61,0x69,0x6c,0x5e,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,
|
||||||
0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x74,0x61,0x69,0x6c,0x5e,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,
|
0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,
|
||||||
0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,
|
0x38,0x29,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
0x65,0x2a,0x38,0x29,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x31,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,
|
||||||
0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x31,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,
|
0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,
|
||||||
0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,
|
0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,
|
||||||
0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,
|
0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,
|
||||||
0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,
|
0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,
|
||||||
0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,
|
0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,
|
||||||
0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,
|
0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,
|
||||||
0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,
|
0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x0a,0x7d,0x0a,0x69,0x66,0x28,
|
||||||
0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,
|
0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,
|
||||||
0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,
|
0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x5f,0x5f,0x61,0x74,
|
||||||
0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x5f,
|
0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x28,
|
||||||
0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,
|
0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x5f,0x69,0x6e,0x69,
|
||||||
0x7a,0x65,0x28,0x33,0x32,0x2c,0x31,0x2c,0x31,0x29,0x29,0x29,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,0x73,0x68,0x61,0x33,0x5f,
|
0x74,0x69,0x61,0x6c,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,
|
||||||
0x69,0x6e,0x69,0x74,0x69,0x61,0x6c,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x38,0x5f,0x74,0x2a,0x20,
|
0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x75,0x69,0x6e,0x74,
|
||||||
0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x2c,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x75,
|
0x33,0x32,0x5f,0x74,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x68,0x61,
|
||||||
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,
|
0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,0x6c,0x6f,0x63,
|
||||||
0x20,0x68,0x61,0x73,0x68,0x65,0x73,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x3d,0x67,0x65,0x74,0x5f,
|
0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,0x74,0x5f,0x67,
|
||||||
0x6c,0x6f,0x63,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x67,0x3d,0x67,0x65,
|
0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x63,0x6f,
|
||||||
0x74,0x5f,0x67,0x72,0x6f,0x75,0x70,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x74,0x3e,0x3d,0x32,0x35,0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,
|
0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,
|
||||||
0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x73,0x3d,0x74,0x20,0x25,0x20,0x35,0x3b,0x0a,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,
|
0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,
|
||||||
0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x2a,0x20,0x69,0x6e,0x70,0x75,0x74,0x3d,0x28,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,
|
0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x29,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,
|
||||||
0x36,0x34,0x5f,0x74,0x2a,0x29,0x28,0x69,0x6e,0x70,0x75,0x74,0x5f,0x64,0x61,0x74,0x61,0x29,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,
|
0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,0x35,0x5d,0x3b,
|
||||||
0x36,0x34,0x5f,0x74,0x20,0x41,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x43,0x5b,0x32,
|
0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x3d,0x28,0x74,
|
||||||
0x35,0x5d,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x20,0x44,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x41,0x5b,0x74,0x5d,
|
0x3c,0x31,0x36,0x29,0x3f,0x69,0x6e,0x70,0x75,0x74,0x5b,0x74,0x5d,0x3a,0x30,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
||||||
0x3d,0x28,0x74,0x3c,0x31,0x36,0x29,0x3f,0x69,0x6e,0x70,0x75,0x74,0x5b,0x74,0x5d,0x3a,0x30,0x3b,0x0a,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,
|
0x74,0x2a,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x3d,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x2a,0x29,
|
||||||
0x33,0x32,0x5f,0x74,0x2a,0x20,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x3d,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,
|
0x28,0x41,0x29,0x2b,0x39,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x3d,0x67,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x3d,0x28,0x6e,
|
||||||
0x74,0x2a,0x29,0x28,0x41,0x29,0x2b,0x39,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x2b,0x3d,0x67,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,
|
0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x26,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x29,0x7c,0x28,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x26,0x30,
|
||||||
0x3d,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x30,0x5d,0x26,0x30,0x78,0x46,0x46,0x46,0x46,0x46,0x46,0x55,0x29,0x7c,0x28,0x28,0x6e,0x6f,0x6e,0x63,
|
0x78,0x46,0x46,0x29,0x3c,0x3c,0x32,0x34,0x29,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x3d,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,
|
||||||
0x65,0x26,0x30,0x78,0x46,0x46,0x29,0x3c,0x3c,0x32,0x34,0x29,0x3b,0x0a,0x6e,0x6f,0x6e,0x63,0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x3d,0x28,0x6e,0x6f,0x6e,0x63,
|
0x6f,0x73,0x5b,0x31,0x5d,0x26,0x30,0x78,0x46,0x46,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x29,0x7c,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x3e,0x3e,0x38,0x29,0x3b,0x0a,0x75,
|
||||||
0x65,0x5f,0x70,0x6f,0x73,0x5b,0x31,0x5d,0x26,0x30,0x78,0x46,0x46,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x29,0x7c,0x28,0x6e,0x6f,0x6e,0x63,0x65,0x3e,0x3e,0x38,0x29,
|
0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,0x73,0x69,0x7a,
|
||||||
0x3b,0x0a,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2f,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,0x20,0x74,0x61,
|
||||||
0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x33,0x32,0x5f,0x74,
|
0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,
|
||||||
0x20,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x3d,0x69,0x6e,0x70,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x20,0x25,0x20,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,
|
0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,
|
||||||
0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x3b,0x0a,0x41,0x5b,0x77,0x6f,0x72,0x64,0x49,0x6e,0x64,0x65,0x78,0x5d,0x20,0x5e,0x3d,0x20,0x28,0x75,0x69,0x6e,0x74,0x36,
|
0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,0x28,0x74,0x61,
|
||||||
0x34,0x5f,0x74,0x29,0x28,0x28,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x28,0x30,0x78,0x30,0x32,0x7c,0x28,0x31,0x3c,0x3c,0x32,0x29,0x29,0x29,0x3c,0x3c,
|
0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,
|
||||||
0x28,0x74,0x61,0x69,0x6c,0x5f,0x73,0x69,0x7a,0x65,0x2a,0x38,0x29,0x29,0x3b,0x0a,0x41,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x30,0x78,0x38,0x30,0x30,0x30,0x30,
|
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x52,0x4f,0x55,0x4e,0x44,
|
||||||
0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x55,0x4c,0x3b,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x75,0x6e,0x72,0x6f,0x6c,0x6c,0x20,0x52,0x4f,
|
0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,
|
||||||
0x55,0x4e,0x44,0x53,0x0a,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x3c,0x52,0x4f,0x55,0x4e,0x44,0x53,0x3b,0x20,0x2b,0x2b,0x69,
|
0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x35,
|
||||||
0x29,0x0a,0x7b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x41,0x5b,0x73,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x31,0x30,0x5d,0x5e,0x41,0x5b,0x73,
|
0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,0x34,0x28,0x43,
|
||||||
0x2b,0x31,0x35,0x5d,0x5e,0x41,0x5b,0x73,0x2b,0x32,0x30,0x5d,0x3b,0x0a,0x44,0x5b,0x74,0x5d,0x3d,0x43,0x5b,0x62,0x5b,0x32,0x30,0x2b,0x73,0x5d,0x5d,0x5e,0x52,0x36,
|
0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,0x74,0x5d,0x5d,
|
||||||
0x34,0x28,0x43,0x5b,0x62,0x5b,0x35,0x2b,0x73,0x5d,0x5d,0x2c,0x31,0x2c,0x36,0x33,0x29,0x3b,0x0a,0x43,0x5b,0x74,0x5d,0x3d,0x52,0x36,0x34,0x28,0x41,0x5b,0x61,0x5b,
|
0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x64,
|
||||||
0x74,0x5d,0x5d,0x5e,0x44,0x5b,0x62,0x5b,0x74,0x5d,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x2c,0x72,0x6f,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x29,0x3b,0x0a,
|
0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,0x29,0x26,0x43,
|
||||||
0x41,0x5b,0x64,0x5b,0x74,0x5d,0x5d,0x3d,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x30,0x5d,0x5d,0x5e,0x28,0x28,0x7e,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x31,0x5d,0x5d,
|
0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,0x3f,0x30,0x3a,
|
||||||
0x29,0x26,0x43,0x5b,0x63,0x5b,0x74,0x5d,0x5b,0x32,0x5d,0x5d,0x29,0x3b,0x0a,0x41,0x5b,0x74,0x5d,0x20,0x5e,0x3d,0x20,0x72,0x63,0x5b,0x28,0x74,0x3d,0x3d,0x30,0x29,
|
0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,0x2a,0x28,0x33,0x32,
|
||||||
0x3f,0x30,0x3a,0x31,0x5d,0x5b,0x69,0x5d,0x3b,0x20,0x0a,0x7d,0x0a,0x69,0x66,0x28,0x74,0x3c,0x34,0x29,0x0a,0x7b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x2b,0x3d,0x67,
|
0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,0x5d,0x3d,0x41,0x5b,
|
||||||
0x2a,0x28,0x33,0x32,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x36,0x34,0x5f,0x74,0x29,0x29,0x3b,0x0a,0x68,0x61,0x73,0x68,0x65,0x73,0x5b,0x74,
|
0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x00
|
||||||
0x5d,0x3d,0x41,0x5b,0x74,0x5d,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x00
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
*
|
*
|
||||||
* @author djm34
|
* @author djm34
|
||||||
*/
|
*/
|
||||||
__constant static const int sigma[16][16] = {
|
__constant STATIC const int sigma[16][16] = {
|
||||||
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
|
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 },
|
||||||
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
|
{ 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 },
|
||||||
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
|
{ 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 },
|
||||||
@@ -47,7 +47,7 @@ __constant static const int sigma[16][16] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
__constant static const sph_u32 c_IV256[8] = {
|
__constant STATIC const sph_u32 c_IV256[8] = {
|
||||||
0x6A09E667, 0xBB67AE85,
|
0x6A09E667, 0xBB67AE85,
|
||||||
0x3C6EF372, 0xA54FF53A,
|
0x3C6EF372, 0xA54FF53A,
|
||||||
0x510E527F, 0x9B05688C,
|
0x510E527F, 0x9B05688C,
|
||||||
@@ -55,13 +55,13 @@ __constant static const sph_u32 c_IV256[8] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Second part (64-80) msg never change, store it */
|
/* Second part (64-80) msg never change, store it */
|
||||||
__constant static const sph_u32 c_Padding[16] = {
|
__constant STATIC const sph_u32 c_Padding[16] = {
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
0x80000000, 0, 0, 0,
|
0x80000000, 0, 0, 0,
|
||||||
0, 0, 0, 0,
|
0, 0, 0, 0,
|
||||||
0, 1, 0, 640,
|
0, 1, 0, 640,
|
||||||
};
|
};
|
||||||
__constant static const sph_u32 c_u256[16] = {
|
__constant STATIC const sph_u32 c_u256[16] = {
|
||||||
0x243F6A88, 0x85A308D3,
|
0x243F6A88, 0x85A308D3,
|
||||||
0x13198A2E, 0x03707344,
|
0x13198A2E, 0x03707344,
|
||||||
0xA4093822, 0x299F31D0,
|
0xA4093822, 0x299F31D0,
|
||||||
|
|||||||
@@ -22,6 +22,15 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef STATIC
|
||||||
|
# undef STATIC
|
||||||
|
#endif
|
||||||
|
#ifdef cl_amd_media_ops
|
||||||
|
# define STATIC static
|
||||||
|
#else
|
||||||
|
# define STATIC
|
||||||
|
#endif
|
||||||
|
|
||||||
/* For Mesa clover support */
|
/* For Mesa clover support */
|
||||||
#ifdef cl_clang_storage_class_specifiers
|
#ifdef cl_clang_storage_class_specifiers
|
||||||
# pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
|
# pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
|
||||||
@@ -39,7 +48,7 @@
|
|||||||
#include "keccak.cl"
|
#include "keccak.cl"
|
||||||
|
|
||||||
|
|
||||||
#if defined(__NV_CL_C_VERSION) && STRIDED_INDEX != 0
|
#if (defined(__NV_CL_C_VERSION) || defined(__APPLE__)) && STRIDED_INDEX != 0
|
||||||
# undef STRIDED_INDEX
|
# undef STRIDED_INDEX
|
||||||
# define STRIDED_INDEX 0
|
# define STRIDED_INDEX 0
|
||||||
#endif
|
#endif
|
||||||
@@ -755,7 +764,7 @@ __kernel void cn2(__global uint4 *Scratchpad, __global ulong *states, __global u
|
|||||||
|
|
||||||
__kernel void Skein(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
__kernel void Skein(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
||||||
{
|
{
|
||||||
const uint idx = get_global_id(0) - get_global_offset(0);
|
const uint idx = getIdx();
|
||||||
|
|
||||||
// do not use early return here
|
// do not use early return here
|
||||||
if(idx < BranchBuf[Threads]) {
|
if(idx < BranchBuf[Threads]) {
|
||||||
@@ -800,9 +809,9 @@ __kernel void Skein(__global ulong *states, __global uint *BranchBuf, __global u
|
|||||||
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
||||||
// and expect an accurate result for target > 32-bit without implementing carries
|
// and expect an accurate result for target > 32-bit without implementing carries
|
||||||
if (p.s3 <= Target) {
|
if (p.s3 <= Target) {
|
||||||
ulong outIdx = atomic_inc(output + 0xFF);
|
const uint outIdx = atomic_inc(output + 0xFF);
|
||||||
if (outIdx < 0xFF) {
|
if (outIdx < 0xFF) {
|
||||||
output[outIdx] = BranchBuf[idx] + (uint) get_global_offset(0);
|
((__global uint *)output)[outIdx] = BranchBuf[idx] + (uint)get_global_offset(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -838,7 +847,7 @@ __kernel void Skein(__global ulong *states, __global uint *BranchBuf, __global u
|
|||||||
|
|
||||||
__kernel void JH(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
__kernel void JH(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
||||||
{
|
{
|
||||||
const uint idx = get_global_id(0) - get_global_offset(0);
|
const uint idx = getIdx();
|
||||||
|
|
||||||
// do not use early return here
|
// do not use early return here
|
||||||
if (idx < BranchBuf[Threads]) {
|
if (idx < BranchBuf[Threads]) {
|
||||||
@@ -872,9 +881,9 @@ __kernel void JH(__global ulong *states, __global uint *BranchBuf, __global uint
|
|||||||
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
||||||
// and expect an accurate result for target > 32-bit without implementing carries
|
// and expect an accurate result for target > 32-bit without implementing carries
|
||||||
if (h7l <= Target) {
|
if (h7l <= Target) {
|
||||||
ulong outIdx = atomic_inc(output + 0xFF);
|
const uint outIdx = atomic_inc(output + 0xFF);
|
||||||
if (outIdx < 0xFF) {
|
if (outIdx < 0xFF) {
|
||||||
output[outIdx] = BranchBuf[idx] + (uint) get_global_offset(0);
|
((__global uint *)output)[outIdx] = BranchBuf[idx] + (uint)get_global_offset(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -886,7 +895,7 @@ __kernel void JH(__global ulong *states, __global uint *BranchBuf, __global uint
|
|||||||
|
|
||||||
__kernel void Blake(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
__kernel void Blake(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
||||||
{
|
{
|
||||||
const uint idx = get_global_id(0) - get_global_offset(0);
|
const uint idx = getIdx();
|
||||||
|
|
||||||
// do not use early return here
|
// do not use early return here
|
||||||
if (idx < BranchBuf[Threads]) {
|
if (idx < BranchBuf[Threads]) {
|
||||||
@@ -973,9 +982,9 @@ __kernel void Blake(__global ulong *states, __global uint *BranchBuf, __global u
|
|||||||
// and expect an accurate result for target > 32-bit without implementing carries
|
// and expect an accurate result for target > 32-bit without implementing carries
|
||||||
uint2 t = (uint2)(h[6],h[7]);
|
uint2 t = (uint2)(h[6],h[7]);
|
||||||
if (as_ulong(t) <= Target) {
|
if (as_ulong(t) <= Target) {
|
||||||
ulong outIdx = atomic_inc(output + 0xFF);
|
const uint outIdx = atomic_inc(output + 0xFF);
|
||||||
if (outIdx < 0xFF) {
|
if (outIdx < 0xFF) {
|
||||||
output[outIdx] = BranchBuf[idx] + (uint) get_global_offset(0);
|
((__global uint *)output)[outIdx] = BranchBuf[idx] + (uint)get_global_offset(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -987,7 +996,7 @@ __kernel void Blake(__global ulong *states, __global uint *BranchBuf, __global u
|
|||||||
|
|
||||||
__kernel void Groestl(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
__kernel void Groestl(__global ulong *states, __global uint *BranchBuf, __global uint *output, ulong Target, uint Threads)
|
||||||
{
|
{
|
||||||
const uint idx = get_global_id(0) - get_global_offset(0);
|
const uint idx = getIdx();
|
||||||
|
|
||||||
// do not use early return here
|
// do not use early return here
|
||||||
if (idx < BranchBuf[Threads]) {
|
if (idx < BranchBuf[Threads]) {
|
||||||
@@ -1073,9 +1082,9 @@ __kernel void Groestl(__global ulong *states, __global uint *BranchBuf, __global
|
|||||||
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
// Note that comparison is equivalent to subtraction - we can't just compare 8 32-bit values
|
||||||
// and expect an accurate result for target > 32-bit without implementing carries
|
// and expect an accurate result for target > 32-bit without implementing carries
|
||||||
if (State[7] <= Target) {
|
if (State[7] <= Target) {
|
||||||
ulong outIdx = atomic_inc(output + 0xFF);
|
const uint outIdx = atomic_inc(output + 0xFF);
|
||||||
if (outIdx < 0xFF) {
|
if (outIdx < 0xFF) {
|
||||||
output[outIdx] = BranchBuf[idx] + (uint) get_global_offset(0);
|
((__global uint *)output)[outIdx] = BranchBuf[idx] + (uint)get_global_offset(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
static const char cryptonight_r_defines_cl[7709] = {
|
static const char cryptonight_r_defines_cl[7703] = {
|
||||||
0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x5f,0x5f,0x4e,0x56,0x5f,0x43,0x4c,0x5f,0x43,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
|
0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x5f,0x5f,0x4e,0x56,0x5f,0x43,0x4c,0x5f,0x43,0x5f,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,
|
||||||
0x20,0x53,0x43,0x52,0x41,0x54,0x43,0x48,0x50,0x41,0x44,0x5f,0x43,0x48,0x55,0x4e,0x4b,0x28,0x4e,0x29,0x20,0x28,0x2a,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,
|
0x20,0x53,0x43,0x52,0x41,0x54,0x43,0x48,0x50,0x41,0x44,0x5f,0x43,0x48,0x55,0x4e,0x4b,0x28,0x4e,0x29,0x20,0x28,0x2a,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,
|
||||||
0x75,0x69,0x6e,0x74,0x34,0x2a,0x29,0x28,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x63,0x68,0x61,0x72,0x2a,0x29,0x28,0x73,0x63,0x72,0x61,0x74,0x63,0x68,
|
0x75,0x69,0x6e,0x74,0x34,0x2a,0x29,0x28,0x28,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x63,0x68,0x61,0x72,0x2a,0x29,0x28,0x73,0x63,0x72,0x61,0x74,0x63,0x68,
|
||||||
@@ -26,17 +26,17 @@ static const char cryptonight_r_defines_cl[7709] = {
|
|||||||
0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x4f,0x54,0x5f,0x42,0x49,0x54,0x53,0x20,0x33,0x32,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x4d,0x45,0x4d,0x5f,
|
0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x52,0x4f,0x54,0x5f,0x42,0x49,0x54,0x53,0x20,0x33,0x32,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x4d,0x45,0x4d,0x5f,
|
||||||
0x43,0x48,0x55,0x4e,0x4b,0x20,0x28,0x31,0x20,0x3c,0x3c,0x20,0x4d,0x45,0x4d,0x5f,0x43,0x48,0x55,0x4e,0x4b,0x5f,0x45,0x58,0x50,0x4f,0x4e,0x45,0x4e,0x54,0x29,0x0a,
|
0x43,0x48,0x55,0x4e,0x4b,0x20,0x28,0x31,0x20,0x3c,0x3c,0x20,0x4d,0x45,0x4d,0x5f,0x43,0x48,0x55,0x4e,0x4b,0x5f,0x45,0x58,0x50,0x4f,0x4e,0x45,0x4e,0x54,0x29,0x0a,
|
||||||
0x23,0x69,0x66,0x6e,0x64,0x65,0x66,0x20,0x57,0x4f,0x4c,0x46,0x5f,0x41,0x45,0x53,0x5f,0x43,0x4c,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x57,0x4f,0x4c,0x46,
|
0x23,0x69,0x66,0x6e,0x64,0x65,0x66,0x20,0x57,0x4f,0x4c,0x46,0x5f,0x41,0x45,0x53,0x5f,0x43,0x4c,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x57,0x4f,0x4c,0x46,
|
||||||
0x5f,0x41,0x45,0x53,0x5f,0x43,0x4c,0x0a,0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x32,
|
0x5f,0x41,0x45,0x53,0x5f,0x43,0x4c,0x0a,0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x0a,0x23,0x75,0x6e,0x64,0x65,0x66,0x20,0x53,0x54,0x41,
|
||||||
0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,0x4e,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,
|
0x54,0x49,0x43,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,
|
||||||
0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x32,0x20,0x3a,0x20,0x65,0x6e,0x61,0x62,0x6c,0x65,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x78,0x6d,0x72,
|
0x70,0x73,0x32,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53,0x54,0x41,0x54,0x49,0x43,0x20,0x73,0x74,0x61,0x74,0x69,0x63,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,
|
||||||
0x69,0x67,0x5f,0x61,0x6d,0x64,0x5f,0x62,0x66,0x65,0x28,0x73,0x72,0x63,0x30,0x2c,0x20,0x73,0x72,0x63,0x31,0x2c,0x20,0x73,0x72,0x63,0x32,0x29,0x20,0x61,0x6d,0x64,
|
0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,0x4e,0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,
|
||||||
0x5f,0x62,0x66,0x65,0x28,0x73,0x72,0x63,0x30,0x2c,0x20,0x73,0x72,0x63,0x31,0x2c,0x20,0x73,0x72,0x63,0x32,0x29,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,0x69,0x6e,0x6c,
|
0x6f,0x70,0x73,0x32,0x20,0x3a,0x20,0x65,0x6e,0x61,0x62,0x6c,0x65,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53,0x54,0x41,0x54,
|
||||||
0x69,0x6e,0x65,0x20,0x69,0x6e,0x74,0x20,0x78,0x6d,0x72,0x69,0x67,0x5f,0x61,0x6d,0x64,0x5f,0x62,0x66,0x65,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
0x49,0x43,0x0a,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x69,0x6e,0x74,0x20,0x61,0x6d,0x64,0x5f,0x62,0x66,0x65,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x20,0x73,0x72,0x63,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
0x20,0x73,0x72,0x63,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x6f,0x66,0x66,0x73,0x65,0x74,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,
|
||||||
0x6e,0x74,0x20,0x77,0x69,0x64,0x74,0x68,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x28,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x77,0x69,0x64,0x74,0x68,0x29,0x3c,0x33,0x32,
|
0x6e,0x74,0x20,0x77,0x69,0x64,0x74,0x68,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x28,0x6f,0x66,0x66,0x73,0x65,0x74,0x2b,0x77,0x69,0x64,0x74,0x68,0x29,0x3c,0x33,0x32,
|
||||||
0x75,0x29,0x20,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x73,0x72,0x63,0x30,0x3c,0x3c,0x28,0x33,0x32,0x75,0x2d,0x6f,0x66,0x66,0x73,0x65,0x74,0x2d,0x77,
|
0x75,0x29,0x20,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x73,0x72,0x63,0x30,0x3c,0x3c,0x28,0x33,0x32,0x75,0x2d,0x6f,0x66,0x66,0x73,0x65,0x74,0x2d,0x77,
|
||||||
0x69,0x64,0x74,0x68,0x29,0x29,0x3e,0x3e,0x28,0x33,0x32,0x75,0x2d,0x77,0x69,0x64,0x74,0x68,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x72,
|
0x69,0x64,0x74,0x68,0x29,0x29,0x3e,0x3e,0x28,0x33,0x32,0x75,0x2d,0x77,0x69,0x64,0x74,0x68,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x72,
|
||||||
0x63,0x30,0x3e,0x3e,0x6f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x63,0x6f,0x6e,0x73,
|
0x63,0x30,0x3e,0x3e,0x6f,0x66,0x66,0x73,0x65,0x74,0x3b,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x53,0x54,0x41,0x54,0x49,0x43,0x20,0x63,0x6f,0x6e,0x73,
|
||||||
0x74,0x20,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x41,0x45,0x53,0x30,0x5f,0x43,0x5b,0x32,0x35,0x36,0x5d,0x20,0x3d,0x0a,
|
0x74,0x20,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x41,0x45,0x53,0x30,0x5f,0x43,0x5b,0x32,0x35,0x36,0x5d,0x20,0x3d,0x0a,
|
||||||
0x7b,0x0a,0x30,0x78,0x41,0x35,0x36,0x33,0x36,0x33,0x43,0x36,0x55,0x2c,0x30,0x78,0x38,0x34,0x37,0x43,0x37,0x43,0x46,0x38,0x55,0x2c,0x30,0x78,0x39,0x39,0x37,0x37,
|
0x7b,0x0a,0x30,0x78,0x41,0x35,0x36,0x33,0x36,0x33,0x43,0x36,0x55,0x2c,0x30,0x78,0x38,0x34,0x37,0x43,0x37,0x43,0x46,0x38,0x55,0x2c,0x30,0x78,0x39,0x39,0x37,0x37,
|
||||||
0x37,0x37,0x45,0x45,0x55,0x2c,0x30,0x78,0x38,0x44,0x37,0x42,0x37,0x42,0x46,0x36,0x55,0x2c,0x0a,0x30,0x78,0x30,0x44,0x46,0x32,0x46,0x32,0x46,0x46,0x55,0x2c,0x30,
|
0x37,0x37,0x45,0x45,0x55,0x2c,0x30,0x78,0x38,0x44,0x37,0x42,0x37,0x42,0x46,0x36,0x55,0x2c,0x0a,0x30,0x78,0x30,0x44,0x46,0x32,0x46,0x32,0x46,0x46,0x55,0x2c,0x30,
|
||||||
@@ -136,114 +136,114 @@ static const char cryptonight_r_defines_cl[7709] = {
|
|||||||
0x30,0x78,0x43,0x33,0x34,0x31,0x34,0x31,0x38,0x32,0x55,0x2c,0x30,0x78,0x42,0x30,0x39,0x39,0x39,0x39,0x32,0x39,0x55,0x2c,0x30,0x78,0x37,0x37,0x32,0x44,0x32,0x44,
|
0x30,0x78,0x43,0x33,0x34,0x31,0x34,0x31,0x38,0x32,0x55,0x2c,0x30,0x78,0x42,0x30,0x39,0x39,0x39,0x39,0x32,0x39,0x55,0x2c,0x30,0x78,0x37,0x37,0x32,0x44,0x32,0x44,
|
||||||
0x35,0x41,0x55,0x2c,0x30,0x78,0x31,0x31,0x30,0x46,0x30,0x46,0x31,0x45,0x55,0x2c,0x0a,0x30,0x78,0x43,0x42,0x42,0x30,0x42,0x30,0x37,0x42,0x55,0x2c,0x30,0x78,0x46,
|
0x35,0x41,0x55,0x2c,0x30,0x78,0x31,0x31,0x30,0x46,0x30,0x46,0x31,0x45,0x55,0x2c,0x0a,0x30,0x78,0x43,0x42,0x42,0x30,0x42,0x30,0x37,0x42,0x55,0x2c,0x30,0x78,0x46,
|
||||||
0x43,0x35,0x34,0x35,0x34,0x41,0x38,0x55,0x2c,0x30,0x78,0x44,0x36,0x42,0x42,0x42,0x42,0x36,0x44,0x55,0x2c,0x30,0x78,0x33,0x41,0x31,0x36,0x31,0x36,0x32,0x43,0x55,
|
0x43,0x35,0x34,0x35,0x34,0x41,0x38,0x55,0x2c,0x30,0x78,0x44,0x36,0x42,0x42,0x42,0x42,0x36,0x44,0x55,0x2c,0x30,0x78,0x33,0x41,0x31,0x36,0x31,0x36,0x32,0x43,0x55,
|
||||||
0x0a,0x7d,0x3b,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x42,0x59,0x54,0x45,0x28,0x78,0x2c,0x20,0x79,0x29,0x20,0x28,0x78,0x6d,0x72,0x69,0x67,0x5f,0x61,0x6d,
|
0x0a,0x7d,0x3b,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x42,0x59,0x54,0x45,0x28,0x78,0x2c,0x20,0x79,0x29,0x20,0x28,0x61,0x6d,0x64,0x5f,0x62,0x66,0x65,0x28,
|
||||||
0x64,0x5f,0x62,0x66,0x65,0x28,0x28,0x78,0x29,0x2c,0x20,0x28,0x79,0x29,0x20,0x3c,0x3c,0x20,0x33,0x55,0x2c,0x20,0x38,0x55,0x29,0x29,0x0a,0x23,0x69,0x66,0x20,0x28,
|
0x28,0x78,0x29,0x2c,0x20,0x28,0x79,0x29,0x20,0x3c,0x3c,0x20,0x33,0x55,0x2c,0x20,0x38,0x55,0x29,0x29,0x0a,0x23,0x69,0x66,0x20,0x28,0x41,0x4c,0x47,0x4f,0x20,0x3d,
|
||||||
0x41,0x4c,0x47,0x4f,0x20,0x3d,0x3d,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x48,0x45,0x41,0x56,0x59,0x5f,0x54,0x55,0x42,0x45,0x29,0x0a,0x69,0x6e,0x6c,0x69,
|
0x3d,0x20,0x41,0x4c,0x47,0x4f,0x5f,0x43,0x4e,0x5f,0x48,0x45,0x41,0x56,0x59,0x5f,0x54,0x55,0x42,0x45,0x29,0x0a,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x75,0x69,0x6e,
|
||||||
0x6e,0x65,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x5f,0x62,0x69,0x74,0x74,0x75,0x62,0x65,0x32,0x28,0x63,0x6f,0x6e,0x73,
|
0x74,0x34,0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x5f,0x62,0x69,0x74,0x74,0x75,0x62,0x65,0x32,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,
|
||||||
0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,
|
0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,
|
||||||
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x31,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x78,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6b,0x29,0x0a,0x7b,
|
0x74,0x20,0x2a,0x41,0x45,0x53,0x31,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x78,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6b,0x29,0x0a,0x7b,0x0a,0x78,0x3d,0x7e,0x78,0x3b,
|
||||||
0x0a,0x78,0x3d,0x7e,0x78,0x3b,0x0a,0x6b,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x30,0x29,
|
0x0a,0x6b,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,
|
||||||
0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,
|
0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,
|
||||||
0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x33,0x29,
|
0x78,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,
|
||||||
0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x78,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x6b,0x2e,0x73,0x30,0x3b,0x0a,0x6b,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,
|
0x3b,0x0a,0x78,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x6b,0x2e,0x73,0x30,0x3b,0x0a,0x6b,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,
|
||||||
0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,
|
0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,
|
||||||
0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,
|
0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,
|
||||||
0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x78,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x6b,
|
0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x78,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x6b,0x2e,0x73,0x31,0x3b,0x0a,0x6b,
|
||||||
0x2e,0x73,0x31,0x3b,0x0a,0x6b,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,0x30,0x29,0x5d,0x5e,
|
0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,
|
||||||
0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,
|
0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,
|
||||||
0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x33,0x29,0x5d,0x2c,
|
0x73,0x30,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,
|
||||||
0x31,0x36,0x55,0x29,0x3b,0x0a,0x78,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x6b,0x2e,0x73,0x32,0x3b,0x0a,0x6b,0x2e,0x73,0x33,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,
|
0x78,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x6b,0x2e,0x73,0x32,0x3b,0x0a,0x6b,0x2e,0x73,0x33,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,
|
||||||
0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x31,0x29,
|
0x78,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x30,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,
|
||||||
0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,
|
0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,
|
||||||
0x5b,0x42,0x59,0x54,0x45,0x28,0x78,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x3b,0x0a,0x7d,
|
0x78,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x3b,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,
|
||||||
0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,
|
0x66,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,
|
||||||
0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,
|
0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,
|
||||||
0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x31,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,
|
0x45,0x53,0x31,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x32,0x2c,0x63,0x6f,0x6e,
|
||||||
0x53,0x32,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x33,0x2c,0x63,0x6f,0x6e,0x73,
|
0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x33,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x74,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x58,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6b,0x65,0x79,0x29,0x0a,0x7b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x30,0x20,0x5e,0x3d,
|
0x34,0x20,0x58,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6b,0x65,0x79,0x29,0x0a,0x7b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,
|
||||||
0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,
|
0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x31,0x29,0x5d,
|
||||||
0x73,0x31,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,
|
0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,
|
||||||
0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,
|
0x73,0x33,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,
|
||||||
0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,
|
0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,
|
||||||
0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,
|
0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x6b,
|
||||||
0x33,0x29,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x30,0x29,
|
0x65,0x79,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,
|
||||||
0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,
|
0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x32,0x29,
|
||||||
0x2e,0x73,0x30,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x2e,
|
0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x33,0x20,0x5e,0x3d,0x20,
|
||||||
0x73,0x33,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,
|
0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,
|
||||||
0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,
|
0x30,0x2c,0x31,0x29,0x5d,0x5e,0x41,0x45,0x53,0x32,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x33,0x5b,0x42,0x59,
|
||||||
0x45,0x53,0x33,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x3b,0x0a,0x7d,
|
0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x3b,0x0a,0x7d,0x0a,0x75,0x69,0x6e,0x74,0x34,
|
||||||
0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x5f,0x54,0x77,0x6f,0x5f,0x54,0x61,0x62,0x6c,0x65,0x73,0x28,0x63,0x6f,0x6e,0x73,
|
0x20,0x41,0x45,0x53,0x5f,0x52,0x6f,0x75,0x6e,0x64,0x5f,0x54,0x77,0x6f,0x5f,0x54,0x61,0x62,0x6c,0x65,0x73,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,
|
||||||
0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,
|
0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x30,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x6c,0x6f,0x63,0x61,0x6c,0x20,0x75,0x69,0x6e,
|
||||||
0x61,0x6c,0x20,0x75,0x69,0x6e,0x74,0x20,0x2a,0x41,0x45,0x53,0x31,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x58,0x2c,0x75,0x69,0x6e,0x74,
|
0x74,0x20,0x2a,0x41,0x45,0x53,0x31,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x58,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6b,0x65,0x79,0x29,
|
||||||
0x34,0x20,0x6b,0x65,0x79,0x29,0x0a,0x7b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,
|
0x0a,0x7b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x30,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x30,0x29,0x5d,0x5e,
|
||||||
0x30,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,
|
0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,
|
||||||
0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,
|
0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x33,0x29,0x5d,0x2c,
|
||||||
0x33,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,
|
0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x31,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x30,
|
||||||
0x58,0x2e,0x73,0x31,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,
|
0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,
|
||||||
0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,
|
0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x33,
|
||||||
0x58,0x2e,0x73,0x30,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,
|
0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x32,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,
|
||||||
0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x72,
|
0x32,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,
|
||||||
0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,
|
0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,
|
||||||
0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x33,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,
|
0x31,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x6b,0x65,0x79,0x2e,0x73,0x33,0x20,0x5e,0x3d,0x20,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,
|
||||||
0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x31,0x29,
|
0x58,0x2e,0x73,0x33,0x2c,0x30,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x30,0x2c,0x31,0x29,0x5d,0x5e,0x72,0x6f,0x74,0x61,
|
||||||
0x5d,0x5e,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,
|
0x74,0x65,0x28,0x41,0x45,0x53,0x30,0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x31,0x2c,0x32,0x29,0x5d,0x5e,0x41,0x45,0x53,0x31,0x5b,0x42,0x59,0x54,0x45,0x28,
|
||||||
0x5b,0x42,0x59,0x54,0x45,0x28,0x58,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x3b,
|
0x58,0x2e,0x73,0x32,0x2c,0x33,0x29,0x5d,0x2c,0x31,0x36,0x55,0x29,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6b,0x65,0x79,0x3b,0x0a,0x7d,0x0a,0x53,0x54,0x41,
|
||||||
0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x63,0x68,0x61,0x72,
|
0x54,0x49,0x43,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x72,0x63,0x6f,0x6e,0x5b,
|
||||||
0x20,0x72,0x63,0x6f,0x6e,0x5b,0x38,0x5d,0x3d,0x7b,0x20,0x30,0x78,0x38,0x64,0x2c,0x30,0x78,0x30,0x31,0x2c,0x30,0x78,0x30,0x32,0x2c,0x30,0x78,0x30,0x34,0x2c,0x30,
|
0x38,0x5d,0x3d,0x7b,0x20,0x30,0x78,0x38,0x64,0x2c,0x30,0x78,0x30,0x31,0x2c,0x30,0x78,0x30,0x32,0x2c,0x30,0x78,0x30,0x34,0x2c,0x30,0x78,0x30,0x38,0x2c,0x30,0x78,
|
||||||
0x78,0x30,0x38,0x2c,0x30,0x78,0x31,0x30,0x2c,0x30,0x78,0x32,0x30,0x2c,0x30,0x78,0x34,0x30,0x20,0x7d,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x63,0x6f,0x6e,
|
0x31,0x30,0x2c,0x30,0x78,0x32,0x30,0x2c,0x30,0x78,0x34,0x30,0x20,0x7d,0x3b,0x0a,0x53,0x54,0x41,0x54,0x49,0x43,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x5f,0x5f,0x63,
|
||||||
0x73,0x74,0x20,0x5f,0x5f,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x73,0x62,0x6f,0x78,0x5b,0x32,0x35,0x36,0x5d,0x20,0x3d,0x0a,
|
0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x75,0x63,0x68,0x61,0x72,0x20,0x73,0x62,0x6f,0x78,0x5b,0x32,0x35,0x36,0x5d,0x20,0x3d,0x0a,0x7b,0x0a,0x30,0x78,0x36,0x33,
|
||||||
0x7b,0x0a,0x30,0x78,0x36,0x33,0x2c,0x30,0x78,0x37,0x43,0x2c,0x30,0x78,0x37,0x37,0x2c,0x30,0x78,0x37,0x42,0x2c,0x30,0x78,0x46,0x32,0x2c,0x30,0x78,0x36,0x42,0x2c,
|
0x2c,0x30,0x78,0x37,0x43,0x2c,0x30,0x78,0x37,0x37,0x2c,0x30,0x78,0x37,0x42,0x2c,0x30,0x78,0x46,0x32,0x2c,0x30,0x78,0x36,0x42,0x2c,0x30,0x78,0x36,0x46,0x2c,0x30,
|
||||||
0x30,0x78,0x36,0x46,0x2c,0x30,0x78,0x43,0x35,0x2c,0x30,0x78,0x33,0x30,0x2c,0x30,0x78,0x30,0x31,0x2c,0x30,0x78,0x36,0x37,0x2c,0x30,0x78,0x32,0x42,0x2c,0x30,0x78,
|
0x78,0x43,0x35,0x2c,0x30,0x78,0x33,0x30,0x2c,0x30,0x78,0x30,0x31,0x2c,0x30,0x78,0x36,0x37,0x2c,0x30,0x78,0x32,0x42,0x2c,0x30,0x78,0x46,0x45,0x2c,0x30,0x78,0x44,
|
||||||
0x46,0x45,0x2c,0x30,0x78,0x44,0x37,0x2c,0x30,0x78,0x41,0x42,0x2c,0x30,0x78,0x37,0x36,0x2c,0x0a,0x30,0x78,0x43,0x41,0x2c,0x30,0x78,0x38,0x32,0x2c,0x30,0x78,0x43,
|
0x37,0x2c,0x30,0x78,0x41,0x42,0x2c,0x30,0x78,0x37,0x36,0x2c,0x0a,0x30,0x78,0x43,0x41,0x2c,0x30,0x78,0x38,0x32,0x2c,0x30,0x78,0x43,0x39,0x2c,0x30,0x78,0x37,0x44,
|
||||||
0x39,0x2c,0x30,0x78,0x37,0x44,0x2c,0x30,0x78,0x46,0x41,0x2c,0x30,0x78,0x35,0x39,0x2c,0x30,0x78,0x34,0x37,0x2c,0x30,0x78,0x46,0x30,0x2c,0x30,0x78,0x41,0x44,0x2c,
|
0x2c,0x30,0x78,0x46,0x41,0x2c,0x30,0x78,0x35,0x39,0x2c,0x30,0x78,0x34,0x37,0x2c,0x30,0x78,0x46,0x30,0x2c,0x30,0x78,0x41,0x44,0x2c,0x30,0x78,0x44,0x34,0x2c,0x30,
|
||||||
0x30,0x78,0x44,0x34,0x2c,0x30,0x78,0x41,0x32,0x2c,0x30,0x78,0x41,0x46,0x2c,0x30,0x78,0x39,0x43,0x2c,0x30,0x78,0x41,0x34,0x2c,0x30,0x78,0x37,0x32,0x2c,0x30,0x78,
|
0x78,0x41,0x32,0x2c,0x30,0x78,0x41,0x46,0x2c,0x30,0x78,0x39,0x43,0x2c,0x30,0x78,0x41,0x34,0x2c,0x30,0x78,0x37,0x32,0x2c,0x30,0x78,0x43,0x30,0x2c,0x0a,0x30,0x78,
|
||||||
0x43,0x30,0x2c,0x0a,0x30,0x78,0x42,0x37,0x2c,0x30,0x78,0x46,0x44,0x2c,0x30,0x78,0x39,0x33,0x2c,0x30,0x78,0x32,0x36,0x2c,0x30,0x78,0x33,0x36,0x2c,0x30,0x78,0x33,
|
0x42,0x37,0x2c,0x30,0x78,0x46,0x44,0x2c,0x30,0x78,0x39,0x33,0x2c,0x30,0x78,0x32,0x36,0x2c,0x30,0x78,0x33,0x36,0x2c,0x30,0x78,0x33,0x46,0x2c,0x30,0x78,0x46,0x37,
|
||||||
0x46,0x2c,0x30,0x78,0x46,0x37,0x2c,0x30,0x78,0x43,0x43,0x2c,0x30,0x78,0x33,0x34,0x2c,0x30,0x78,0x41,0x35,0x2c,0x30,0x78,0x45,0x35,0x2c,0x30,0x78,0x46,0x31,0x2c,
|
0x2c,0x30,0x78,0x43,0x43,0x2c,0x30,0x78,0x33,0x34,0x2c,0x30,0x78,0x41,0x35,0x2c,0x30,0x78,0x45,0x35,0x2c,0x30,0x78,0x46,0x31,0x2c,0x30,0x78,0x37,0x31,0x2c,0x30,
|
||||||
0x30,0x78,0x37,0x31,0x2c,0x30,0x78,0x44,0x38,0x2c,0x30,0x78,0x33,0x31,0x2c,0x30,0x78,0x31,0x35,0x2c,0x0a,0x30,0x78,0x30,0x34,0x2c,0x30,0x78,0x43,0x37,0x2c,0x30,
|
0x78,0x44,0x38,0x2c,0x30,0x78,0x33,0x31,0x2c,0x30,0x78,0x31,0x35,0x2c,0x0a,0x30,0x78,0x30,0x34,0x2c,0x30,0x78,0x43,0x37,0x2c,0x30,0x78,0x32,0x33,0x2c,0x30,0x78,
|
||||||
0x78,0x32,0x33,0x2c,0x30,0x78,0x43,0x33,0x2c,0x30,0x78,0x31,0x38,0x2c,0x30,0x78,0x39,0x36,0x2c,0x30,0x78,0x30,0x35,0x2c,0x30,0x78,0x39,0x41,0x2c,0x30,0x78,0x30,
|
0x43,0x33,0x2c,0x30,0x78,0x31,0x38,0x2c,0x30,0x78,0x39,0x36,0x2c,0x30,0x78,0x30,0x35,0x2c,0x30,0x78,0x39,0x41,0x2c,0x30,0x78,0x30,0x37,0x2c,0x30,0x78,0x31,0x32,
|
||||||
0x37,0x2c,0x30,0x78,0x31,0x32,0x2c,0x30,0x78,0x38,0x30,0x2c,0x30,0x78,0x45,0x32,0x2c,0x30,0x78,0x45,0x42,0x2c,0x30,0x78,0x32,0x37,0x2c,0x30,0x78,0x42,0x32,0x2c,
|
0x2c,0x30,0x78,0x38,0x30,0x2c,0x30,0x78,0x45,0x32,0x2c,0x30,0x78,0x45,0x42,0x2c,0x30,0x78,0x32,0x37,0x2c,0x30,0x78,0x42,0x32,0x2c,0x30,0x78,0x37,0x35,0x2c,0x0a,
|
||||||
0x30,0x78,0x37,0x35,0x2c,0x0a,0x30,0x78,0x30,0x39,0x2c,0x30,0x78,0x38,0x33,0x2c,0x30,0x78,0x32,0x43,0x2c,0x30,0x78,0x31,0x41,0x2c,0x30,0x78,0x31,0x42,0x2c,0x30,
|
0x30,0x78,0x30,0x39,0x2c,0x30,0x78,0x38,0x33,0x2c,0x30,0x78,0x32,0x43,0x2c,0x30,0x78,0x31,0x41,0x2c,0x30,0x78,0x31,0x42,0x2c,0x30,0x78,0x36,0x45,0x2c,0x30,0x78,
|
||||||
0x78,0x36,0x45,0x2c,0x30,0x78,0x35,0x41,0x2c,0x30,0x78,0x41,0x30,0x2c,0x30,0x78,0x35,0x32,0x2c,0x30,0x78,0x33,0x42,0x2c,0x30,0x78,0x44,0x36,0x2c,0x30,0x78,0x42,
|
0x35,0x41,0x2c,0x30,0x78,0x41,0x30,0x2c,0x30,0x78,0x35,0x32,0x2c,0x30,0x78,0x33,0x42,0x2c,0x30,0x78,0x44,0x36,0x2c,0x30,0x78,0x42,0x33,0x2c,0x30,0x78,0x32,0x39,
|
||||||
0x33,0x2c,0x30,0x78,0x32,0x39,0x2c,0x30,0x78,0x45,0x33,0x2c,0x30,0x78,0x32,0x46,0x2c,0x30,0x78,0x38,0x34,0x2c,0x0a,0x30,0x78,0x35,0x33,0x2c,0x30,0x78,0x44,0x31,
|
0x2c,0x30,0x78,0x45,0x33,0x2c,0x30,0x78,0x32,0x46,0x2c,0x30,0x78,0x38,0x34,0x2c,0x0a,0x30,0x78,0x35,0x33,0x2c,0x30,0x78,0x44,0x31,0x2c,0x30,0x78,0x30,0x30,0x2c,
|
||||||
0x2c,0x30,0x78,0x30,0x30,0x2c,0x30,0x78,0x45,0x44,0x2c,0x30,0x78,0x32,0x30,0x2c,0x30,0x78,0x46,0x43,0x2c,0x30,0x78,0x42,0x31,0x2c,0x30,0x78,0x35,0x42,0x2c,0x30,
|
0x30,0x78,0x45,0x44,0x2c,0x30,0x78,0x32,0x30,0x2c,0x30,0x78,0x46,0x43,0x2c,0x30,0x78,0x42,0x31,0x2c,0x30,0x78,0x35,0x42,0x2c,0x30,0x78,0x36,0x41,0x2c,0x30,0x78,
|
||||||
0x78,0x36,0x41,0x2c,0x30,0x78,0x43,0x42,0x2c,0x30,0x78,0x42,0x45,0x2c,0x30,0x78,0x33,0x39,0x2c,0x30,0x78,0x34,0x41,0x2c,0x30,0x78,0x34,0x43,0x2c,0x30,0x78,0x35,
|
0x43,0x42,0x2c,0x30,0x78,0x42,0x45,0x2c,0x30,0x78,0x33,0x39,0x2c,0x30,0x78,0x34,0x41,0x2c,0x30,0x78,0x34,0x43,0x2c,0x30,0x78,0x35,0x38,0x2c,0x30,0x78,0x43,0x46,
|
||||||
0x38,0x2c,0x30,0x78,0x43,0x46,0x2c,0x0a,0x30,0x78,0x44,0x30,0x2c,0x30,0x78,0x45,0x46,0x2c,0x30,0x78,0x41,0x41,0x2c,0x30,0x78,0x46,0x42,0x2c,0x30,0x78,0x34,0x33,
|
0x2c,0x0a,0x30,0x78,0x44,0x30,0x2c,0x30,0x78,0x45,0x46,0x2c,0x30,0x78,0x41,0x41,0x2c,0x30,0x78,0x46,0x42,0x2c,0x30,0x78,0x34,0x33,0x2c,0x30,0x78,0x34,0x44,0x2c,
|
||||||
0x2c,0x30,0x78,0x34,0x44,0x2c,0x30,0x78,0x33,0x33,0x2c,0x30,0x78,0x38,0x35,0x2c,0x30,0x78,0x34,0x35,0x2c,0x30,0x78,0x46,0x39,0x2c,0x30,0x78,0x30,0x32,0x2c,0x30,
|
0x30,0x78,0x33,0x33,0x2c,0x30,0x78,0x38,0x35,0x2c,0x30,0x78,0x34,0x35,0x2c,0x30,0x78,0x46,0x39,0x2c,0x30,0x78,0x30,0x32,0x2c,0x30,0x78,0x37,0x46,0x2c,0x30,0x78,
|
||||||
0x78,0x37,0x46,0x2c,0x30,0x78,0x35,0x30,0x2c,0x30,0x78,0x33,0x43,0x2c,0x30,0x78,0x39,0x46,0x2c,0x30,0x78,0x41,0x38,0x2c,0x0a,0x30,0x78,0x35,0x31,0x2c,0x30,0x78,
|
0x35,0x30,0x2c,0x30,0x78,0x33,0x43,0x2c,0x30,0x78,0x39,0x46,0x2c,0x30,0x78,0x41,0x38,0x2c,0x0a,0x30,0x78,0x35,0x31,0x2c,0x30,0x78,0x41,0x33,0x2c,0x30,0x78,0x34,
|
||||||
0x41,0x33,0x2c,0x30,0x78,0x34,0x30,0x2c,0x30,0x78,0x38,0x46,0x2c,0x30,0x78,0x39,0x32,0x2c,0x30,0x78,0x39,0x44,0x2c,0x30,0x78,0x33,0x38,0x2c,0x30,0x78,0x46,0x35,
|
0x30,0x2c,0x30,0x78,0x38,0x46,0x2c,0x30,0x78,0x39,0x32,0x2c,0x30,0x78,0x39,0x44,0x2c,0x30,0x78,0x33,0x38,0x2c,0x30,0x78,0x46,0x35,0x2c,0x30,0x78,0x42,0x43,0x2c,
|
||||||
0x2c,0x30,0x78,0x42,0x43,0x2c,0x30,0x78,0x42,0x36,0x2c,0x30,0x78,0x44,0x41,0x2c,0x30,0x78,0x32,0x31,0x2c,0x30,0x78,0x31,0x30,0x2c,0x30,0x78,0x46,0x46,0x2c,0x30,
|
0x30,0x78,0x42,0x36,0x2c,0x30,0x78,0x44,0x41,0x2c,0x30,0x78,0x32,0x31,0x2c,0x30,0x78,0x31,0x30,0x2c,0x30,0x78,0x46,0x46,0x2c,0x30,0x78,0x46,0x33,0x2c,0x30,0x78,
|
||||||
0x78,0x46,0x33,0x2c,0x30,0x78,0x44,0x32,0x2c,0x0a,0x30,0x78,0x43,0x44,0x2c,0x30,0x78,0x30,0x43,0x2c,0x30,0x78,0x31,0x33,0x2c,0x30,0x78,0x45,0x43,0x2c,0x30,0x78,
|
0x44,0x32,0x2c,0x0a,0x30,0x78,0x43,0x44,0x2c,0x30,0x78,0x30,0x43,0x2c,0x30,0x78,0x31,0x33,0x2c,0x30,0x78,0x45,0x43,0x2c,0x30,0x78,0x35,0x46,0x2c,0x30,0x78,0x39,
|
||||||
0x35,0x46,0x2c,0x30,0x78,0x39,0x37,0x2c,0x30,0x78,0x34,0x34,0x2c,0x30,0x78,0x31,0x37,0x2c,0x30,0x78,0x43,0x34,0x2c,0x30,0x78,0x41,0x37,0x2c,0x30,0x78,0x37,0x45,
|
0x37,0x2c,0x30,0x78,0x34,0x34,0x2c,0x30,0x78,0x31,0x37,0x2c,0x30,0x78,0x43,0x34,0x2c,0x30,0x78,0x41,0x37,0x2c,0x30,0x78,0x37,0x45,0x2c,0x30,0x78,0x33,0x44,0x2c,
|
||||||
0x2c,0x30,0x78,0x33,0x44,0x2c,0x30,0x78,0x36,0x34,0x2c,0x30,0x78,0x35,0x44,0x2c,0x30,0x78,0x31,0x39,0x2c,0x30,0x78,0x37,0x33,0x2c,0x0a,0x30,0x78,0x36,0x30,0x2c,
|
0x30,0x78,0x36,0x34,0x2c,0x30,0x78,0x35,0x44,0x2c,0x30,0x78,0x31,0x39,0x2c,0x30,0x78,0x37,0x33,0x2c,0x0a,0x30,0x78,0x36,0x30,0x2c,0x30,0x78,0x38,0x31,0x2c,0x30,
|
||||||
0x30,0x78,0x38,0x31,0x2c,0x30,0x78,0x34,0x46,0x2c,0x30,0x78,0x44,0x43,0x2c,0x30,0x78,0x32,0x32,0x2c,0x30,0x78,0x32,0x41,0x2c,0x30,0x78,0x39,0x30,0x2c,0x30,0x78,
|
0x78,0x34,0x46,0x2c,0x30,0x78,0x44,0x43,0x2c,0x30,0x78,0x32,0x32,0x2c,0x30,0x78,0x32,0x41,0x2c,0x30,0x78,0x39,0x30,0x2c,0x30,0x78,0x38,0x38,0x2c,0x30,0x78,0x34,
|
||||||
0x38,0x38,0x2c,0x30,0x78,0x34,0x36,0x2c,0x30,0x78,0x45,0x45,0x2c,0x30,0x78,0x42,0x38,0x2c,0x30,0x78,0x31,0x34,0x2c,0x30,0x78,0x44,0x45,0x2c,0x30,0x78,0x35,0x45,
|
0x36,0x2c,0x30,0x78,0x45,0x45,0x2c,0x30,0x78,0x42,0x38,0x2c,0x30,0x78,0x31,0x34,0x2c,0x30,0x78,0x44,0x45,0x2c,0x30,0x78,0x35,0x45,0x2c,0x30,0x78,0x30,0x42,0x2c,
|
||||||
0x2c,0x30,0x78,0x30,0x42,0x2c,0x30,0x78,0x44,0x42,0x2c,0x0a,0x30,0x78,0x45,0x30,0x2c,0x30,0x78,0x33,0x32,0x2c,0x30,0x78,0x33,0x41,0x2c,0x30,0x78,0x30,0x41,0x2c,
|
0x30,0x78,0x44,0x42,0x2c,0x0a,0x30,0x78,0x45,0x30,0x2c,0x30,0x78,0x33,0x32,0x2c,0x30,0x78,0x33,0x41,0x2c,0x30,0x78,0x30,0x41,0x2c,0x30,0x78,0x34,0x39,0x2c,0x30,
|
||||||
0x30,0x78,0x34,0x39,0x2c,0x30,0x78,0x30,0x36,0x2c,0x30,0x78,0x32,0x34,0x2c,0x30,0x78,0x35,0x43,0x2c,0x30,0x78,0x43,0x32,0x2c,0x30,0x78,0x44,0x33,0x2c,0x30,0x78,
|
0x78,0x30,0x36,0x2c,0x30,0x78,0x32,0x34,0x2c,0x30,0x78,0x35,0x43,0x2c,0x30,0x78,0x43,0x32,0x2c,0x30,0x78,0x44,0x33,0x2c,0x30,0x78,0x41,0x43,0x2c,0x30,0x78,0x36,
|
||||||
0x41,0x43,0x2c,0x30,0x78,0x36,0x32,0x2c,0x30,0x78,0x39,0x31,0x2c,0x30,0x78,0x39,0x35,0x2c,0x30,0x78,0x45,0x34,0x2c,0x30,0x78,0x37,0x39,0x2c,0x0a,0x30,0x78,0x45,
|
0x32,0x2c,0x30,0x78,0x39,0x31,0x2c,0x30,0x78,0x39,0x35,0x2c,0x30,0x78,0x45,0x34,0x2c,0x30,0x78,0x37,0x39,0x2c,0x0a,0x30,0x78,0x45,0x37,0x2c,0x30,0x78,0x43,0x38,
|
||||||
0x37,0x2c,0x30,0x78,0x43,0x38,0x2c,0x30,0x78,0x33,0x37,0x2c,0x30,0x78,0x36,0x44,0x2c,0x30,0x78,0x38,0x44,0x2c,0x30,0x78,0x44,0x35,0x2c,0x30,0x78,0x34,0x45,0x2c,
|
0x2c,0x30,0x78,0x33,0x37,0x2c,0x30,0x78,0x36,0x44,0x2c,0x30,0x78,0x38,0x44,0x2c,0x30,0x78,0x44,0x35,0x2c,0x30,0x78,0x34,0x45,0x2c,0x30,0x78,0x41,0x39,0x2c,0x30,
|
||||||
0x30,0x78,0x41,0x39,0x2c,0x30,0x78,0x36,0x43,0x2c,0x30,0x78,0x35,0x36,0x2c,0x30,0x78,0x46,0x34,0x2c,0x30,0x78,0x45,0x41,0x2c,0x30,0x78,0x36,0x35,0x2c,0x30,0x78,
|
0x78,0x36,0x43,0x2c,0x30,0x78,0x35,0x36,0x2c,0x30,0x78,0x46,0x34,0x2c,0x30,0x78,0x45,0x41,0x2c,0x30,0x78,0x36,0x35,0x2c,0x30,0x78,0x37,0x41,0x2c,0x30,0x78,0x41,
|
||||||
0x37,0x41,0x2c,0x30,0x78,0x41,0x45,0x2c,0x30,0x78,0x30,0x38,0x2c,0x0a,0x30,0x78,0x42,0x41,0x2c,0x30,0x78,0x37,0x38,0x2c,0x30,0x78,0x32,0x35,0x2c,0x30,0x78,0x32,
|
0x45,0x2c,0x30,0x78,0x30,0x38,0x2c,0x0a,0x30,0x78,0x42,0x41,0x2c,0x30,0x78,0x37,0x38,0x2c,0x30,0x78,0x32,0x35,0x2c,0x30,0x78,0x32,0x45,0x2c,0x30,0x78,0x31,0x43,
|
||||||
0x45,0x2c,0x30,0x78,0x31,0x43,0x2c,0x30,0x78,0x41,0x36,0x2c,0x30,0x78,0x42,0x34,0x2c,0x30,0x78,0x43,0x36,0x2c,0x30,0x78,0x45,0x38,0x2c,0x30,0x78,0x44,0x44,0x2c,
|
0x2c,0x30,0x78,0x41,0x36,0x2c,0x30,0x78,0x42,0x34,0x2c,0x30,0x78,0x43,0x36,0x2c,0x30,0x78,0x45,0x38,0x2c,0x30,0x78,0x44,0x44,0x2c,0x30,0x78,0x37,0x34,0x2c,0x30,
|
||||||
0x30,0x78,0x37,0x34,0x2c,0x30,0x78,0x31,0x46,0x2c,0x30,0x78,0x34,0x42,0x2c,0x30,0x78,0x42,0x44,0x2c,0x30,0x78,0x38,0x42,0x2c,0x30,0x78,0x38,0x41,0x2c,0x0a,0x30,
|
0x78,0x31,0x46,0x2c,0x30,0x78,0x34,0x42,0x2c,0x30,0x78,0x42,0x44,0x2c,0x30,0x78,0x38,0x42,0x2c,0x30,0x78,0x38,0x41,0x2c,0x0a,0x30,0x78,0x37,0x30,0x2c,0x30,0x78,
|
||||||
0x78,0x37,0x30,0x2c,0x30,0x78,0x33,0x45,0x2c,0x30,0x78,0x42,0x35,0x2c,0x30,0x78,0x36,0x36,0x2c,0x30,0x78,0x34,0x38,0x2c,0x30,0x78,0x30,0x33,0x2c,0x30,0x78,0x46,
|
0x33,0x45,0x2c,0x30,0x78,0x42,0x35,0x2c,0x30,0x78,0x36,0x36,0x2c,0x30,0x78,0x34,0x38,0x2c,0x30,0x78,0x30,0x33,0x2c,0x30,0x78,0x46,0x36,0x2c,0x30,0x78,0x30,0x45,
|
||||||
0x36,0x2c,0x30,0x78,0x30,0x45,0x2c,0x30,0x78,0x36,0x31,0x2c,0x30,0x78,0x33,0x35,0x2c,0x30,0x78,0x35,0x37,0x2c,0x30,0x78,0x42,0x39,0x2c,0x30,0x78,0x38,0x36,0x2c,
|
0x2c,0x30,0x78,0x36,0x31,0x2c,0x30,0x78,0x33,0x35,0x2c,0x30,0x78,0x35,0x37,0x2c,0x30,0x78,0x42,0x39,0x2c,0x30,0x78,0x38,0x36,0x2c,0x30,0x78,0x43,0x31,0x2c,0x30,
|
||||||
0x30,0x78,0x43,0x31,0x2c,0x30,0x78,0x31,0x44,0x2c,0x30,0x78,0x39,0x45,0x2c,0x0a,0x30,0x78,0x45,0x31,0x2c,0x30,0x78,0x46,0x38,0x2c,0x30,0x78,0x39,0x38,0x2c,0x30,
|
0x78,0x31,0x44,0x2c,0x30,0x78,0x39,0x45,0x2c,0x0a,0x30,0x78,0x45,0x31,0x2c,0x30,0x78,0x46,0x38,0x2c,0x30,0x78,0x39,0x38,0x2c,0x30,0x78,0x31,0x31,0x2c,0x30,0x78,
|
||||||
0x78,0x31,0x31,0x2c,0x30,0x78,0x36,0x39,0x2c,0x30,0x78,0x44,0x39,0x2c,0x30,0x78,0x38,0x45,0x2c,0x30,0x78,0x39,0x34,0x2c,0x30,0x78,0x39,0x42,0x2c,0x30,0x78,0x31,
|
0x36,0x39,0x2c,0x30,0x78,0x44,0x39,0x2c,0x30,0x78,0x38,0x45,0x2c,0x30,0x78,0x39,0x34,0x2c,0x30,0x78,0x39,0x42,0x2c,0x30,0x78,0x31,0x45,0x2c,0x30,0x78,0x38,0x37,
|
||||||
0x45,0x2c,0x30,0x78,0x38,0x37,0x2c,0x30,0x78,0x45,0x39,0x2c,0x30,0x78,0x43,0x45,0x2c,0x30,0x78,0x35,0x35,0x2c,0x30,0x78,0x32,0x38,0x2c,0x30,0x78,0x44,0x46,0x2c,
|
0x2c,0x30,0x78,0x45,0x39,0x2c,0x30,0x78,0x43,0x45,0x2c,0x30,0x78,0x35,0x35,0x2c,0x30,0x78,0x32,0x38,0x2c,0x30,0x78,0x44,0x46,0x2c,0x0a,0x30,0x78,0x38,0x43,0x2c,
|
||||||
0x0a,0x30,0x78,0x38,0x43,0x2c,0x30,0x78,0x41,0x31,0x2c,0x30,0x78,0x38,0x39,0x2c,0x30,0x78,0x30,0x44,0x2c,0x30,0x78,0x42,0x46,0x2c,0x30,0x78,0x45,0x36,0x2c,0x30,
|
0x30,0x78,0x41,0x31,0x2c,0x30,0x78,0x38,0x39,0x2c,0x30,0x78,0x30,0x44,0x2c,0x30,0x78,0x42,0x46,0x2c,0x30,0x78,0x45,0x36,0x2c,0x30,0x78,0x34,0x32,0x2c,0x30,0x78,
|
||||||
0x78,0x34,0x32,0x2c,0x30,0x78,0x36,0x38,0x2c,0x30,0x78,0x34,0x31,0x2c,0x30,0x78,0x39,0x39,0x2c,0x30,0x78,0x32,0x44,0x2c,0x30,0x78,0x30,0x46,0x2c,0x30,0x78,0x42,
|
0x36,0x38,0x2c,0x30,0x78,0x34,0x31,0x2c,0x30,0x78,0x39,0x39,0x2c,0x30,0x78,0x32,0x44,0x2c,0x30,0x78,0x30,0x46,0x2c,0x30,0x78,0x42,0x30,0x2c,0x30,0x78,0x35,0x34,
|
||||||
0x30,0x2c,0x30,0x78,0x35,0x34,0x2c,0x30,0x78,0x42,0x42,0x2c,0x30,0x78,0x31,0x36,0x0a,0x7d,0x3b,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53,0x75,0x62,0x57,
|
0x2c,0x30,0x78,0x42,0x42,0x2c,0x30,0x78,0x31,0x36,0x0a,0x7d,0x3b,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x53,0x75,0x62,0x57,0x6f,0x72,0x64,0x28,0x69,0x6e,
|
||||||
0x6f,0x72,0x64,0x28,0x69,0x6e,0x77,0x29,0x20,0x28,0x28,0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x33,0x29,0x5d,0x20,0x3c,0x3c,
|
0x77,0x29,0x20,0x28,0x28,0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x33,0x29,0x5d,0x20,0x3c,0x3c,0x20,0x32,0x34,0x29,0x20,0x7c,
|
||||||
0x20,0x32,0x34,0x29,0x20,0x7c,0x20,0x28,0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x32,0x29,0x5d,0x20,0x3c,0x3c,0x20,0x31,0x36,
|
0x20,0x28,0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x32,0x29,0x5d,0x20,0x3c,0x3c,0x20,0x31,0x36,0x29,0x20,0x7c,0x20,0x28,0x73,
|
||||||
0x29,0x20,0x7c,0x20,0x28,0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x31,0x29,0x5d,0x20,0x3c,0x3c,0x20,0x38,0x29,0x20,0x7c,0x20,
|
0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x31,0x29,0x5d,0x20,0x3c,0x3c,0x20,0x38,0x29,0x20,0x7c,0x20,0x73,0x62,0x6f,0x78,0x5b,0x42,
|
||||||
0x73,0x62,0x6f,0x78,0x5b,0x42,0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x30,0x29,0x5d,0x29,0x0a,0x76,0x6f,0x69,0x64,0x20,0x41,0x45,0x53,0x45,0x78,0x70,0x61,
|
0x59,0x54,0x45,0x28,0x69,0x6e,0x77,0x2c,0x20,0x30,0x29,0x5d,0x29,0x0a,0x76,0x6f,0x69,0x64,0x20,0x41,0x45,0x53,0x45,0x78,0x70,0x61,0x6e,0x64,0x4b,0x65,0x79,0x32,
|
||||||
0x6e,0x64,0x4b,0x65,0x79,0x32,0x35,0x36,0x28,0x75,0x69,0x6e,0x74,0x20,0x2a,0x6b,0x65,0x79,0x62,0x75,0x66,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,
|
0x35,0x36,0x28,0x75,0x69,0x6e,0x74,0x20,0x2a,0x6b,0x65,0x79,0x62,0x75,0x66,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x63,0x3d,0x38,
|
||||||
0x6e,0x74,0x20,0x63,0x3d,0x38,0x2c,0x69,0x3d,0x31,0x3b,0x20,0x63,0x3c,0x34,0x30,0x3b,0x20,0x2b,0x2b,0x63,0x29,0x20,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x74,0x3d,
|
0x2c,0x69,0x3d,0x31,0x3b,0x20,0x63,0x3c,0x34,0x30,0x3b,0x20,0x2b,0x2b,0x63,0x29,0x20,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x74,0x3d,0x28,0x28,0x21,0x28,0x63,0x26,
|
||||||
0x28,0x28,0x21,0x28,0x63,0x26,0x37,0x29,0x29,0x7c,0x7c,0x28,0x28,0x63,0x26,0x37,0x29,0x3d,0x3d,0x34,0x29,0x29,0x3f,0x53,0x75,0x62,0x57,0x6f,0x72,0x64,0x28,0x6b,
|
0x37,0x29,0x29,0x7c,0x7c,0x28,0x28,0x63,0x26,0x37,0x29,0x3d,0x3d,0x34,0x29,0x29,0x3f,0x53,0x75,0x62,0x57,0x6f,0x72,0x64,0x28,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,
|
||||||
0x65,0x79,0x62,0x75,0x66,0x5b,0x63,0x2d,0x31,0x5d,0x29,0x3a,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,0x63,0x2d,0x31,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,
|
0x63,0x2d,0x31,0x5d,0x29,0x3a,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,0x63,0x2d,0x31,0x5d,0x3b,0x0a,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,0x63,0x5d,0x3d,0x6b,0x65,0x79,
|
||||||
0x63,0x5d,0x3d,0x6b,0x65,0x79,0x62,0x75,0x66,0x5b,0x63,0x2d,0x38,0x5d,0x5e,0x28,0x28,0x21,0x28,0x63,0x26,0x37,0x29,0x29,0x3f,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,
|
0x62,0x75,0x66,0x5b,0x63,0x2d,0x38,0x5d,0x5e,0x28,0x28,0x21,0x28,0x63,0x26,0x37,0x29,0x29,0x3f,0x72,0x6f,0x74,0x61,0x74,0x65,0x28,0x74,0x2c,0x32,0x34,0x55,0x29,
|
||||||
0x74,0x2c,0x32,0x34,0x55,0x29,0x5e,0x61,0x73,0x5f,0x75,0x69,0x6e,0x74,0x28,0x28,0x75,0x63,0x68,0x61,0x72,0x34,0x29,0x28,0x72,0x63,0x6f,0x6e,0x5b,0x69,0x2b,0x2b,
|
0x5e,0x61,0x73,0x5f,0x75,0x69,0x6e,0x74,0x28,0x28,0x75,0x63,0x68,0x61,0x72,0x34,0x29,0x28,0x72,0x63,0x6f,0x6e,0x5b,0x69,0x2b,0x2b,0x5d,0x2c,0x30,0x55,0x2c,0x30,
|
||||||
0x5d,0x2c,0x30,0x55,0x2c,0x30,0x55,0x2c,0x30,0x55,0x29,0x29,0x3a,0x74,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x00
|
0x55,0x2c,0x30,0x55,0x29,0x29,0x3a,0x74,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char cryptonight_r_cl[3424] = {
|
static const char cryptonight_r_cl[3424] = {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#define PC64(j, r) ((sph_u64)((j) + (r)))
|
#define PC64(j, r) ((sph_u64)((j) + (r)))
|
||||||
#define QC64(j, r) (((sph_u64)(r) << 56) ^ (~((sph_u64)(j) << 56)))
|
#define QC64(j, r) (((sph_u64)(r) << 56) ^ (~((sph_u64)(j) << 56)))
|
||||||
|
|
||||||
static const __constant ulong T0_G[] =
|
STATIC const __constant ulong T0_G[] =
|
||||||
{
|
{
|
||||||
0xc6a597f4a5f432c6UL, 0xf884eb9784976ff8UL, 0xee99c7b099b05eeeUL, 0xf68df78c8d8c7af6UL,
|
0xc6a597f4a5f432c6UL, 0xf884eb9784976ff8UL, 0xee99c7b099b05eeeUL, 0xf68df78c8d8c7af6UL,
|
||||||
0xff0de5170d17e8ffUL, 0xd6bdb7dcbddc0ad6UL, 0xdeb1a7c8b1c816deUL, 0x915439fc54fc6d91UL,
|
0xff0de5170d17e8ffUL, 0xd6bdb7dcbddc0ad6UL, 0xdeb1a7c8b1c816deUL, 0x915439fc54fc6d91UL,
|
||||||
@@ -123,7 +123,7 @@ static const __constant ulong T0_G[] =
|
|||||||
0x7bcbf646cb463d7bUL, 0xa8fc4b1ffc1fb7a8UL, 0x6dd6da61d6610c6dUL, 0x2c3a584e3a4e622cUL
|
0x7bcbf646cb463d7bUL, 0xa8fc4b1ffc1fb7a8UL, 0x6dd6da61d6610c6dUL, 0x2c3a584e3a4e622cUL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const __constant ulong T4_G[] =
|
STATIC const __constant ulong T4_G[] =
|
||||||
{
|
{
|
||||||
0xA5F432C6C6A597F4UL, 0x84976FF8F884EB97UL, 0x99B05EEEEE99C7B0UL, 0x8D8C7AF6F68DF78CUL,
|
0xA5F432C6C6A597F4UL, 0x84976FF8F884EB97UL, 0x99B05EEEEE99C7B0UL, 0x8D8C7AF6F68DF78CUL,
|
||||||
0x0D17E8FFFF0DE517UL, 0xBDDC0AD6D6BDB7DCUL, 0xB1C816DEDEB1A7C8UL, 0x54FC6D91915439FCUL,
|
0x0D17E8FFFF0DE517UL, 0xBDDC0AD6D6BDB7DCUL, 0xB1C816DEDEB1A7C8UL, 0x54FC6D91915439FCUL,
|
||||||
@@ -286,4 +286,3 @@ static const __constant ulong T4_G[] =
|
|||||||
for (int r = 0; r < 10; r ++) \
|
for (int r = 0; r < 10; r ++) \
|
||||||
ROUND_SMALL_Q(a, r); \
|
ROUND_SMALL_Q(a, r); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ typedef ulong sph_u64;
|
|||||||
x3 ^= x4; \
|
x3 ^= x4; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static const __constant ulong C[] =
|
STATIC const __constant ulong C[] =
|
||||||
{
|
{
|
||||||
0x67F815DFA2DED572UL, 0x571523B70A15847BUL, 0xF6875A4D90D6AB81UL, 0x402BD1C3C54F9F4EUL,
|
0x67F815DFA2DED572UL, 0x571523B70A15847BUL, 0xF6875A4D90D6AB81UL, 0x402BD1C3C54F9F4EUL,
|
||||||
0x9CFA455CE03A98EAUL, 0x9A99B26699D2C503UL, 0x8A53BBF2B4960266UL, 0x31A2DB881A1456B5UL,
|
0x9CFA455CE03A98EAUL, 0x9A99B26699D2C503UL, 0x8A53BBF2B4960266UL, 0x31A2DB881A1456B5UL,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define XMRIG_KECCAK_CL
|
#define XMRIG_KECCAK_CL
|
||||||
|
|
||||||
|
|
||||||
static const __constant ulong keccakf_rndc[24] =
|
STATIC const __constant ulong keccakf_rndc[24] =
|
||||||
{
|
{
|
||||||
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
|
0x0000000000000001, 0x0000000000008082, 0x800000000000808a,
|
||||||
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
|
0x8000000080008000, 0x000000000000808b, 0x0000000080000001,
|
||||||
@@ -15,14 +15,14 @@ static const __constant ulong keccakf_rndc[24] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const __constant uint keccakf_rotc[24] =
|
STATIC const __constant uint keccakf_rotc[24] =
|
||||||
{
|
{
|
||||||
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14,
|
1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 2, 14,
|
||||||
27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44
|
27, 41, 56, 8, 25, 43, 62, 18, 39, 61, 20, 44
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static const __constant uint keccakf_piln[24] =
|
STATIC const __constant uint keccakf_piln[24] =
|
||||||
{
|
{
|
||||||
10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4,
|
10, 7, 11, 17, 18, 3, 5, 16, 8, 21, 24, 4,
|
||||||
15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1
|
15, 23, 19, 13, 12, 2, 20, 14, 22, 9, 6, 1
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
#ifndef WOLF_AES_CL
|
#ifndef WOLF_AES_CL
|
||||||
#define WOLF_AES_CL
|
#define WOLF_AES_CL
|
||||||
|
|
||||||
|
#ifdef STATIC
|
||||||
|
# undef STATIC
|
||||||
|
#endif
|
||||||
#ifdef cl_amd_media_ops2
|
#ifdef cl_amd_media_ops2
|
||||||
|
# define STATIC static
|
||||||
# pragma OPENCL EXTENSION cl_amd_media_ops2 : enable
|
# pragma OPENCL EXTENSION cl_amd_media_ops2 : enable
|
||||||
|
|
||||||
# define xmrig_amd_bfe(src0, src1, src2) amd_bfe(src0, src1, src2)
|
|
||||||
#else
|
#else
|
||||||
|
# define STATIC
|
||||||
/* taken from: https://www.khronos.org/registry/OpenCL/extensions/amd/cl_amd_media_ops2.txt
|
/* taken from: https://www.khronos.org/registry/OpenCL/extensions/amd/cl_amd_media_ops2.txt
|
||||||
* Built-in Function:
|
* Built-in Function:
|
||||||
* uintn amd_bfe (uintn src0, uintn src1, uintn src2)
|
* uintn amd_bfe (uintn src0, uintn src1, uintn src2)
|
||||||
@@ -21,7 +24,7 @@
|
|||||||
* dst.s0 = src0.s0 >> offset;
|
* dst.s0 = src0.s0 >> offset;
|
||||||
* similar operation applied to other components of the vectors
|
* similar operation applied to other components of the vectors
|
||||||
*/
|
*/
|
||||||
inline int xmrig_amd_bfe(const uint src0, const uint offset, const uint width)
|
inline int amd_bfe(const uint src0, const uint offset, const uint width)
|
||||||
{
|
{
|
||||||
/* casts are removed because we can implement everything as uint
|
/* casts are removed because we can implement everything as uint
|
||||||
* int offset = src1;
|
* int offset = src1;
|
||||||
@@ -41,10 +44,9 @@ inline int xmrig_amd_bfe(const uint src0, const uint offset, const uint width)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// AES table - the other three are generated on the fly
|
// AES table - the other three are generated on the fly
|
||||||
|
|
||||||
static const __constant uint AES0_C[256] =
|
STATIC const __constant uint AES0_C[256] =
|
||||||
{
|
{
|
||||||
0xA56363C6U, 0x847C7CF8U, 0x997777EEU, 0x8D7B7BF6U,
|
0xA56363C6U, 0x847C7CF8U, 0x997777EEU, 0x8D7B7BF6U,
|
||||||
0x0DF2F2FFU, 0xBD6B6BD6U, 0xB16F6FDEU, 0x54C5C591U,
|
0x0DF2F2FFU, 0xBD6B6BD6U, 0xB16F6FDEU, 0x54C5C591U,
|
||||||
@@ -112,7 +114,7 @@ static const __constant uint AES0_C[256] =
|
|||||||
0xCBB0B07BU, 0xFC5454A8U, 0xD6BBBB6DU, 0x3A16162CU
|
0xCBB0B07BU, 0xFC5454A8U, 0xD6BBBB6DU, 0x3A16162CU
|
||||||
};
|
};
|
||||||
|
|
||||||
#define BYTE(x, y) (xmrig_amd_bfe((x), (y) << 3U, 8U))
|
#define BYTE(x, y) (amd_bfe((x), (y) << 3U, 8U))
|
||||||
|
|
||||||
#if (ALGO == ALGO_CN_HEAVY_TUBE)
|
#if (ALGO == ALGO_CN_HEAVY_TUBE)
|
||||||
inline uint4 AES_Round_bittube2(const __local uint *AES0, const __local uint *AES1, uint4 x, uint4 k)
|
inline uint4 AES_Round_bittube2(const __local uint *AES0, const __local uint *AES1, uint4 x, uint4 k)
|
||||||
@@ -150,10 +152,10 @@ uint4 AES_Round_Two_Tables(const __local uint *AES0, const __local uint *AES1, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static const __constant uchar rcon[8] = { 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40 };
|
STATIC const __constant uchar rcon[8] = { 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40 };
|
||||||
|
|
||||||
|
|
||||||
static const __constant uchar sbox[256] =
|
STATIC const __constant uchar sbox[256] =
|
||||||
{
|
{
|
||||||
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
|
0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
|
||||||
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
|
0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0,
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
#ifndef WOLF_SKEIN_CL
|
#ifndef WOLF_SKEIN_CL
|
||||||
#define WOLF_SKEIN_CL
|
#define WOLF_SKEIN_CL
|
||||||
|
|
||||||
|
#ifdef STATIC
|
||||||
|
# undef STATIC
|
||||||
|
#endif
|
||||||
#ifdef cl_amd_media_ops
|
#ifdef cl_amd_media_ops
|
||||||
|
# define STATIC static
|
||||||
# pragma OPENCL EXTENSION cl_amd_media_ops : enable
|
# pragma OPENCL EXTENSION cl_amd_media_ops : enable
|
||||||
# define xmrig_amd_bitalign(src0, src1, src2) amd_bitalign(src0, src1, src2)
|
|
||||||
#else
|
#else
|
||||||
|
# define STATIC
|
||||||
/* taken from https://www.khronos.org/registry/OpenCL/extensions/amd/cl_amd_media_ops.txt
|
/* taken from https://www.khronos.org/registry/OpenCL/extensions/amd/cl_amd_media_ops.txt
|
||||||
* Build-in Function
|
* Build-in Function
|
||||||
* uintn amd_bitalign (uintn src0, uintn src1, uintn src2)
|
* uintn amd_bitalign (uintn src0, uintn src1, uintn src2)
|
||||||
@@ -15,7 +19,7 @@
|
|||||||
* The implemented function is modified because the last is in our case always a scalar.
|
* The implemented function is modified because the last is in our case always a scalar.
|
||||||
* We can ignore the bitwise AND operation.
|
* We can ignore the bitwise AND operation.
|
||||||
*/
|
*/
|
||||||
inline uint2 xmrig_amd_bitalign(const uint2 src0, const uint2 src1, const uint src2)
|
inline uint2 amd_bitalign(const uint2 src0, const uint2 src1, const uint src2)
|
||||||
{
|
{
|
||||||
uint2 result;
|
uint2 result;
|
||||||
result.s0 = (uint) (((((long)src0.s0) << 32) | (long)src1.s0) >> (src2));
|
result.s0 = (uint) (((((long)src0.s0) << 32) | (long)src1.s0) >> (src2));
|
||||||
@@ -28,7 +32,7 @@ inline uint2 xmrig_amd_bitalign(const uint2 src0, const uint2 src1, const uint s
|
|||||||
|
|
||||||
#define SKEIN_KS_PARITY 0x1BD11BDAA9FC1A22
|
#define SKEIN_KS_PARITY 0x1BD11BDAA9FC1A22
|
||||||
|
|
||||||
static const __constant ulong SKEIN256_IV[8] =
|
STATIC const __constant ulong SKEIN256_IV[8] =
|
||||||
{
|
{
|
||||||
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
||||||
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
||||||
@@ -36,7 +40,7 @@ static const __constant ulong SKEIN256_IV[8] =
|
|||||||
0xC36FBAF9393AD185UL, 0x3EEDBA1833EDFC13UL
|
0xC36FBAF9393AD185UL, 0x3EEDBA1833EDFC13UL
|
||||||
};
|
};
|
||||||
|
|
||||||
static const __constant ulong SKEIN512_256_IV[8] =
|
STATIC const __constant ulong SKEIN512_256_IV[8] =
|
||||||
{
|
{
|
||||||
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
0xCCD044A12FDB3E13UL, 0xE83590301A79A9EBUL,
|
||||||
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
0x55AEA0614F816E6FUL, 0x2A2767A4AE9B94DBUL,
|
||||||
@@ -54,10 +58,10 @@ static const __constant ulong SKEIN512_256_IV[8] =
|
|||||||
ulong SKEIN_ROT(const uint2 x, const uint y)
|
ulong SKEIN_ROT(const uint2 x, const uint y)
|
||||||
{
|
{
|
||||||
if (y < 32) {
|
if (y < 32) {
|
||||||
return(as_ulong(xmrig_amd_bitalign(x, x.s10, 32 - y)));
|
return(as_ulong(amd_bitalign(x, x.s10, 32 - y)));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return(as_ulong(xmrig_amd_bitalign(x.s10, x, 32 - (y - 32))));
|
return(as_ulong(amd_bitalign(x.s10, x, 32 - (y - 32))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ static uint2 ROL2(const uint2 a, const int offset)
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#elif PLATFORM == OPENCL_PLATFORM_AMD
|
#elif defined(cl_amd_media_ops)
|
||||||
#pragma OPENCL EXTENSION cl_amd_media_ops : enable
|
#pragma OPENCL EXTENSION cl_amd_media_ops : enable
|
||||||
static uint2 ROL2(const uint2 vv, const int r)
|
static uint2 ROL2(const uint2 vv, const int r)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
static const char kawpow_dag_cl[6068] = {
|
static const char kawpow_dag_cl[6062] = {
|
||||||
0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x63,0x6c,0x61,0x6e,0x67,0x5f,0x73,0x74,0x6f,0x72,0x61,0x67,0x65,0x5f,0x63,0x6c,0x61,0x73,0x73,0x5f,0x73,0x70,
|
0x23,0x69,0x66,0x64,0x65,0x66,0x20,0x63,0x6c,0x5f,0x63,0x6c,0x61,0x6e,0x67,0x5f,0x73,0x74,0x6f,0x72,0x61,0x67,0x65,0x5f,0x63,0x6c,0x61,0x73,0x73,0x5f,0x73,0x70,
|
||||||
0x65,0x63,0x69,0x66,0x69,0x65,0x72,0x73,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,
|
0x65,0x63,0x69,0x66,0x69,0x65,0x72,0x73,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,
|
||||||
0x4e,0x20,0x63,0x6c,0x5f,0x63,0x6c,0x61,0x6e,0x67,0x5f,0x73,0x74,0x6f,0x72,0x61,0x67,0x65,0x5f,0x63,0x6c,0x61,0x73,0x73,0x5f,0x73,0x70,0x65,0x63,0x69,0x66,0x69,
|
0x4e,0x20,0x63,0x6c,0x5f,0x63,0x6c,0x61,0x6e,0x67,0x5f,0x73,0x74,0x6f,0x72,0x61,0x67,0x65,0x5f,0x63,0x6c,0x61,0x73,0x73,0x5f,0x73,0x70,0x65,0x63,0x69,0x66,0x69,
|
||||||
@@ -76,123 +76,123 @@ static const char kawpow_dag_cl[6068] = {
|
|||||||
0x6d,0x28,0x22,0x73,0x68,0x66,0x2e,0x6c,0x2e,0x77,0x72,0x61,0x70,0x2e,0x62,0x33,0x32,0x20,0x25,0x30,0x2c,0x25,0x31,0x2c,0x25,0x32,0x2c,0x25,0x33,0x3b,0x22,0x3a,
|
0x6d,0x28,0x22,0x73,0x68,0x66,0x2e,0x6c,0x2e,0x77,0x72,0x61,0x70,0x2e,0x62,0x33,0x32,0x20,0x25,0x30,0x2c,0x25,0x31,0x2c,0x25,0x32,0x2c,0x25,0x33,0x3b,0x22,0x3a,
|
||||||
0x22,0x3d,0x72,0x22,0x28,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x79,0x29,0x3a,0x22,0x72,0x22,0x28,0x61,0x2e,0x78,0x29,0x2c,0x22,0x72,0x22,0x28,0x61,0x2e,0x79,0x29,
|
0x22,0x3d,0x72,0x22,0x28,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x79,0x29,0x3a,0x22,0x72,0x22,0x28,0x61,0x2e,0x78,0x29,0x2c,0x22,0x72,0x22,0x28,0x61,0x2e,0x79,0x29,
|
||||||
0x2c,0x22,0x72,0x22,0x28,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,
|
0x2c,0x22,0x72,0x22,0x28,0x6f,0x66,0x66,0x73,0x65,0x74,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,
|
||||||
0x7d,0x0a,0x23,0x65,0x6c,0x69,0x66,0x20,0x50,0x4c,0x41,0x54,0x46,0x4f,0x52,0x4d,0x20,0x3d,0x3d,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x5f,0x50,0x4c,0x41,0x54,0x46,
|
0x7d,0x0a,0x23,0x65,0x6c,0x69,0x66,0x20,0x64,0x65,0x66,0x69,0x6e,0x65,0x64,0x28,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,
|
||||||
0x4f,0x52,0x4d,0x5f,0x41,0x4d,0x44,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,0x4e,
|
0x29,0x0a,0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x4f,0x50,0x45,0x4e,0x43,0x4c,0x20,0x45,0x58,0x54,0x45,0x4e,0x53,0x49,0x4f,0x4e,0x20,0x63,0x6c,0x5f,0x61,0x6d,
|
||||||
0x20,0x63,0x6c,0x5f,0x61,0x6d,0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x20,0x3a,0x20,0x65,0x6e,0x61,0x62,0x6c,0x65,0x0a,0x73,0x74,0x61,0x74,0x69,
|
0x64,0x5f,0x6d,0x65,0x64,0x69,0x61,0x5f,0x6f,0x70,0x73,0x20,0x3a,0x20,0x65,0x6e,0x61,0x62,0x6c,0x65,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,
|
||||||
0x63,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x52,0x4f,0x4c,0x32,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x76,0x76,0x2c,0x63,0x6f,0x6e,0x73,
|
0x32,0x20,0x52,0x4f,0x4c,0x32,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x76,0x76,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,
|
||||||
0x74,0x20,0x69,0x6e,0x74,0x20,0x72,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x72,0x3c,0x3d,0x33,0x32,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x6d,
|
0x72,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x72,0x3c,0x3d,0x33,0x32,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x6d,0x64,0x5f,0x62,0x69,0x74,0x61,
|
||||||
0x64,0x5f,0x62,0x69,0x74,0x61,0x6c,0x69,0x67,0x6e,0x28,0x28,0x76,0x76,0x29,0x2e,0x78,0x79,0x2c,0x28,0x76,0x76,0x29,0x2e,0x79,0x78,0x2c,0x33,0x32,0x2d,0x72,0x29,
|
0x6c,0x69,0x67,0x6e,0x28,0x28,0x76,0x76,0x29,0x2e,0x78,0x79,0x2c,0x28,0x76,0x76,0x29,0x2e,0x79,0x78,0x2c,0x33,0x32,0x2d,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x65,0x6c,
|
||||||
0x3b,0x0a,0x7d,0x0a,0x65,0x6c,0x73,0x65,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x6d,0x64,0x5f,0x62,0x69,0x74,0x61,0x6c,0x69,0x67,0x6e,0x28,0x28,
|
0x73,0x65,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x6d,0x64,0x5f,0x62,0x69,0x74,0x61,0x6c,0x69,0x67,0x6e,0x28,0x28,0x76,0x76,0x29,0x2e,0x79,0x78,
|
||||||
0x76,0x76,0x29,0x2e,0x79,0x78,0x2c,0x28,0x76,0x76,0x29,0x2e,0x78,0x79,0x2c,0x36,0x34,0x2d,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,
|
0x2c,0x28,0x76,0x76,0x29,0x2e,0x78,0x79,0x2c,0x36,0x34,0x2d,0x72,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x65,0x6c,0x73,0x65,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
|
||||||
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x52,0x4f,0x4c,0x32,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x76,0x2c,
|
0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x52,0x4f,0x4c,0x32,0x28,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x20,0x76,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,
|
||||||
0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x20,0x6e,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x69,0x66,0x28,
|
0x69,0x6e,0x74,0x20,0x6e,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x69,0x66,0x28,0x6e,0x3c,0x3d,0x33,0x32,0x29,
|
||||||
0x6e,0x3c,0x3d,0x33,0x32,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x79,0x3d,0x28,0x28,0x76,0x2e,0x79,0x3c,0x3c,0x28,0x6e,0x29,0x29,0x7c,0x28,0x76,
|
0x0a,0x7b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x79,0x3d,0x28,0x28,0x76,0x2e,0x79,0x3c,0x3c,0x28,0x6e,0x29,0x29,0x7c,0x28,0x76,0x2e,0x78,0x3e,0x3e,0x28,0x33,
|
||||||
0x2e,0x78,0x3e,0x3e,0x28,0x33,0x32,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x78,0x3d,0x28,0x28,0x76,0x2e,0x78,0x3c,0x3c,0x28,0x6e,
|
0x32,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x78,0x3d,0x28,0x28,0x76,0x2e,0x78,0x3c,0x3c,0x28,0x6e,0x29,0x29,0x7c,0x28,0x76,0x2e,
|
||||||
0x29,0x29,0x7c,0x28,0x76,0x2e,0x79,0x3e,0x3e,0x28,0x33,0x32,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x65,0x6c,0x73,0x65,0x0a,0x7b,0x0a,0x72,0x65,0x73,0x75,
|
0x79,0x3e,0x3e,0x28,0x33,0x32,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x65,0x6c,0x73,0x65,0x0a,0x7b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x79,0x3d,0x28,
|
||||||
0x6c,0x74,0x2e,0x79,0x3d,0x28,0x28,0x76,0x2e,0x78,0x3c,0x3c,0x28,0x6e,0x2d,0x33,0x32,0x29,0x29,0x7c,0x28,0x76,0x2e,0x79,0x3e,0x3e,0x28,0x36,0x34,0x2d,0x6e,0x29,
|
0x28,0x76,0x2e,0x78,0x3c,0x3c,0x28,0x6e,0x2d,0x33,0x32,0x29,0x29,0x7c,0x28,0x76,0x2e,0x79,0x3e,0x3e,0x28,0x36,0x34,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x72,0x65,
|
||||||
0x29,0x29,0x3b,0x0a,0x72,0x65,0x73,0x75,0x6c,0x74,0x2e,0x78,0x3d,0x28,0x28,0x76,0x2e,0x79,0x3c,0x3c,0x28,0x6e,0x2d,0x33,0x32,0x29,0x29,0x7c,0x28,0x76,0x2e,0x78,
|
0x73,0x75,0x6c,0x74,0x2e,0x78,0x3d,0x28,0x28,0x76,0x2e,0x79,0x3c,0x3c,0x28,0x6e,0x2d,0x33,0x32,0x29,0x29,0x7c,0x28,0x76,0x2e,0x78,0x3e,0x3e,0x28,0x36,0x34,0x2d,
|
||||||
0x3e,0x3e,0x28,0x36,0x34,0x2d,0x6e,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x7d,0x0a,0x23,
|
0x6e,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x7d,0x0a,0x23,0x65,0x6e,0x64,0x69,0x66,0x0a,
|
||||||
0x65,0x6e,0x64,0x69,0x66,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x63,0x68,0x69,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x63,
|
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x63,0x68,0x69,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,
|
||||||
0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x6e,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x74,0x29,0x0a,0x7b,0x0a,0x61,0x5b,
|
0x69,0x6e,0x74,0x20,0x6e,0x2c,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x74,0x29,0x0a,0x7b,0x0a,0x61,0x5b,0x6e,0x2b,0x30,0x5d,0x3d,0x62,
|
||||||
0x6e,0x2b,0x30,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x30,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x2c,0x74,0x5b,0x6e,
|
0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x30,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x30,0x5d,0x2c,0x74,0x5b,
|
||||||
0x2b,0x30,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x31,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,
|
0x6e,0x2b,0x31,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x31,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x5e,0x74,
|
||||||
0x6e,0x2b,0x31,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x33,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,
|
0x5b,0x6e,0x2b,0x33,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x32,0x5d,0x3d,0x62,0x69,0x74,
|
||||||
0x32,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x32,
|
0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x32,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,
|
||||||
0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x33,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x33,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,
|
0x33,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x33,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x33,0x5d,0x5e,0x74,0x5b,0x6e,
|
||||||
0x33,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x30,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x33,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x34,0x5d,
|
0x2b,0x30,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x33,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x29,0x3b,0x0a,0x61,0x5b,0x6e,0x2b,0x34,0x5d,0x3d,0x62,0x69,0x74,0x73,0x65,
|
||||||
0x3d,0x62,0x69,0x74,0x73,0x65,0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x2c,
|
0x6c,0x65,0x63,0x74,0x28,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x5e,0x74,0x5b,0x6e,0x2b,0x31,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x34,0x5d,0x2c,0x74,0x5b,0x6e,0x2b,0x30,0x5d,
|
||||||
0x74,0x5b,0x6e,0x2b,0x30,0x5d,0x29,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,
|
0x29,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x72,0x6f,
|
||||||
0x36,0x30,0x30,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x20,0x72,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,
|
0x75,0x6e,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x20,0x72,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x74,0x5b,0x32,
|
||||||
0x74,0x32,0x20,0x74,0x5b,0x32,0x35,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x3b,0x0a,0x74,0x5b,0x30,0x5d,0x3d,0x61,0x5b,0x30,0x5d,0x5e,0x61,0x5b,0x35,
|
0x35,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x3b,0x0a,0x74,0x5b,0x30,0x5d,0x3d,0x61,0x5b,0x30,0x5d,0x5e,0x61,0x5b,0x35,0x5d,0x5e,0x61,0x5b,0x31,0x30,
|
||||||
0x5d,0x5e,0x61,0x5b,0x31,0x30,0x5d,0x5e,0x61,0x5b,0x31,0x35,0x5d,0x5e,0x61,0x5b,0x32,0x30,0x5d,0x3b,0x0a,0x74,0x5b,0x31,0x5d,0x3d,0x61,0x5b,0x31,0x5d,0x5e,0x61,
|
0x5d,0x5e,0x61,0x5b,0x31,0x35,0x5d,0x5e,0x61,0x5b,0x32,0x30,0x5d,0x3b,0x0a,0x74,0x5b,0x31,0x5d,0x3d,0x61,0x5b,0x31,0x5d,0x5e,0x61,0x5b,0x36,0x5d,0x5e,0x61,0x5b,
|
||||||
0x5b,0x36,0x5d,0x5e,0x61,0x5b,0x31,0x31,0x5d,0x5e,0x61,0x5b,0x31,0x36,0x5d,0x5e,0x61,0x5b,0x32,0x31,0x5d,0x3b,0x0a,0x74,0x5b,0x32,0x5d,0x3d,0x61,0x5b,0x32,0x5d,
|
0x31,0x31,0x5d,0x5e,0x61,0x5b,0x31,0x36,0x5d,0x5e,0x61,0x5b,0x32,0x31,0x5d,0x3b,0x0a,0x74,0x5b,0x32,0x5d,0x3d,0x61,0x5b,0x32,0x5d,0x5e,0x61,0x5b,0x37,0x5d,0x5e,
|
||||||
0x5e,0x61,0x5b,0x37,0x5d,0x5e,0x61,0x5b,0x31,0x32,0x5d,0x5e,0x61,0x5b,0x31,0x37,0x5d,0x5e,0x61,0x5b,0x32,0x32,0x5d,0x3b,0x0a,0x74,0x5b,0x33,0x5d,0x3d,0x61,0x5b,
|
0x61,0x5b,0x31,0x32,0x5d,0x5e,0x61,0x5b,0x31,0x37,0x5d,0x5e,0x61,0x5b,0x32,0x32,0x5d,0x3b,0x0a,0x74,0x5b,0x33,0x5d,0x3d,0x61,0x5b,0x33,0x5d,0x5e,0x61,0x5b,0x38,
|
||||||
0x33,0x5d,0x5e,0x61,0x5b,0x38,0x5d,0x5e,0x61,0x5b,0x31,0x33,0x5d,0x5e,0x61,0x5b,0x31,0x38,0x5d,0x5e,0x61,0x5b,0x32,0x33,0x5d,0x3b,0x0a,0x74,0x5b,0x34,0x5d,0x3d,
|
0x5d,0x5e,0x61,0x5b,0x31,0x33,0x5d,0x5e,0x61,0x5b,0x31,0x38,0x5d,0x5e,0x61,0x5b,0x32,0x33,0x5d,0x3b,0x0a,0x74,0x5b,0x34,0x5d,0x3d,0x61,0x5b,0x34,0x5d,0x5e,0x61,
|
||||||
0x61,0x5b,0x34,0x5d,0x5e,0x61,0x5b,0x39,0x5d,0x5e,0x61,0x5b,0x31,0x34,0x5d,0x5e,0x61,0x5b,0x31,0x39,0x5d,0x5e,0x61,0x5b,0x32,0x34,0x5d,0x3b,0x0a,0x75,0x3d,0x74,
|
0x5b,0x39,0x5d,0x5e,0x61,0x5b,0x31,0x34,0x5d,0x5e,0x61,0x5b,0x31,0x39,0x5d,0x5e,0x61,0x5b,0x32,0x34,0x5d,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x34,0x5d,0x5e,0x52,0x4f,
|
||||||
0x5b,0x34,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x31,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x35,
|
0x4c,0x32,0x28,0x74,0x5b,0x31,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x35,0x5d,0x20,0x5e,0x3d,0x20,0x75,
|
||||||
0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x35,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,
|
0x3b,0x0a,0x61,0x5b,0x31,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x35,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x30,0x5d,0x20,
|
||||||
0x61,0x5b,0x32,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x30,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x32,0x5d,0x2c,0x31,0x29,0x3b,
|
0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x30,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x32,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x31,0x5d,0x20,
|
||||||
0x0a,0x61,0x5b,0x31,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x31,0x5d,0x20,0x5e,0x3d,0x20,
|
0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x31,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,
|
||||||
0x75,0x3b,0x0a,0x61,0x5b,0x31,0x36,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x31,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x31,
|
0x36,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x31,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x31,0x5d,0x5e,0x52,0x4f,0x4c,0x32,
|
||||||
0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x33,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x32,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x37,0x5d,0x20,
|
0x28,0x74,0x5b,0x33,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x32,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x37,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,
|
||||||
0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x32,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x37,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,
|
0x61,0x5b,0x31,0x32,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x37,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x32,0x5d,0x20,0x5e,0x3d,
|
||||||
0x32,0x32,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x32,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x34,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,
|
0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x32,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x34,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x33,0x5d,0x20,0x5e,0x3d,
|
||||||
0x5b,0x33,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x38,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x33,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,
|
0x20,0x75,0x3b,0x0a,0x61,0x5b,0x38,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x33,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x38,0x5d,
|
||||||
0x0a,0x61,0x5b,0x31,0x38,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x33,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x33,0x5d,0x5e,
|
0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x33,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x75,0x3d,0x74,0x5b,0x33,0x5d,0x5e,0x52,0x4f,0x4c,0x32,0x28,0x74,
|
||||||
0x52,0x4f,0x4c,0x32,0x28,0x74,0x5b,0x30,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x34,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x39,0x5d,0x20,0x5e,0x3d,
|
0x5b,0x30,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x61,0x5b,0x34,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x39,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,
|
||||||
0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x34,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x39,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x34,
|
0x31,0x34,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x31,0x39,0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x61,0x5b,0x32,0x34,0x5d,0x20,0x5e,0x3d,0x20,0x75,
|
||||||
0x5d,0x20,0x5e,0x3d,0x20,0x75,0x3b,0x0a,0x74,0x5b,0x30,0x5d,0x3d,0x61,0x5b,0x30,0x5d,0x3b,0x0a,0x74,0x5b,0x31,0x30,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,
|
0x3b,0x0a,0x74,0x5b,0x30,0x5d,0x3d,0x61,0x5b,0x30,0x5d,0x3b,0x0a,0x74,0x5b,0x31,0x30,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x5d,0x2c,0x31,0x29,0x3b,
|
||||||
0x31,0x5d,0x2c,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x30,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x5d,0x2c,0x36,0x32,0x29,0x3b,0x0a,0x74,0x5b,0x35,0x5d,
|
0x0a,0x74,0x5b,0x32,0x30,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x5d,0x2c,0x36,0x32,0x29,0x3b,0x0a,0x74,0x5b,0x35,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,
|
||||||
0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x33,0x5d,0x2c,0x32,0x38,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x35,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x34,0x5d,0x2c,
|
0x61,0x5b,0x33,0x5d,0x2c,0x32,0x38,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x35,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x34,0x5d,0x2c,0x32,0x37,0x29,0x3b,0x0a,0x74,
|
||||||
0x32,0x37,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x36,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x35,0x5d,0x2c,0x33,0x36,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x5d,0x3d,0x52,
|
0x5b,0x31,0x36,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x35,0x5d,0x2c,0x33,0x36,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,
|
||||||
0x4f,0x4c,0x32,0x28,0x61,0x5b,0x36,0x5d,0x2c,0x34,0x34,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x31,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x37,0x5d,0x2c,0x36,0x29,
|
0x36,0x5d,0x2c,0x34,0x34,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x31,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x37,0x5d,0x2c,0x36,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x31,
|
||||||
0x3b,0x0a,0x74,0x5b,0x32,0x31,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x38,0x5d,0x2c,0x35,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x36,0x5d,0x3d,0x52,0x4f,0x4c,0x32,
|
0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x38,0x5d,0x2c,0x35,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x36,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x39,0x5d,0x2c,
|
||||||
0x28,0x61,0x5b,0x39,0x5d,0x2c,0x32,0x30,0x29,0x3b,0x0a,0x74,0x5b,0x37,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x30,0x5d,0x2c,0x33,0x29,0x3b,0x0a,0x74,
|
0x32,0x30,0x29,0x3b,0x0a,0x74,0x5b,0x37,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x30,0x5d,0x2c,0x33,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x37,0x5d,0x3d,0x52,
|
||||||
0x5b,0x31,0x37,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x31,0x5d,0x2c,0x31,0x30,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,
|
0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x31,0x5d,0x2c,0x31,0x30,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x32,0x5d,0x2c,0x34,
|
||||||
0x5b,0x31,0x32,0x5d,0x2c,0x34,0x33,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x32,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x33,0x5d,0x2c,0x32,0x35,0x29,0x3b,0x0a,
|
0x33,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x32,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x33,0x5d,0x2c,0x32,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x32,0x5d,0x3d,
|
||||||
0x74,0x5b,0x32,0x32,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x34,0x5d,0x2c,0x33,0x39,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,
|
0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x34,0x5d,0x2c,0x33,0x39,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x35,0x5d,
|
||||||
0x28,0x61,0x5b,0x31,0x35,0x5d,0x2c,0x34,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x38,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x36,0x5d,0x2c,0x34,0x35,0x29,0x3b,
|
0x2c,0x34,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x38,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x36,0x5d,0x2c,0x34,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x38,0x5d,
|
||||||
0x0a,0x74,0x5b,0x31,0x38,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x37,0x5d,0x2c,0x31,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,
|
0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x37,0x5d,0x2c,0x31,0x35,0x29,0x3b,0x0a,0x74,0x5b,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x38,0x5d,
|
||||||
0x28,0x61,0x5b,0x31,0x38,0x5d,0x2c,0x32,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x39,0x5d,0x2c,0x38,0x29,0x3b,
|
0x2c,0x32,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x33,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x31,0x39,0x5d,0x2c,0x38,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x34,0x5d,
|
||||||
0x0a,0x74,0x5b,0x31,0x34,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x30,0x5d,0x2c,0x31,0x38,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x34,0x5d,0x3d,0x52,0x4f,0x4c,
|
0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x30,0x5d,0x2c,0x31,0x38,0x29,0x3b,0x0a,0x74,0x5b,0x32,0x34,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x31,
|
||||||
0x32,0x28,0x61,0x5b,0x32,0x31,0x5d,0x2c,0x32,0x29,0x3b,0x0a,0x74,0x5b,0x39,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x32,0x5d,0x2c,0x36,0x31,0x29,0x3b,
|
0x5d,0x2c,0x32,0x29,0x3b,0x0a,0x74,0x5b,0x39,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x32,0x5d,0x2c,0x36,0x31,0x29,0x3b,0x0a,0x74,0x5b,0x31,0x39,0x5d,
|
||||||
0x0a,0x74,0x5b,0x31,0x39,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x33,0x5d,0x2c,0x35,0x36,0x29,0x3b,0x0a,0x74,0x5b,0x34,0x5d,0x3d,0x52,0x4f,0x4c,0x32,
|
0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x33,0x5d,0x2c,0x35,0x36,0x29,0x3b,0x0a,0x74,0x5b,0x34,0x5d,0x3d,0x52,0x4f,0x4c,0x32,0x28,0x61,0x5b,0x32,0x34,0x5d,
|
||||||
0x28,0x61,0x5b,0x32,0x34,0x5d,0x2c,0x31,0x34,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x30,0x2c,0x74,0x29,0x3b,0x0a,0x61,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,
|
0x2c,0x31,0x34,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x30,0x2c,0x74,0x29,0x3b,0x0a,0x61,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x4b,0x65,0x63,0x63,0x61,0x6b,
|
||||||
0x4b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x52,0x43,0x5b,0x72,0x5d,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x35,0x2c,0x74,0x29,0x3b,0x0a,
|
0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x52,0x43,0x5b,0x72,0x5d,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x35,0x2c,0x74,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,
|
||||||
0x63,0x68,0x69,0x28,0x61,0x2c,0x31,0x30,0x2c,0x74,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x31,0x35,0x2c,0x74,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,
|
0x31,0x30,0x2c,0x74,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x31,0x35,0x2c,0x74,0x29,0x3b,0x0a,0x63,0x68,0x69,0x28,0x61,0x2c,0x32,0x30,0x2c,0x74,0x29,0x3b,
|
||||||
0x32,0x30,0x2c,0x74,0x29,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,
|
0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x6e,0x6f,0x5f,0x61,
|
||||||
0x30,0x5f,0x6e,0x6f,0x5f,0x61,0x62,0x73,0x6f,0x72,0x62,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x20,0x6f,0x75,0x74,0x5f,0x73,0x69,
|
0x62,0x73,0x6f,0x72,0x62,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x20,0x6f,0x75,0x74,0x5f,0x73,0x69,0x7a,0x65,0x2c,0x75,0x69,0x6e,
|
||||||
0x7a,0x65,0x2c,0x75,0x69,0x6e,0x74,0x20,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x72,0x3d,0x30,
|
0x74,0x20,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x72,0x3d,0x30,0x3b,0x20,0x72,0x3c,0x32,0x34,
|
||||||
0x3b,0x20,0x72,0x3c,0x32,0x34,0x3b,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,
|
0x3b,0x29,0x0a,0x7b,0x0a,0x69,0x66,0x28,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,
|
||||||
0x66,0x31,0x36,0x30,0x30,0x5f,0x72,0x6f,0x75,0x6e,0x64,0x28,0x61,0x2c,0x72,0x2b,0x2b,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,
|
0x72,0x6f,0x75,0x6e,0x64,0x28,0x61,0x2c,0x72,0x2b,0x2b,0x29,0x3b,0x0a,0x7d,0x0a,0x7d,0x0a,0x7d,0x0a,0x23,0x64,0x65,0x66,0x69,0x6e,0x65,0x20,0x63,0x6f,0x70,0x79,
|
||||||
0x65,0x20,0x63,0x6f,0x70,0x79,0x28,0x64,0x73,0x74,0x2c,0x20,0x73,0x72,0x63,0x2c,0x20,0x63,0x6f,0x75,0x6e,0x74,0x29,0x20,0x5c,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,
|
0x28,0x64,0x73,0x74,0x2c,0x20,0x73,0x72,0x63,0x2c,0x20,0x63,0x6f,0x75,0x6e,0x74,0x29,0x20,0x5c,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x69,0x3d,
|
||||||
0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x21,0x3d,0x63,0x6f,0x75,0x6e,0x74,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x20,0x5c,0x0a,0x7b,0x20,0x5c,0x0a,0x28,0x64,
|
0x30,0x3b,0x20,0x69,0x21,0x3d,0x63,0x6f,0x75,0x6e,0x74,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x20,0x5c,0x0a,0x7b,0x20,0x5c,0x0a,0x28,0x64,0x73,0x74,0x29,0x5b,0x69,0x5d,
|
||||||
0x73,0x74,0x29,0x5b,0x69,0x5d,0x3d,0x28,0x73,0x72,0x63,0x29,0x5b,0x69,0x5d,0x3b,0x20,0x5c,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,
|
0x3d,0x28,0x73,0x72,0x63,0x29,0x5b,0x69,0x5d,0x3b,0x20,0x5c,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x66,0x6e,0x76,0x28,0x75,
|
||||||
0x20,0x66,0x6e,0x76,0x28,0x75,0x69,0x6e,0x74,0x20,0x78,0x2c,0x75,0x69,0x6e,0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x2a,0x46,
|
0x69,0x6e,0x74,0x20,0x78,0x2c,0x75,0x69,0x6e,0x74,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x2a,0x46,0x4e,0x56,0x5f,0x50,0x52,0x49,
|
||||||
0x4e,0x56,0x5f,0x50,0x52,0x49,0x4d,0x45,0x5e,0x79,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x66,0x6e,0x76,0x34,0x28,
|
0x4d,0x45,0x5e,0x79,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x34,0x20,0x66,0x6e,0x76,0x34,0x28,0x75,0x69,0x6e,0x74,0x34,0x20,
|
||||||
0x75,0x69,0x6e,0x74,0x34,0x20,0x78,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x2a,0x46,0x4e,0x56,0x5f,
|
0x78,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x79,0x29,0x0a,0x7b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x78,0x2a,0x46,0x4e,0x56,0x5f,0x50,0x52,0x49,0x4d,0x45,0x5e,
|
||||||
0x50,0x52,0x49,0x4d,0x45,0x5e,0x79,0x3b,0x0a,0x7d,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6e,0x69,0x6f,0x6e,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,
|
0x79,0x3b,0x0a,0x7d,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6e,0x69,0x6f,0x6e,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x5b,
|
||||||
0x77,0x6f,0x72,0x64,0x73,0x5b,0x36,0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x69,
|
0x36,0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x69,0x6e,0x74,0x32,0x73,0x5b,0x36,
|
||||||
0x6e,0x74,0x32,0x73,0x5b,0x36,0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,
|
0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x36,
|
||||||
0x6e,0x74,0x34,0x73,0x5b,0x36,0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x36,0x34,
|
0x34,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x36,0x34,0x5f,0x74,0x3b,0x0a,0x74,0x79,
|
||||||
0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6e,0x69,0x6f,0x6e,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x5b,0x32,
|
0x70,0x65,0x64,0x65,0x66,0x20,0x75,0x6e,0x69,0x6f,0x6e,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x77,0x6f,0x72,0x64,0x73,0x5b,0x32,0x30,0x30,0x2f,0x73,0x69,0x7a,
|
||||||
0x30,0x30,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x69,0x6e,0x74,0x32,0x73,0x5b,0x32,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x32,0x20,0x75,0x69,0x6e,0x74,0x32,0x73,0x5b,0x32,0x30,0x30,0x2f,0x73,0x69,0x7a,
|
||||||
0x30,0x30,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x5d,0x3b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x32,0x30,0x30,0x2f,0x73,0x69,
|
||||||
0x32,0x30,0x30,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x32,0x30,0x30,0x5f,0x74,0x3b,
|
0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x32,0x30,0x30,0x5f,0x74,0x3b,0x0a,0x74,0x79,0x70,0x65,0x64,
|
||||||
0x0a,0x74,0x79,0x70,0x65,0x64,0x65,0x66,0x20,0x73,0x74,0x72,0x75,0x63,0x74,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x31,
|
0x65,0x66,0x20,0x73,0x74,0x72,0x75,0x63,0x74,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x34,0x20,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x31,0x32,0x38,0x2f,0x73,0x69,0x7a,
|
||||||
0x32,0x38,0x2f,0x73,0x69,0x7a,0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x31,0x32,0x38,0x5f,0x74,0x3b,0x0a,
|
0x65,0x6f,0x66,0x28,0x75,0x69,0x6e,0x74,0x34,0x29,0x5d,0x3b,0x0a,0x7d,0x20,0x68,0x61,0x73,0x68,0x31,0x32,0x38,0x5f,0x74,0x3b,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,
|
||||||
0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x76,0x6f,0x69,0x64,0x20,0x53,0x48,0x41,0x33,0x5f,0x35,0x31,0x32,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x73,0x2c,0x75,0x69,
|
0x20,0x76,0x6f,0x69,0x64,0x20,0x53,0x48,0x41,0x33,0x5f,0x35,0x31,0x32,0x28,0x75,0x69,0x6e,0x74,0x32,0x2a,0x20,0x73,0x2c,0x75,0x69,0x6e,0x74,0x20,0x69,0x73,0x6f,
|
||||||
0x6e,0x74,0x20,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x69,0x3d,0x38,0x3b,0x20,0x69,0x21,0x3d,
|
0x6c,0x61,0x74,0x65,0x29,0x0a,0x7b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x69,0x3d,0x38,0x3b,0x20,0x69,0x21,0x3d,0x32,0x35,0x3b,0x20,0x2b,0x2b,
|
||||||
0x32,0x35,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x73,0x5b,0x69,0x5d,0x3d,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x7b,0x30,0x2c,0x30,0x7d,0x3b,0x0a,0x7d,0x0a,
|
0x69,0x29,0x0a,0x7b,0x0a,0x73,0x5b,0x69,0x5d,0x3d,0x28,0x75,0x69,0x6e,0x74,0x32,0x29,0x7b,0x30,0x2c,0x30,0x7d,0x3b,0x0a,0x7d,0x0a,0x73,0x5b,0x38,0x5d,0x2e,0x78,
|
||||||
0x73,0x5b,0x38,0x5d,0x2e,0x78,0x3d,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x3b,0x0a,0x73,0x5b,0x38,0x5d,0x2e,0x79,0x3d,0x30,0x78,0x38,0x30,0x30,0x30,
|
0x3d,0x30,0x78,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x3b,0x0a,0x73,0x5b,0x38,0x5d,0x2e,0x79,0x3d,0x30,0x78,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3b,0x0a,
|
||||||
0x30,0x30,0x30,0x30,0x3b,0x0a,0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x6e,0x6f,0x5f,0x61,0x62,0x73,0x6f,0x72,0x62,0x28,0x73,0x2c,0x38,
|
0x6b,0x65,0x63,0x63,0x61,0x6b,0x5f,0x66,0x31,0x36,0x30,0x30,0x5f,0x6e,0x6f,0x5f,0x61,0x62,0x73,0x6f,0x72,0x62,0x28,0x73,0x2c,0x38,0x2c,0x69,0x73,0x6f,0x6c,0x61,
|
||||||
0x2c,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,
|
0x74,0x65,0x29,0x3b,0x0a,0x7d,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x75,0x69,0x6e,0x74,0x20,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,0x64,0x28,0x75,0x69,0x6e,0x74,
|
||||||
0x64,0x28,0x75,0x69,0x6e,0x74,0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,
|
0x20,0x61,0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x64,0x29,0x0a,0x7b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x6c,0x6f,0x6e,0x67,0x20,0x74,0x3d,0x61,0x3b,0x0a,0x63,
|
||||||
0x74,0x3d,0x61,0x3b,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x71,0x3d,0x28,0x28,0x74,0x2b,0x64,0x2e,0x79,0x29,0x2a,0x64,0x2e,0x78,0x29,0x3e,
|
0x6f,0x6e,0x73,0x74,0x20,0x75,0x69,0x6e,0x74,0x20,0x71,0x3d,0x28,0x28,0x74,0x2b,0x64,0x2e,0x79,0x29,0x2a,0x64,0x2e,0x78,0x29,0x3e,0x3e,0x64,0x2e,0x7a,0x3b,0x0a,
|
||||||
0x3e,0x64,0x2e,0x7a,0x3b,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x2d,0x71,0x2a,0x64,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,
|
0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x61,0x2d,0x71,0x2a,0x64,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x5f,0x5f,0x6b,0x65,0x72,0x6e,0x65,0x6c,0x20,0x76,0x6f,0x69,0x64,0x20,
|
||||||
0x20,0x76,0x6f,0x69,0x64,0x20,0x65,0x74,0x68,0x61,0x73,0x68,0x5f,0x63,0x61,0x6c,0x63,0x75,0x6c,0x61,0x74,0x65,0x5f,0x64,0x61,0x67,0x5f,0x69,0x74,0x65,0x6d,0x28,
|
0x65,0x74,0x68,0x61,0x73,0x68,0x5f,0x63,0x61,0x6c,0x63,0x75,0x6c,0x61,0x74,0x65,0x5f,0x64,0x61,0x67,0x5f,0x69,0x74,0x65,0x6d,0x28,0x75,0x69,0x6e,0x74,0x20,0x73,
|
||||||
0x75,0x69,0x6e,0x74,0x20,0x73,0x74,0x61,0x72,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x68,0x61,0x73,0x68,0x36,0x34,0x5f,0x74,0x20,0x63,0x6f,0x6e,
|
0x74,0x61,0x72,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x68,0x61,0x73,0x68,0x36,0x34,0x5f,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x2a,0x20,0x67,0x5f,
|
||||||
0x73,0x74,0x2a,0x20,0x67,0x5f,0x6c,0x69,0x67,0x68,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x68,0x61,0x73,0x68,0x36,0x34,0x5f,0x74,0x2a,0x20,0x67,
|
0x6c,0x69,0x67,0x68,0x74,0x2c,0x5f,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x20,0x68,0x61,0x73,0x68,0x36,0x34,0x5f,0x74,0x2a,0x20,0x67,0x5f,0x64,0x61,0x67,0x2c,0x75,
|
||||||
0x5f,0x64,0x61,0x67,0x2c,0x75,0x69,0x6e,0x74,0x20,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x2c,0x75,0x69,0x6e,0x74,0x20,0x64,0x61,0x67,0x5f,0x77,0x6f,0x72,0x64,0x73,
|
0x69,0x6e,0x74,0x20,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x2c,0x75,0x69,0x6e,0x74,0x20,0x64,0x61,0x67,0x5f,0x77,0x6f,0x72,0x64,0x73,0x2c,0x75,0x69,0x6e,0x74,0x34,
|
||||||
0x2c,0x75,0x69,0x6e,0x74,0x34,0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,
|
0x20,0x6c,0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x6e,0x6f,0x64,0x65,0x5f,
|
||||||
0x20,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3d,0x73,0x74,0x61,0x72,0x74,0x2b,0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,
|
0x69,0x6e,0x64,0x65,0x78,0x3d,0x73,0x74,0x61,0x72,0x74,0x2b,0x67,0x65,0x74,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x69,0x64,0x28,0x30,0x29,0x3b,0x0a,0x69,0x66,
|
||||||
0x30,0x29,0x3b,0x0a,0x69,0x66,0x28,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3e,0x3d,0x64,0x61,0x67,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x0a,0x72,0x65,
|
0x28,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3e,0x3d,0x64,0x61,0x67,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x0a,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,
|
||||||
0x74,0x75,0x72,0x6e,0x3b,0x0a,0x68,0x61,0x73,0x68,0x32,0x30,0x30,0x5f,0x74,0x20,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x3b,0x0a,0x63,0x6f,0x70,0x79,0x28,0x64,
|
0x68,0x61,0x73,0x68,0x32,0x30,0x30,0x5f,0x74,0x20,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x3b,0x0a,0x63,0x6f,0x70,0x79,0x28,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,
|
||||||
0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x67,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5b,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,0x64,0x28,
|
0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x67,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5b,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,0x64,0x28,0x6e,0x6f,0x64,0x65,0x5f,0x69,
|
||||||
0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x2c,0x6c,0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,
|
0x6e,0x64,0x65,0x78,0x2c,0x6c,0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x34,0x29,0x3b,0x0a,0x64,0x61,
|
||||||
0x34,0x29,0x3b,0x0a,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x77,0x6f,0x72,0x64,0x73,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,
|
0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x77,0x6f,0x72,0x64,0x73,0x5b,0x30,0x5d,0x20,0x5e,0x3d,0x20,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3b,0x0a,0x53,
|
||||||
0x64,0x65,0x78,0x3b,0x0a,0x53,0x48,0x41,0x33,0x5f,0x35,0x31,0x32,0x28,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x32,0x73,0x2c,0x69,0x73,
|
0x48,0x41,0x33,0x5f,0x35,0x31,0x32,0x28,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x32,0x73,0x2c,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,
|
||||||
0x6f,0x6c,0x61,0x74,0x65,0x29,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x21,0x3d,0x45,0x54,0x48,0x41,0x53,0x48,
|
0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x69,0x3d,0x30,0x3b,0x20,0x69,0x21,0x3d,0x45,0x54,0x48,0x41,0x53,0x48,0x5f,0x44,0x41,0x54,0x41,0x53,
|
||||||
0x5f,0x44,0x41,0x54,0x41,0x53,0x45,0x54,0x5f,0x50,0x41,0x52,0x45,0x4e,0x54,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x70,0x61,
|
0x45,0x54,0x5f,0x50,0x41,0x52,0x45,0x4e,0x54,0x53,0x3b,0x20,0x2b,0x2b,0x69,0x29,0x0a,0x7b,0x0a,0x75,0x69,0x6e,0x74,0x20,0x70,0x61,0x72,0x65,0x6e,0x74,0x5f,0x69,
|
||||||
0x72,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x64,0x65,0x78,0x3d,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,0x64,0x28,0x66,0x6e,0x76,0x28,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,
|
0x6e,0x64,0x65,0x78,0x3d,0x66,0x61,0x73,0x74,0x5f,0x6d,0x6f,0x64,0x28,0x66,0x6e,0x76,0x28,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x5e,0x69,0x2c,0x64,
|
||||||
0x65,0x78,0x5e,0x69,0x2c,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x77,0x6f,0x72,0x64,0x73,0x5b,0x69,0x20,0x25,0x20,0x4e,0x4f,0x44,0x45,0x5f,0x57,0x4f,0x52,
|
0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x77,0x6f,0x72,0x64,0x73,0x5b,0x69,0x20,0x25,0x20,0x4e,0x4f,0x44,0x45,0x5f,0x57,0x4f,0x52,0x44,0x53,0x5d,0x29,0x2c,0x6c,
|
||||||
0x44,0x53,0x5d,0x29,0x2c,0x6c,0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x77,0x3d,0x30,
|
0x69,0x67,0x68,0x74,0x5f,0x77,0x6f,0x72,0x64,0x73,0x29,0x3b,0x0a,0x66,0x6f,0x72,0x20,0x28,0x75,0x69,0x6e,0x74,0x20,0x77,0x3d,0x30,0x3b,0x20,0x77,0x21,0x3d,0x34,
|
||||||
0x3b,0x20,0x77,0x21,0x3d,0x34,0x3b,0x20,0x2b,0x2b,0x77,0x29,0x0a,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x3d,
|
0x3b,0x20,0x2b,0x2b,0x77,0x29,0x0a,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x3d,0x66,0x6e,0x76,0x34,0x28,0x64,
|
||||||
0x66,0x6e,0x76,0x34,0x28,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x2c,0x67,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5b,
|
0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x2c,0x67,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5b,0x70,0x61,0x72,0x65,0x6e,0x74,
|
||||||
0x70,0x61,0x72,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x64,0x65,0x78,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x29,0x3b,0x0a,0x7d,0x0a,0x53,0x48,0x41,0x33,
|
0x5f,0x69,0x6e,0x64,0x65,0x78,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x5b,0x77,0x5d,0x29,0x3b,0x0a,0x7d,0x0a,0x53,0x48,0x41,0x33,0x5f,0x35,0x31,0x32,0x28,0x64,
|
||||||
0x5f,0x35,0x31,0x32,0x28,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x32,0x73,0x2c,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x3b,0x0a,0x63,
|
0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x32,0x73,0x2c,0x69,0x73,0x6f,0x6c,0x61,0x74,0x65,0x29,0x3b,0x0a,0x63,0x6f,0x70,0x79,0x28,0x67,0x5f,
|
||||||
0x6f,0x70,0x79,0x28,0x67,0x5f,0x64,0x61,0x67,0x5b,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x64,0x61,0x67,
|
0x64,0x61,0x67,0x5b,0x6e,0x6f,0x64,0x65,0x5f,0x69,0x6e,0x64,0x65,0x78,0x5d,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x64,0x61,0x67,0x5f,0x6e,0x6f,0x64,0x65,0x2e,
|
||||||
0x5f,0x6e,0x6f,0x64,0x65,0x2e,0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x34,0x29,0x3b,0x0a,0x7d,0x0a,0x00
|
0x75,0x69,0x6e,0x74,0x34,0x73,0x2c,0x34,0x29,0x3b,0x0a,0x7d,0x0a,0x00
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ static inline uint32_t getMaxThreads(const OclDevice &device, const Algorithm &a
|
|||||||
return 40000U;
|
return 40000U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.vendorId() == OCL_VENDOR_NVIDIA) {
|
||||||
|
return 4096U;
|
||||||
|
}
|
||||||
|
|
||||||
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2U : 1U;
|
const uint32_t ratio = (algorithm.l3() <= oneMiB) ? 2U : 1U;
|
||||||
|
|
||||||
if (device.vendorId() == OCL_VENDOR_INTEL) {
|
if (device.vendorId() == OCL_VENDOR_INTEL) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ bool ocl_generic_kawpow_generator(const OclDevice &device, const Algorithm &algo
|
|||||||
case OclDevice::Navi_10:
|
case OclDevice::Navi_10:
|
||||||
case OclDevice::Navi_12:
|
case OclDevice::Navi_12:
|
||||||
case OclDevice::Navi_14:
|
case OclDevice::Navi_14:
|
||||||
|
case OclDevice::Navi_21:
|
||||||
isNavi = true;
|
isNavi = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
|
|||||||
|
|
||||||
switch (device.type()) {
|
switch (device.type()) {
|
||||||
case OclDevice::Baffin:
|
case OclDevice::Baffin:
|
||||||
|
case OclDevice::Ellesmere:
|
||||||
case OclDevice::Polaris:
|
case OclDevice::Polaris:
|
||||||
case OclDevice::Lexa:
|
case OclDevice::Lexa:
|
||||||
case OclDevice::Vega_10:
|
case OclDevice::Vega_10:
|
||||||
@@ -67,6 +68,10 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
|
|||||||
isNavi = true;
|
isNavi = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case OclDevice::Navi_21:
|
||||||
|
isNavi = true;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,13 @@ if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_OPENCL)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WITH_OPENCL)
|
if (WITH_OPENCL)
|
||||||
add_definitions(/DCL_TARGET_OPENCL_VERSION=200)
|
|
||||||
add_definitions(/DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
|
|
||||||
add_definitions(/DXMRIG_FEATURE_OPENCL)
|
add_definitions(/DXMRIG_FEATURE_OPENCL)
|
||||||
|
add_definitions(/DCL_USE_DEPRECATED_OPENCL_1_2_APIS)
|
||||||
|
if (XMRIG_OS_APPLE)
|
||||||
|
add_definitions(/DCL_TARGET_OPENCL_VERSION=120)
|
||||||
|
elseif (WITH_OPENCL_VERSION)
|
||||||
|
add_definitions(/DCL_TARGET_OPENCL_VERSION=${WITH_OPENCL_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
set(HEADERS_BACKEND_OPENCL
|
set(HEADERS_BACKEND_OPENCL
|
||||||
src/backend/opencl/cl/OclSource.h
|
src/backend/opencl/cl/OclSource.h
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ xmrig::OclAstroBWTRunner::OclAstroBWTRunner(size_t index, const OclLaunchData &d
|
|||||||
switch (data.device.type())
|
switch (data.device.type())
|
||||||
{
|
{
|
||||||
case OclDevice::Baffin:
|
case OclDevice::Baffin:
|
||||||
|
case OclDevice::Ellesmere:
|
||||||
case OclDevice::Polaris:
|
case OclDevice::Polaris:
|
||||||
case OclDevice::Lexa:
|
case OclDevice::Lexa:
|
||||||
case OclDevice::Vega_10:
|
case OclDevice::Vega_10:
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data)
|
|||||||
m_gcn_version = 14;
|
m_gcn_version = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.device.type() == OclDevice::Navi_10 || data.device.type() == OclDevice::Navi_12 || data.device.type() == OclDevice::Navi_14) {
|
if (data.device.type() == OclDevice::Navi_10 || data.device.type() == OclDevice::Navi_12 || data.device.type() == OclDevice::Navi_14 || data.device.type() == OclDevice::Navi_21) {
|
||||||
m_gcn_version = 15;
|
m_gcn_version = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,9 +153,35 @@ static KawPowCache cache;
|
|||||||
#define mix_dst() ("mix[" + std::to_string(mix_seq_dst[(mix_seq_dst_cnt++) % KPHash::REGS]) + "]")
|
#define mix_dst() ("mix[" + std::to_string(mix_seq_dst[(mix_seq_dst_cnt++) % KPHash::REGS]) + "]")
|
||||||
#define mix_cache() ("mix[" + std::to_string(mix_seq_cache[(mix_seq_cache_cnt++) % KPHash::REGS]) + "]")
|
#define mix_cache() ("mix[" + std::to_string(mix_seq_cache[(mix_seq_cache_cnt++) % KPHash::REGS]) + "]")
|
||||||
|
|
||||||
|
class KawPowBaton : public Baton<uv_work_t>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
inline KawPowBaton(const IOclRunner& runner, uint64_t period, uint32_t worksize) :
|
||||||
|
runner(runner),
|
||||||
|
period(period),
|
||||||
|
worksize(worksize)
|
||||||
|
{}
|
||||||
|
|
||||||
|
const IOclRunner& runner;
|
||||||
|
const uint64_t period;
|
||||||
|
const uint32_t worksize;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class KawPowBuilder
|
class KawPowBuilder
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
~KawPowBuilder()
|
||||||
|
{
|
||||||
|
if (m_loop) {
|
||||||
|
uv_async_send(&m_shutdownAsync);
|
||||||
|
uv_thread_join(&m_loopThread);
|
||||||
|
delete m_loop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void build_async(const IOclRunner& runner, uint64_t period, uint32_t worksize);
|
||||||
|
|
||||||
cl_kernel build(const IOclRunner &runner, uint64_t period, uint32_t worksize)
|
cl_kernel build(const IOclRunner &runner, uint64_t period, uint32_t worksize)
|
||||||
{
|
{
|
||||||
std::lock_guard<std::mutex> lock(m_mutex);
|
std::lock_guard<std::mutex> lock(m_mutex);
|
||||||
@@ -368,40 +394,54 @@ private:
|
|||||||
st.jcong = 69069 * st.jcong + 1234567;
|
st.jcong = 69069 * st.jcong + 1234567;
|
||||||
return ((MWC ^ st.jcong) + st.jsr);
|
return ((MWC ^ st.jcong) + st.jsr);
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
uv_loop_t* m_loop = nullptr;
|
||||||
|
uv_thread_t m_loopThread = {};
|
||||||
|
uv_async_t m_shutdownAsync = {};
|
||||||
|
|
||||||
class KawPowBaton : public Baton<uv_work_t>
|
static void loop(void* data)
|
||||||
{
|
{
|
||||||
public:
|
KawPowBuilder* builder = static_cast<KawPowBuilder*>(data);
|
||||||
inline KawPowBaton(const IOclRunner &runner, uint64_t period, uint32_t worksize) :
|
uv_run(builder->m_loop, UV_RUN_DEFAULT);
|
||||||
runner(runner),
|
uv_loop_close(builder->m_loop);
|
||||||
period(period),
|
}
|
||||||
worksize(worksize)
|
|
||||||
{}
|
|
||||||
|
|
||||||
const IOclRunner &runner;
|
|
||||||
const uint64_t period;
|
|
||||||
const uint32_t worksize;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static KawPowBuilder builder;
|
static KawPowBuilder builder;
|
||||||
|
|
||||||
|
|
||||||
|
void KawPowBuilder::build_async(const IOclRunner& runner, uint64_t period, uint32_t worksize)
|
||||||
|
{
|
||||||
|
std::lock_guard<std::mutex> lock(m_mutex);
|
||||||
|
|
||||||
|
if (!m_loop) {
|
||||||
|
m_loop = new uv_loop_t{};
|
||||||
|
uv_loop_init(m_loop);
|
||||||
|
uv_async_init(m_loop, &m_shutdownAsync, [](uv_async_t* handle) { uv_close(reinterpret_cast<uv_handle_t*>(handle), nullptr); });
|
||||||
|
uv_thread_create(&m_loopThread, loop, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
KawPowBaton* baton = new KawPowBaton(runner, period, worksize);
|
||||||
|
|
||||||
|
uv_queue_work(m_loop, &baton->req,
|
||||||
|
[](uv_work_t* req) {
|
||||||
|
KawPowBaton* baton = static_cast<KawPowBaton*>(req->data);
|
||||||
|
builder.build(baton->runner, baton->period, baton->worksize);
|
||||||
|
},
|
||||||
|
[](uv_work_t* req, int) { delete static_cast<KawPowBaton*>(req->data); }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
cl_kernel OclKawPow::get(const IOclRunner &runner, uint64_t height, uint32_t worksize)
|
cl_kernel OclKawPow::get(const IOclRunner &runner, uint64_t height, uint32_t worksize)
|
||||||
{
|
{
|
||||||
const uint64_t period = height / KPHash::PERIOD_LENGTH;
|
const uint64_t period = height / KPHash::PERIOD_LENGTH;
|
||||||
|
|
||||||
KawPowBaton* baton = new KawPowBaton(runner, period + 1, worksize);
|
if (!cache.search(runner, period + 1, worksize)) {
|
||||||
|
builder.build_async(runner, period + 1, worksize);
|
||||||
uv_queue_work(uv_default_loop(), &baton->req,
|
}
|
||||||
[](uv_work_t *req) {
|
|
||||||
KawPowBaton* baton = static_cast<KawPowBaton*>(req->data);
|
|
||||||
builder.build(baton->runner, baton->period, baton->worksize);
|
|
||||||
},
|
|
||||||
[](uv_work_t *req, int) { delete static_cast<KawPowBaton*>(req->data); }
|
|
||||||
);
|
|
||||||
|
|
||||||
cl_kernel kernel = cache.search(runner, period, worksize);
|
cl_kernel kernel = cache.search(runner, period, worksize);
|
||||||
if (kernel) {
|
if (kernel) {
|
||||||
|
|||||||
@@ -74,6 +74,28 @@ static ocl_gen_config_fun generators[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static OclVendor getPlatformVendorId(const String &vendor, const String &extensions)
|
||||||
|
{
|
||||||
|
if (extensions.contains("cl_amd_") || vendor.contains("Advanced Micro Devices") || vendor.contains("AMD")) {
|
||||||
|
return OCL_VENDOR_AMD;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extensions.contains("cl_nv_") || vendor.contains("NVIDIA")) {
|
||||||
|
return OCL_VENDOR_NVIDIA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extensions.contains("cl_intel_") || vendor.contains("Intel")) {
|
||||||
|
return OCL_VENDOR_INTEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (extensions.contains("cl_APPLE_") || vendor.contains("Apple")) {
|
||||||
|
return OCL_VENDOR_APPLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return OCL_VENDOR_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static OclVendor getVendorId(const String &vendor)
|
static OclVendor getVendorId(const String &vendor)
|
||||||
{
|
{
|
||||||
if (vendor.contains("Advanced Micro Devices") || vendor.contains("AMD")) {
|
if (vendor.contains("Advanced Micro Devices") || vendor.contains("AMD")) {
|
||||||
@@ -81,19 +103,76 @@ static OclVendor getVendorId(const String &vendor)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (vendor.contains("NVIDIA")) {
|
if (vendor.contains("NVIDIA")) {
|
||||||
return OCL_VENDOR_NVIDIA;
|
return OCL_VENDOR_NVIDIA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vendor.contains("Intel")) {
|
if (vendor.contains("Intel")) {
|
||||||
return OCL_VENDOR_INTEL;
|
return OCL_VENDOR_INTEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (vendor.contains("Apple")) {
|
||||||
|
return OCL_VENDOR_APPLE;
|
||||||
|
}
|
||||||
|
|
||||||
return OCL_VENDOR_UNKNOWN;
|
return OCL_VENDOR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static OclDevice::Type getType(const String &name)
|
static OclDevice::Type getType(const String &name, const OclVendor platformVendorId)
|
||||||
{
|
{
|
||||||
|
if (platformVendorId == OCL_VENDOR_APPLE) {
|
||||||
|
// Apple Platform: uses product names, not gfx# or codenames
|
||||||
|
if (name.contains("AMD Radeon")) {
|
||||||
|
if (name.contains(" 450 ") ||
|
||||||
|
name.contains(" 455 ") ||
|
||||||
|
name.contains(" 460 ")) {
|
||||||
|
return OclDevice::Baffin;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" 555 ") || name.contains(" 555X ") ||
|
||||||
|
name.contains(" 560 ") || name.contains(" 560X ") ||
|
||||||
|
name.contains(" 570 ") || name.contains(" 570X ") ||
|
||||||
|
name.contains(" 575 ") || name.contains(" 575X ")) {
|
||||||
|
return OclDevice::Polaris;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" 580 ") || name.contains(" 580X ")) {
|
||||||
|
return OclDevice::Ellesmere;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" Vega ")) {
|
||||||
|
if (name.contains(" 48 ") ||
|
||||||
|
name.contains(" 56 ") ||
|
||||||
|
name.contains(" 64 ") ||
|
||||||
|
name.contains(" 64X ")) {
|
||||||
|
return OclDevice::Vega_10;
|
||||||
|
}
|
||||||
|
if (name.contains(" 16 ") ||
|
||||||
|
name.contains(" 20 ") ||
|
||||||
|
name.contains(" II ")) {
|
||||||
|
return OclDevice::Vega_20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" 5700 ") || name.contains(" W5700X ")) {
|
||||||
|
return OclDevice::Navi_10;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" 5600 ") || name.contains(" 5600M ")) {
|
||||||
|
return OclDevice::Navi_12;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" 5300 ") || name.contains(" 5300M ") ||
|
||||||
|
name.contains(" 5500 ") || name.contains(" 5500M ")) {
|
||||||
|
return OclDevice::Navi_14;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.contains(" W6800 ") || name.contains(" W6900X ")) {
|
||||||
|
return OclDevice::Navi_21;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (name == "gfx900" || name == "gfx901") {
|
if (name == "gfx900" || name == "gfx901") {
|
||||||
return OclDevice::Vega_10;
|
return OclDevice::Vega_10;
|
||||||
}
|
}
|
||||||
@@ -118,6 +197,10 @@ static OclDevice::Type getType(const String &name)
|
|||||||
return OclDevice::Navi_14;
|
return OclDevice::Navi_14;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (name == "gfx1030") {
|
||||||
|
return OclDevice::Navi_21;
|
||||||
|
}
|
||||||
|
|
||||||
if (name == "gfx804") {
|
if (name == "gfx804") {
|
||||||
return OclDevice::Lexa;
|
return OclDevice::Lexa;
|
||||||
}
|
}
|
||||||
@@ -126,7 +209,11 @@ static OclDevice::Type getType(const String &name)
|
|||||||
return OclDevice::Baffin;
|
return OclDevice::Baffin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name == "gfx803" || name.contains("polaris") || name == "Ellesmere") {
|
if (name.contains("Ellesmere")) {
|
||||||
|
return OclDevice::Ellesmere;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name == "gfx803" || name.contains("polaris")) {
|
||||||
return OclDevice::Polaris;
|
return OclDevice::Polaris;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,28 +227,31 @@ static OclDevice::Type getType(const String &name)
|
|||||||
xmrig::OclDevice::OclDevice(uint32_t index, cl_device_id id, cl_platform_id platform) :
|
xmrig::OclDevice::OclDevice(uint32_t index, cl_device_id id, cl_platform_id platform) :
|
||||||
m_id(id),
|
m_id(id),
|
||||||
m_platform(platform),
|
m_platform(platform),
|
||||||
m_board(OclLib::getString(id, 0x4038 /* CL_DEVICE_BOARD_NAME_AMD */)),
|
m_platformVendor(OclLib::getString(platform, CL_PLATFORM_VENDOR)),
|
||||||
m_name(OclLib::getString(id, CL_DEVICE_NAME)),
|
m_name(OclLib::getString(id, CL_DEVICE_NAME)),
|
||||||
m_vendor(OclLib::getString(id, CL_DEVICE_VENDOR)),
|
m_vendor(OclLib::getString(id, CL_DEVICE_VENDOR)),
|
||||||
|
m_extensions(OclLib::getString(id, CL_DEVICE_EXTENSIONS)),
|
||||||
m_maxMemoryAlloc(OclLib::getUlong(id, CL_DEVICE_MAX_MEM_ALLOC_SIZE)),
|
m_maxMemoryAlloc(OclLib::getUlong(id, CL_DEVICE_MAX_MEM_ALLOC_SIZE)),
|
||||||
m_globalMemory(OclLib::getUlong(id, CL_DEVICE_GLOBAL_MEM_SIZE)),
|
m_globalMemory(OclLib::getUlong(id, CL_DEVICE_GLOBAL_MEM_SIZE)),
|
||||||
m_computeUnits(OclLib::getUint(id, CL_DEVICE_MAX_COMPUTE_UNITS, 1)),
|
m_computeUnits(OclLib::getUint(id, CL_DEVICE_MAX_COMPUTE_UNITS, 1)),
|
||||||
m_index(index)
|
m_index(index)
|
||||||
{
|
{
|
||||||
m_vendorId = getVendorId(m_vendor);
|
m_vendorId = getVendorId(m_vendor);
|
||||||
m_type = getType(m_name);
|
m_platformVendorId = getPlatformVendorId(m_platformVendor, m_extensions);
|
||||||
|
m_type = getType(m_name, m_platformVendorId);
|
||||||
|
|
||||||
if (m_vendorId == OCL_VENDOR_AMD) {
|
if (m_extensions.contains("cl_amd_device_attribute_query")) {
|
||||||
topology_amd topology;
|
topology_amd topology;
|
||||||
|
|
||||||
if (OclLib::getDeviceInfo(id, 0x4037 /* CL_DEVICE_TOPOLOGY_AMD */, sizeof(topology), &topology, nullptr) == CL_SUCCESS && topology.raw.type == 1) {
|
if (OclLib::getDeviceInfo(id, CL_DEVICE_TOPOLOGY_AMD, sizeof(topology), &topology, nullptr) == CL_SUCCESS && topology.raw.type == CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD) {
|
||||||
m_topology = PciTopology(static_cast<uint32_t>(topology.pcie.bus), static_cast<uint32_t>(topology.pcie.device), static_cast<uint32_t>(topology.pcie.function));
|
m_topology = PciTopology(static_cast<uint32_t>(topology.pcie.bus), static_cast<uint32_t>(topology.pcie.device), static_cast<uint32_t>(topology.pcie.function));
|
||||||
}
|
}
|
||||||
|
m_board = OclLib::getString(id, CL_DEVICE_BOARD_NAME_AMD);
|
||||||
}
|
}
|
||||||
else if (m_vendorId == OCL_VENDOR_NVIDIA) {
|
else if (m_extensions.contains("cl_nv_device_attribute_query")) {
|
||||||
cl_uint bus = 0;
|
cl_uint bus = 0;
|
||||||
if (OclLib::getDeviceInfo(id, 0x4008 /* CL_DEVICE_PCI_BUS_ID_NV */, sizeof (bus), &bus, nullptr) == CL_SUCCESS) {
|
if (OclLib::getDeviceInfo(id, CL_DEVICE_PCI_BUS_ID_NV, sizeof (bus), &bus, nullptr) == CL_SUCCESS) {
|
||||||
cl_uint slot = OclLib::getUint(id, 0x4009 /* CL_DEVICE_PCI_SLOT_ID_NV */);
|
cl_uint slot = OclLib::getUint(id, CL_DEVICE_PCI_SLOT_ID_NV);
|
||||||
m_topology = PciTopology(bus, (slot >> 3) & 0xff, slot & 7);
|
m_topology = PciTopology(bus, (slot >> 3) & 0xff, slot & 7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public:
|
|||||||
enum Type {
|
enum Type {
|
||||||
Unknown,
|
Unknown,
|
||||||
Baffin,
|
Baffin,
|
||||||
|
Ellesmere,
|
||||||
Polaris,
|
Polaris,
|
||||||
Lexa,
|
Lexa,
|
||||||
Vega_10,
|
Vega_10,
|
||||||
@@ -52,7 +53,8 @@ public:
|
|||||||
Raven,
|
Raven,
|
||||||
Navi_10,
|
Navi_10,
|
||||||
Navi_12,
|
Navi_12,
|
||||||
Navi_14
|
Navi_14,
|
||||||
|
Navi_21
|
||||||
};
|
};
|
||||||
|
|
||||||
OclDevice() = delete;
|
OclDevice() = delete;
|
||||||
@@ -64,11 +66,14 @@ public:
|
|||||||
|
|
||||||
inline bool isValid() const { return m_id != nullptr && m_platform != nullptr; }
|
inline bool isValid() const { return m_id != nullptr && m_platform != nullptr; }
|
||||||
inline cl_device_id id() const { return m_id; }
|
inline cl_device_id id() const { return m_id; }
|
||||||
|
inline const String &platformVendor() const { return m_platformVendor; }
|
||||||
|
inline OclVendor platformVendorId() const { return m_vendorId; }
|
||||||
inline const PciTopology &topology() const { return m_topology; }
|
inline const PciTopology &topology() const { return m_topology; }
|
||||||
inline const String &board() const { return m_board.isNull() ? m_name : m_board; }
|
inline const String &board() const { return m_board.isNull() ? m_name : m_board; }
|
||||||
inline const String &name() const { return m_name; }
|
inline const String &name() const { return m_name; }
|
||||||
inline const String &vendor() const { return m_vendor; }
|
inline const String &vendor() const { return m_vendor; }
|
||||||
inline OclVendor vendorId() const { return m_vendorId; }
|
inline OclVendor vendorId() const { return m_vendorId; }
|
||||||
|
inline const String &extensions() const { return m_extensions; }
|
||||||
inline Type type() const { return m_type; }
|
inline Type type() const { return m_type; }
|
||||||
inline uint32_t computeUnits() const { return m_computeUnits; }
|
inline uint32_t computeUnits() const { return m_computeUnits; }
|
||||||
inline size_t freeMemSize() const { return std::min(maxMemAllocSize(), globalMemSize()); }
|
inline size_t freeMemSize() const { return std::min(maxMemAllocSize(), globalMemSize()); }
|
||||||
@@ -83,13 +88,16 @@ public:
|
|||||||
private:
|
private:
|
||||||
cl_device_id m_id = nullptr;
|
cl_device_id m_id = nullptr;
|
||||||
cl_platform_id m_platform = nullptr;
|
cl_platform_id m_platform = nullptr;
|
||||||
const String m_board;
|
const String m_platformVendor;
|
||||||
|
String m_board;
|
||||||
const String m_name;
|
const String m_name;
|
||||||
const String m_vendor;
|
const String m_vendor;
|
||||||
|
String m_extensions;
|
||||||
const size_t m_maxMemoryAlloc = 0;
|
const size_t m_maxMemoryAlloc = 0;
|
||||||
const size_t m_globalMemory = 0;
|
const size_t m_globalMemory = 0;
|
||||||
const uint32_t m_computeUnits = 1;
|
const uint32_t m_computeUnits = 1;
|
||||||
const uint32_t m_index = 0;
|
const uint32_t m_index = 0;
|
||||||
|
OclVendor m_platformVendorId = OCL_VENDOR_UNKNOWN;
|
||||||
OclVendor m_vendorId = OCL_VENDOR_UNKNOWN;
|
OclVendor m_vendorId = OCL_VENDOR_UNKNOWN;
|
||||||
PciTopology m_topology;
|
PciTopology m_topology;
|
||||||
Type m_type = Unknown;
|
Type m_type = Unknown;
|
||||||
|
|||||||
@@ -30,8 +30,6 @@
|
|||||||
|
|
||||||
#if defined(OCL_DEBUG_REFERENCE_COUNT)
|
#if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
# define LOG_REFS(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
|
# define LOG_REFS(x, ...) xmrig::Log::print(xmrig::Log::WARNING, x, ##__VA_ARGS__)
|
||||||
#else
|
|
||||||
# define LOG_REFS(x, ...)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -405,7 +403,7 @@ cl_int xmrig::OclLib::getDeviceInfo(cl_device_id device, cl_device_info param_na
|
|||||||
assert(pGetDeviceInfo != nullptr);
|
assert(pGetDeviceInfo != nullptr);
|
||||||
|
|
||||||
const cl_int ret = pGetDeviceInfo(device, param_name, param_value_size, param_value, param_value_size_ret);
|
const cl_int ret = pGetDeviceInfo(device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||||
if (ret != CL_SUCCESS && param_name != 0x4038) {
|
if (ret != CL_SUCCESS && param_name != CL_DEVICE_BOARD_NAME_AMD) {
|
||||||
LOG_ERR("Error %s when calling %s, param 0x%04x", OclError::toString(ret), kGetDeviceInfo, param_name);
|
LOG_ERR("Error %s when calling %s, param 0x%04x", OclError::toString(ret), kGetDeviceInfo, param_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -476,7 +474,9 @@ cl_int xmrig::OclLib::release(cl_command_queue command_queue) noexcept
|
|||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~queue", command_queue, getUint(command_queue, CL_QUEUE_REFERENCE_COUNT));
|
LOG_REFS("%p %u ~queue", command_queue, getUint(command_queue, CL_QUEUE_REFERENCE_COUNT));
|
||||||
|
# endif
|
||||||
|
|
||||||
finish(command_queue);
|
finish(command_queue);
|
||||||
|
|
||||||
@@ -493,7 +493,9 @@ cl_int xmrig::OclLib::release(cl_context context) noexcept
|
|||||||
{
|
{
|
||||||
assert(pReleaseContext != nullptr);
|
assert(pReleaseContext != nullptr);
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~context", context, getUint(context, CL_CONTEXT_REFERENCE_COUNT));
|
LOG_REFS("%p %u ~context", context, getUint(context, CL_CONTEXT_REFERENCE_COUNT));
|
||||||
|
# endif
|
||||||
|
|
||||||
const cl_int ret = pReleaseContext(context);
|
const cl_int ret = pReleaseContext(context);
|
||||||
if (ret != CL_SUCCESS) {
|
if (ret != CL_SUCCESS) {
|
||||||
@@ -508,7 +510,9 @@ cl_int xmrig::OclLib::release(cl_device_id id) noexcept
|
|||||||
{
|
{
|
||||||
assert(pReleaseDevice != nullptr);
|
assert(pReleaseDevice != nullptr);
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~device", id, getUint(id, CL_DEVICE_REFERENCE_COUNT));
|
LOG_REFS("%p %u ~device", id, getUint(id, CL_DEVICE_REFERENCE_COUNT));
|
||||||
|
# endif
|
||||||
|
|
||||||
const cl_int ret = pReleaseDevice(id);
|
const cl_int ret = pReleaseDevice(id);
|
||||||
if (ret != CL_SUCCESS) {
|
if (ret != CL_SUCCESS) {
|
||||||
@@ -527,7 +531,9 @@ cl_int xmrig::OclLib::release(cl_kernel kernel) noexcept
|
|||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~kernel %s", kernel, getUint(kernel, CL_KERNEL_REFERENCE_COUNT), getString(kernel, CL_KERNEL_FUNCTION_NAME).data());
|
LOG_REFS("%p %u ~kernel %s", kernel, getUint(kernel, CL_KERNEL_REFERENCE_COUNT), getString(kernel, CL_KERNEL_FUNCTION_NAME).data());
|
||||||
|
# endif
|
||||||
|
|
||||||
const cl_int ret = pReleaseKernel(kernel);
|
const cl_int ret = pReleaseKernel(kernel);
|
||||||
if (ret != CL_SUCCESS) {
|
if (ret != CL_SUCCESS) {
|
||||||
@@ -546,7 +552,9 @@ cl_int xmrig::OclLib::release(cl_mem mem_obj) noexcept
|
|||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~mem %zub", mem_obj, getUint(mem_obj, CL_MEM_REFERENCE_COUNT), getUlong(mem_obj, CL_MEM_SIZE));
|
LOG_REFS("%p %u ~mem %zub", mem_obj, getUint(mem_obj, CL_MEM_REFERENCE_COUNT), getUlong(mem_obj, CL_MEM_SIZE));
|
||||||
|
# endif
|
||||||
|
|
||||||
const cl_int ret = pReleaseMemObject(mem_obj);
|
const cl_int ret = pReleaseMemObject(mem_obj);
|
||||||
if (ret != CL_SUCCESS) {
|
if (ret != CL_SUCCESS) {
|
||||||
@@ -565,7 +573,9 @@ cl_int xmrig::OclLib::release(cl_program program) noexcept
|
|||||||
return CL_SUCCESS;
|
return CL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# if defined(OCL_DEBUG_REFERENCE_COUNT)
|
||||||
LOG_REFS("%p %u ~program %s", program, getUint(program, CL_PROGRAM_REFERENCE_COUNT), getString(program, CL_PROGRAM_KERNEL_NAMES).data());
|
LOG_REFS("%p %u ~program %s", program, getUint(program, CL_PROGRAM_REFERENCE_COUNT), getString(program, CL_PROGRAM_KERNEL_NAMES).data());
|
||||||
|
# endif
|
||||||
|
|
||||||
const cl_int ret = pReleaseProgram(program);
|
const cl_int ret = pReleaseProgram(program);
|
||||||
if (ret != CL_SUCCESS) {
|
if (ret != CL_SUCCESS) {
|
||||||
|
|||||||
@@ -26,6 +26,22 @@
|
|||||||
#include "3rdparty/cl.h"
|
#include "3rdparty/cl.h"
|
||||||
#include "base/tools/String.h"
|
#include "base/tools/String.h"
|
||||||
|
|
||||||
|
#ifndef CL_DEVICE_TOPOLOGY_AMD
|
||||||
|
#define CL_DEVICE_TOPOLOGY_AMD 0x4037
|
||||||
|
#endif
|
||||||
|
#ifndef CL_DEVICE_BOARD_NAME_AMD
|
||||||
|
#define CL_DEVICE_BOARD_NAME_AMD 0x4038
|
||||||
|
#endif
|
||||||
|
#ifndef CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD
|
||||||
|
#define CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD 1
|
||||||
|
#endif
|
||||||
|
#ifndef CL_DEVICE_PCI_BUS_ID_NV
|
||||||
|
#define CL_DEVICE_PCI_BUS_ID_NV 0x4008
|
||||||
|
#endif
|
||||||
|
#ifndef CL_DEVICE_PCI_SLOT_ID_NV
|
||||||
|
#define CL_DEVICE_PCI_SLOT_ID_NV 0x4009
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ enum OclVendor : unsigned {
|
|||||||
OCL_VENDOR_UNKNOWN,
|
OCL_VENDOR_UNKNOWN,
|
||||||
OCL_VENDOR_AMD,
|
OCL_VENDOR_AMD,
|
||||||
OCL_VENDOR_NVIDIA,
|
OCL_VENDOR_NVIDIA,
|
||||||
OCL_VENDOR_INTEL
|
OCL_VENDOR_INTEL,
|
||||||
|
OCL_VENDOR_APPLE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ set(SOURCES_BASE
|
|||||||
src/base/net/tools/LineReader.cpp
|
src/base/net/tools/LineReader.cpp
|
||||||
src/base/net/tools/NetBuffer.cpp
|
src/base/net/tools/NetBuffer.cpp
|
||||||
src/base/tools/Arguments.cpp
|
src/base/tools/Arguments.cpp
|
||||||
|
src/base/tools/Chrono.cpp
|
||||||
src/base/tools/cryptonote/BlockTemplate.cpp
|
src/base/tools/cryptonote/BlockTemplate.cpp
|
||||||
src/base/tools/cryptonote/crypto-ops-data.c
|
src/base/tools/cryptonote/crypto-ops-data.c
|
||||||
src/base/tools/cryptonote/crypto-ops.c
|
src/base/tools/cryptonote/crypto-ops.c
|
||||||
@@ -244,7 +245,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if (WITH_KAWPOW)
|
if (WITH_KAWPOW OR WITH_GHOSTRIDER)
|
||||||
list(APPEND HEADERS_BASE
|
list(APPEND HEADERS_BASE
|
||||||
src/base/net/stratum/AutoClient.h
|
src/base/net/stratum/AutoClient.h
|
||||||
src/base/net/stratum/EthStratumClient.h
|
src/base/net/stratum/EthStratumClient.h
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ const char *Algorithm::kKAWPOW = "kawpow";
|
|||||||
const char *Algorithm::kKAWPOW_RVN = "kawpow";
|
const char *Algorithm::kKAWPOW_RVN = "kawpow";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
const char* Algorithm::kGHOSTRIDER = "ghostrider";
|
||||||
|
const char* Algorithm::kGHOSTRIDER_RTM = "ghostrider";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ALGO_NAME(ALGO) { Algorithm::ALGO, Algorithm::k##ALGO }
|
#define ALGO_NAME(ALGO) { Algorithm::ALGO, Algorithm::k##ALGO }
|
||||||
#define ALGO_ALIAS(ALGO, NAME) { NAME, Algorithm::ALGO }
|
#define ALGO_ALIAS(ALGO, NAME) { NAME, Algorithm::ALGO }
|
||||||
@@ -163,6 +168,10 @@ static const std::map<uint32_t, const char *> kAlgorithmNames = {
|
|||||||
# ifdef XMRIG_ALGO_KAWPOW
|
# ifdef XMRIG_ALGO_KAWPOW
|
||||||
ALGO_NAME(KAWPOW_RVN),
|
ALGO_NAME(KAWPOW_RVN),
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
ALGO_NAME(GHOSTRIDER_RTM),
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -278,6 +287,11 @@ static const std::map<const char *, Algorithm::Id, aliasCompare> kAlgorithmAlias
|
|||||||
# ifdef XMRIG_ALGO_KAWPOW
|
# ifdef XMRIG_ALGO_KAWPOW
|
||||||
ALGO_ALIAS_AUTO(KAWPOW_RVN), ALGO_ALIAS(KAWPOW_RVN, "kawpow/rvn"),
|
ALGO_ALIAS_AUTO(KAWPOW_RVN), ALGO_ALIAS(KAWPOW_RVN, "kawpow/rvn"),
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
ALGO_ALIAS_AUTO(GHOSTRIDER_RTM), ALGO_ALIAS(GHOSTRIDER_RTM, "ghostrider/rtm"),
|
||||||
|
ALGO_ALIAS(GHOSTRIDER_RTM, "gr"),
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -352,7 +366,8 @@ std::vector<xmrig::Algorithm> xmrig::Algorithm::all(const std::function<bool(con
|
|||||||
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA,
|
RX_0, RX_WOW, RX_ARQ, RX_GRAFT, RX_SFX, RX_KEVA,
|
||||||
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
|
AR2_CHUKWA, AR2_CHUKWA_V2, AR2_WRKZ,
|
||||||
ASTROBWT_DERO,
|
ASTROBWT_DERO,
|
||||||
KAWPOW_RVN
|
KAWPOW_RVN,
|
||||||
|
GHOSTRIDER_RTM
|
||||||
};
|
};
|
||||||
|
|
||||||
Algorithms out;
|
Algorithms out;
|
||||||
|
|||||||
@@ -65,6 +65,13 @@ public:
|
|||||||
CN_PICO_0 = 0x63120200, // "cn-pico" CryptoNight-Pico
|
CN_PICO_0 = 0x63120200, // "cn-pico" CryptoNight-Pico
|
||||||
CN_PICO_TLO = 0x63120274, // "cn-pico/tlo" CryptoNight-Pico (TLO)
|
CN_PICO_TLO = 0x63120274, // "cn-pico/tlo" CryptoNight-Pico (TLO)
|
||||||
CN_UPX2 = 0x63110200, // "cn/upx2" Uplexa (UPX2)
|
CN_UPX2 = 0x63110200, // "cn/upx2" Uplexa (UPX2)
|
||||||
|
CN_GR_0 = 0x63130100, // "cn/dark" GhostRider
|
||||||
|
CN_GR_1 = 0x63130101, // "cn/dark-lite" GhostRider
|
||||||
|
CN_GR_2 = 0x63150102, // "cn/fast" GhostRider
|
||||||
|
CN_GR_3 = 0x63140103, // "cn/lite" GhostRider
|
||||||
|
CN_GR_4 = 0x63120104, // "cn/turtle" GhostRider
|
||||||
|
CN_GR_5 = 0x63120105, // "cn/turtle-lite" GhostRider
|
||||||
|
GHOSTRIDER_RTM = 0x6c150000, // "ghostrider" GhostRider
|
||||||
RX_0 = 0x72151200, // "rx/0" RandomX (reference configuration).
|
RX_0 = 0x72151200, // "rx/0" RandomX (reference configuration).
|
||||||
RX_WOW = 0x72141177, // "rx/wow" RandomWOW (Wownero).
|
RX_WOW = 0x72141177, // "rx/wow" RandomWOW (Wownero).
|
||||||
RX_ARQ = 0x72121061, // "rx/arq" RandomARQ (Arqma).
|
RX_ARQ = 0x72121061, // "rx/arq" RandomARQ (Arqma).
|
||||||
@@ -89,7 +96,8 @@ public:
|
|||||||
RANDOM_X = 0x72000000,
|
RANDOM_X = 0x72000000,
|
||||||
ARGON2 = 0x61000000,
|
ARGON2 = 0x61000000,
|
||||||
ASTROBWT = 0x41000000,
|
ASTROBWT = 0x41000000,
|
||||||
KAWPOW = 0x6b000000
|
KAWPOW = 0x6b000000,
|
||||||
|
GHOSTRIDER = 0x6c000000
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *kINVALID;
|
static const char *kINVALID;
|
||||||
@@ -157,6 +165,11 @@ public:
|
|||||||
static const char *kKAWPOW_RVN;
|
static const char *kKAWPOW_RVN;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
static const char* kGHOSTRIDER;
|
||||||
|
static const char* kGHOSTRIDER_RTM;
|
||||||
|
# endif
|
||||||
|
|
||||||
inline Algorithm() = default;
|
inline Algorithm() = default;
|
||||||
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
|
inline Algorithm(const char *algo) : m_id(parse(algo)) {}
|
||||||
inline Algorithm(Id id) : m_id(id) {}
|
inline Algorithm(Id id) : m_id(id) {}
|
||||||
@@ -176,7 +189,8 @@ public:
|
|||||||
inline Id id() const { return m_id; }
|
inline Id id() const { return m_id; }
|
||||||
inline size_t l2() const { return l2(m_id); }
|
inline size_t l2() const { return l2(m_id); }
|
||||||
inline uint32_t family() const { return family(m_id); }
|
inline uint32_t family() const { return family(m_id); }
|
||||||
inline uint32_t maxIntensity() const { return isCN() ? 5 : 1; };
|
inline uint32_t minIntensity() const { return ((m_id == GHOSTRIDER_RTM) ? 8 : 1); };
|
||||||
|
inline uint32_t maxIntensity() const { return isCN() ? 5 : ((m_id == GHOSTRIDER_RTM) ? 8 : 1); };
|
||||||
|
|
||||||
inline size_t l3() const
|
inline size_t l3() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ xmrig::String xmrig::Process::exepath()
|
|||||||
{
|
{
|
||||||
size_t size = sizeof(pathBuf);
|
size_t size = sizeof(pathBuf);
|
||||||
|
|
||||||
return uv_exepath(pathBuf, &size) < 0 ? "" : String(pathBuf, size);
|
return uv_exepath(pathBuf, &size) < 0 ? String("") : String(pathBuf, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ public:
|
|||||||
SpendSecretKey = 1055,
|
SpendSecretKey = 1055,
|
||||||
DaemonZMQPortKey = 1056,
|
DaemonZMQPortKey = 1056,
|
||||||
HugePagesJitKey = 1057,
|
HugePagesJitKey = 1057,
|
||||||
|
RotationKey = 1058,
|
||||||
|
|
||||||
// xmrig common
|
// xmrig common
|
||||||
CPUPriorityKey = 1021,
|
CPUPriorityKey = 1021,
|
||||||
|
|||||||
@@ -28,13 +28,19 @@
|
|||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
static Storage<DnsUvBackend>* storage = nullptr;
|
||||||
|
|
||||||
Storage<DnsUvBackend>& DnsUvBackend::getStorage()
|
Storage<DnsUvBackend>& DnsUvBackend::getStorage()
|
||||||
{
|
{
|
||||||
static Storage<DnsUvBackend>* storage = new Storage<DnsUvBackend>();
|
if (storage == nullptr) storage = new Storage<DnsUvBackend>();
|
||||||
return *storage;
|
return *storage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DnsUvBackend::releaseStorage()
|
||||||
|
{
|
||||||
|
delete storage;
|
||||||
|
}
|
||||||
|
|
||||||
static addrinfo hints{};
|
static addrinfo hints{};
|
||||||
|
|
||||||
|
|
||||||
@@ -56,6 +62,7 @@ xmrig::DnsUvBackend::DnsUvBackend()
|
|||||||
xmrig::DnsUvBackend::~DnsUvBackend()
|
xmrig::DnsUvBackend::~DnsUvBackend()
|
||||||
{
|
{
|
||||||
getStorage().release(m_key);
|
getStorage().release(m_key);
|
||||||
|
releaseStorage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ private:
|
|||||||
uintptr_t m_key;
|
uintptr_t m_key;
|
||||||
|
|
||||||
static Storage<DnsUvBackend>& getStorage();
|
static Storage<DnsUvBackend>& getStorage();
|
||||||
|
void releaseStorage();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ bool xmrig::AutoClient::parseLogin(const rapidjson::Value &result, int *code)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Algorithm algo(Json::getString(result, "algo"));
|
const Algorithm algo(Json::getString(result, "algo"));
|
||||||
if (algo.family() != Algorithm::KAWPOW) {
|
if (algo.family() != Algorithm::KAWPOW && algo.family() != Algorithm::GHOSTRIDER) {
|
||||||
*code = 6;
|
*code = 6;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_TLS
|
#ifdef XMRIG_FEATURE_TLS
|
||||||
@@ -660,7 +661,7 @@ void xmrig::Client::parse(char *line, size_t len)
|
|||||||
|
|
||||||
LOG_DEBUG("[%s] received (%d bytes): \"%.*s\"", url(), len, static_cast<int>(len), line);
|
LOG_DEBUG("[%s] received (%d bytes): \"%.*s\"", url(), len, static_cast<int>(len), line);
|
||||||
|
|
||||||
if (len < 32 || line[0] != '{') {
|
if (len < 22 || line[0] != '{') {
|
||||||
if (!isQuiet()) {
|
if (!isQuiet()) {
|
||||||
LOG_ERR("%s " RED("JSON decode failed"), tag());
|
LOG_ERR("%s " RED("JSON decode failed"), tag());
|
||||||
}
|
}
|
||||||
@@ -683,12 +684,48 @@ void xmrig::Client::parse(char *line, size_t len)
|
|||||||
|
|
||||||
const auto &id = Json::getValue(doc, "id");
|
const auto &id = Json::getValue(doc, "id");
|
||||||
const auto &error = Json::getValue(doc, "error");
|
const auto &error = Json::getValue(doc, "error");
|
||||||
|
const char *method = Json::getString(doc, "method");
|
||||||
|
|
||||||
|
if (method && strcmp(method, "client.reconnect") == 0) {
|
||||||
|
const auto ¶ms = Json::getValue(doc, "params");
|
||||||
|
if (!params.IsArray()) {
|
||||||
|
LOG_ERR("%s " RED("invalid client.reconnect notification: params is not an array"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto arr = params.GetArray();
|
||||||
|
|
||||||
|
if (arr.Empty()) {
|
||||||
|
LOG_ERR("%s " RED("invalid client.reconnect notification: params array is empty"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arr.Size() != 2) {
|
||||||
|
LOG_ERR("%s " RED("invalid client.reconnect notification: params array has wrong size"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!arr[0].IsString()) {
|
||||||
|
LOG_ERR("%s " RED("invalid client.reconnect notification: host is not a string"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!arr[1].IsString()) {
|
||||||
|
LOG_ERR("%s " RED("invalid client.reconnect notification: port is not a string"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::stringstream s;
|
||||||
|
s << arr[0].GetString() << ":" << arr[1].GetString();
|
||||||
|
LOG_WARN("%s " YELLOW("client.reconnect to %s"), tag(), s.str().c_str());
|
||||||
|
setPoolUrl(s.str().c_str());
|
||||||
|
return reconnect();
|
||||||
|
}
|
||||||
|
|
||||||
if (id.IsInt64()) {
|
if (id.IsInt64()) {
|
||||||
return parseResponse(id.GetInt64(), Json::getValue(doc, "result"), error);
|
return parseResponse(id.GetInt64(), Json::getValue(doc, "result"), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *method = Json::getString(doc, "method");
|
|
||||||
if (!method) {
|
if (!method) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ protected:
|
|||||||
inline const char *url() const { return m_pool.url(); }
|
inline const char *url() const { return m_pool.url(); }
|
||||||
inline const String &rpcId() const { return m_rpcId; }
|
inline const String &rpcId() const { return m_rpcId; }
|
||||||
inline void setRpcId(const char *id) { m_rpcId = id; }
|
inline void setRpcId(const char *id) { m_rpcId = id; }
|
||||||
|
inline void setPoolUrl(const char *url) { m_pool.setUrl(url); }
|
||||||
|
|
||||||
virtual bool parseLogin(const rapidjson::Value &result, int *code);
|
virtual bool parseLogin(const rapidjson::Value &result, int *code);
|
||||||
virtual void login();
|
virtual void login();
|
||||||
|
|||||||
@@ -34,6 +34,16 @@
|
|||||||
#include "base/kernel/interfaces/IClientListener.h"
|
#include "base/kernel/interfaces/IClientListener.h"
|
||||||
#include "net/JobResult.h"
|
#include "net/JobResult.h"
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "crypto/ghostrider/sph_sha2.h"
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "base/tools/Cvt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xmrig::EthStratumClient::EthStratumClient(int id, const char *agent, IClientListener *listener) :
|
xmrig::EthStratumClient::EthStratumClient(int id, const char *agent, IClientListener *listener) :
|
||||||
@@ -63,32 +73,56 @@ int64_t xmrig::EthStratumClient::submit(const JobResult& result)
|
|||||||
auto& allocator = doc.GetAllocator();
|
auto& allocator = doc.GetAllocator();
|
||||||
|
|
||||||
Value params(kArrayType);
|
Value params(kArrayType);
|
||||||
params.PushBack(m_pool.user().toJSON(), allocator);
|
params.PushBack(m_user.toJSON(), allocator);
|
||||||
params.PushBack(result.jobId.toJSON(), allocator);
|
params.PushBack(result.jobId.toJSON(), allocator);
|
||||||
|
|
||||||
std::stringstream s;
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
s << "0x" << std::hex << std::setw(16) << std::setfill('0') << result.nonce;
|
if (m_pool.algorithm().id() == Algorithm::GHOSTRIDER_RTM) {
|
||||||
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
params.PushBack(Value("00000000000000000000000000000000", static_cast<uint32_t>(m_extraNonce2Size * 2)), allocator);
|
||||||
|
params.PushBack(Value(m_ntime.data(), allocator), allocator);
|
||||||
|
|
||||||
s.str(std::string());
|
std::stringstream s;
|
||||||
s << "0x";
|
s << std::hex << std::setw(8) << std::setfill('0') << result.nonce;
|
||||||
for (size_t i = 0; i < 32; ++i) {
|
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
||||||
const uint32_t k = result.headerHash()[i];
|
|
||||||
s << std::hex << std::setw(2) << std::setfill('0') << k;
|
|
||||||
}
|
}
|
||||||
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
std::stringstream s;
|
||||||
|
s << "0x" << std::hex << std::setw(16) << std::setfill('0') << result.nonce;
|
||||||
|
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
||||||
|
|
||||||
s.str(std::string());
|
s.str(std::string());
|
||||||
s << "0x";
|
s << "0x";
|
||||||
for (size_t i = 0; i < 32; ++i) {
|
for (size_t i = 0; i < 32; ++i) {
|
||||||
const uint32_t k = result.mixHash()[i];
|
const uint32_t k = result.headerHash()[i];
|
||||||
s << std::hex << std::setw(2) << std::setfill('0') << k;
|
s << std::hex << std::setw(2) << std::setfill('0') << k;
|
||||||
|
}
|
||||||
|
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
||||||
|
|
||||||
|
s.str(std::string());
|
||||||
|
s << "0x";
|
||||||
|
for (size_t i = 0; i < 32; ++i) {
|
||||||
|
const uint32_t k = result.mixHash()[i];
|
||||||
|
s << std::hex << std::setw(2) << std::setfill('0') << k;
|
||||||
|
}
|
||||||
|
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
||||||
}
|
}
|
||||||
params.PushBack(Value(s.str().c_str(), allocator), allocator);
|
|
||||||
|
|
||||||
JsonRequest::create(doc, m_sequence, "mining.submit", params);
|
JsonRequest::create(doc, m_sequence, "mining.submit", params);
|
||||||
|
|
||||||
uint64_t actual_diff = ethash_swap_u64(*((uint64_t*)result.result()));
|
uint64_t actual_diff;
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (result.algorithm == Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
actual_diff = reinterpret_cast<const uint64_t*>(result.result())[3];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
actual_diff = ethash_swap_u64(*((uint64_t*)result.result()));
|
||||||
|
}
|
||||||
|
|
||||||
actual_diff = actual_diff ? (uint64_t(-1) / actual_diff) : 0;
|
actual_diff = actual_diff ? (uint64_t(-1) / actual_diff) : 0;
|
||||||
|
|
||||||
# ifdef XMRIG_PROXY_PROJECT
|
# ifdef XMRIG_PROXY_PROJECT
|
||||||
@@ -161,6 +195,34 @@ void xmrig::EthStratumClient::parseNotification(const char *method, const rapidj
|
|||||||
setExtraNonce(arr[0]);
|
setExtraNonce(arr[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (strcmp(method, "mining.set_difficulty") == 0) {
|
||||||
|
if (!params.IsArray()) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.set_difficulty notification: params is not an array"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pool.algorithm().id() != Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto arr = params.GetArray();
|
||||||
|
|
||||||
|
if (arr.Empty()) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.set_difficulty notification: params array is empty"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!arr[0].IsDouble() && !arr[0].IsUint64()) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.set_difficulty notification: difficulty is not a number"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const double diff = arr[0].IsDouble() ? arr[0].GetDouble() : arr[0].GetUint64();
|
||||||
|
m_nextDifficulty = static_cast<uint64_t>(ceil(diff * 65536.0));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (strcmp(method, "mining.notify") == 0) {
|
if (strcmp(method, "mining.notify") == 0) {
|
||||||
if (!params.IsArray()) {
|
if (!params.IsArray()) {
|
||||||
LOG_ERR("%s " RED("invalid mining.notify notification: params is not an array"), tag());
|
LOG_ERR("%s " RED("invalid mining.notify notification: params is not an array"), tag());
|
||||||
@@ -169,44 +231,152 @@ void xmrig::EthStratumClient::parseNotification(const char *method, const rapidj
|
|||||||
|
|
||||||
auto arr = params.GetArray();
|
auto arr = params.GetArray();
|
||||||
|
|
||||||
if (arr.Size() < 6) {
|
auto algo = m_pool.algorithm();
|
||||||
|
if (!algo.isValid()) {
|
||||||
|
algo = m_pool.coin().algorithm();
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_t min_arr_size = (algo.id() == Algorithm::GHOSTRIDER_RTM) ? 8 : 6;
|
||||||
|
|
||||||
|
if (arr.Size() < min_arr_size) {
|
||||||
LOG_ERR("%s " RED("invalid mining.notify notification: params array has wrong size"), tag());
|
LOG_ERR("%s " RED("invalid mining.notify notification: params array has wrong size"), tag());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!arr[0].IsString()) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.notify notification: invalid job id"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Job job;
|
Job job;
|
||||||
job.setId(arr[0].GetString());
|
job.setId(arr[0].GetString());
|
||||||
|
|
||||||
auto algo = m_pool.algorithm();
|
|
||||||
if (!algo.isValid()) {
|
|
||||||
algo = m_pool.coin().algorithm();
|
|
||||||
}
|
|
||||||
|
|
||||||
job.setAlgorithm(algo);
|
job.setAlgorithm(algo);
|
||||||
job.setExtraNonce(m_extraNonce.second);
|
job.setExtraNonce(m_extraNonce.second);
|
||||||
|
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
|
|
||||||
// header hash (32 bytes)
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
s << arr[1].GetString();
|
if (algo.id() == Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
// Raptoreum uses Bitcoin's Stratum protocol
|
||||||
|
// https://en.bitcoinwiki.org/wiki/Stratum_mining_protocol#mining.notify
|
||||||
|
|
||||||
// nonce template (8 bytes)
|
if (!arr[1].IsString() || !arr[2].IsString() || !arr[3].IsString() || !arr[4].IsArray() || !arr[5].IsString() || !arr[6].IsString() || !arr[7].IsString()) {
|
||||||
for (uint64_t i = 0, k = m_extraNonce.first; i < sizeof(m_extraNonce.first); ++i, k >>= 8) {
|
LOG_ERR("%s " RED("invalid mining.notify notification: invalid param array"), tag());
|
||||||
s << std::hex << std::setw(2) << std::setfill('0') << (k & 0xFF);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Version
|
||||||
|
s << arr[5].GetString();
|
||||||
|
|
||||||
|
// Previous block hash
|
||||||
|
s << arr[1].GetString();
|
||||||
|
|
||||||
|
// Merkle tree root
|
||||||
|
std::string blob = arr[2].GetString();
|
||||||
|
blob += m_extraNonce.second;
|
||||||
|
blob.append(m_extraNonce2Size * 2, '0');
|
||||||
|
blob += arr[3].GetString();
|
||||||
|
|
||||||
|
uint8_t merkle_root[64];
|
||||||
|
|
||||||
|
Buffer buf = Cvt::fromHex(blob.c_str(), blob.length());
|
||||||
|
|
||||||
|
// Get height from coinbase
|
||||||
|
{
|
||||||
|
uint8_t* p = buf.data() + 32;
|
||||||
|
uint8_t* m = p + 128;
|
||||||
|
|
||||||
|
while ((p < m) && (*p != 0xff)) ++p;
|
||||||
|
while ((p < m) && (*p == 0xff)) ++p;
|
||||||
|
|
||||||
|
if ((p < m) && (*(p - 1) == 0xff) && (*(p - 2) == 0xff)) {
|
||||||
|
uint32_t height = *reinterpret_cast<uint16_t*>(p + 2);
|
||||||
|
switch (*(p + 1)) {
|
||||||
|
case 4:
|
||||||
|
height += *reinterpret_cast<uint16_t*>(p + 4) * 0x10000UL;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
height += *(p + 4) * 0x10000UL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
job.setHeight(height);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
job.setHeight(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sha256d(merkle_root, buf.data(), static_cast<int>(buf.size()));
|
||||||
|
|
||||||
|
auto merkle_branches = arr[4].GetArray();
|
||||||
|
for (int i = 0, n = merkle_branches.Size(); i < n; ++i) {
|
||||||
|
auto& b = merkle_branches[i];
|
||||||
|
buf = b.IsString() ? Cvt::fromHex(b.GetString(), b.GetStringLength()) : Buffer();
|
||||||
|
if (buf.size() != 32) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.notify notification: param 4 is invalid"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
memcpy(merkle_root + 32, buf.data(), 32);
|
||||||
|
sha256d(merkle_root, merkle_root, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
s << Cvt::toHex(merkle_root, 32);
|
||||||
|
|
||||||
|
// ntime
|
||||||
|
m_ntime = arr[7].GetString();
|
||||||
|
s << m_ntime;
|
||||||
|
|
||||||
|
// nbits
|
||||||
|
s << arr[6].GetString();
|
||||||
|
|
||||||
|
blob = s.str();
|
||||||
|
|
||||||
|
if (blob.size() != 76 * 2) {
|
||||||
|
LOG_ERR("%s " RED("invalid mining.notify notification: invalid blob size"), tag());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// zeros up to 80 bytes
|
||||||
|
blob.resize(80 * 2, '0');
|
||||||
|
|
||||||
|
// Invert byte order (no idea why, but it's done in Bitcoin's Stratum)
|
||||||
|
buf = Cvt::fromHex(blob.c_str(), blob.length());
|
||||||
|
for (size_t i = 0; i < 80; i += sizeof(uint32_t)) {
|
||||||
|
uint32_t& k = *reinterpret_cast<uint32_t*>(buf.data() + i);
|
||||||
|
if ((i < 36) || (i >= 68)) {
|
||||||
|
k = ethash_swap_u32(k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
blob = Cvt::toHex(buf.data(), buf.size());
|
||||||
|
|
||||||
|
job.setBlob(blob.c_str());
|
||||||
|
job.setDiff(m_nextDifficulty);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
// header hash (32 bytes)
|
||||||
|
s << arr[1].GetString();
|
||||||
|
|
||||||
std::string blob = s.str();
|
// nonce template (8 bytes)
|
||||||
|
for (uint64_t i = 0, k = m_extraNonce.first; i < sizeof(m_extraNonce.first); ++i, k >>= 8) {
|
||||||
|
s << std::hex << std::setw(2) << std::setfill('0') << (k & 0xFF);
|
||||||
|
}
|
||||||
|
|
||||||
// zeros up to 76 bytes
|
std::string blob = s.str();
|
||||||
blob.resize(76 * 2, '0');
|
|
||||||
job.setBlob(blob.c_str());
|
|
||||||
|
|
||||||
std::string target_str = arr[3].GetString();
|
// zeros up to 76 bytes
|
||||||
target_str.resize(16, '0');
|
blob.resize(76 * 2, '0');
|
||||||
const uint64_t target = strtoull(target_str.c_str(), nullptr, 16);
|
job.setBlob(blob.c_str());
|
||||||
job.setDiff(Job::toDiff(target));
|
|
||||||
|
|
||||||
job.setHeight(arr[5].GetUint64());
|
std::string target_str = arr[3].GetString();
|
||||||
|
target_str.resize(16, '0');
|
||||||
|
const uint64_t target = strtoull(target_str.c_str(), nullptr, 16);
|
||||||
|
job.setDiff(Job::toDiff(target));
|
||||||
|
|
||||||
|
job.setHeight(arr[5].GetUint64());
|
||||||
|
}
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
m_listener->onVerifyAlgorithm(this, algo, &ok);
|
m_listener->onVerifyAlgorithm(this, algo, &ok);
|
||||||
@@ -301,8 +471,8 @@ void xmrig::EthStratumClient::authorize()
|
|||||||
auto &allocator = doc.GetAllocator();
|
auto &allocator = doc.GetAllocator();
|
||||||
|
|
||||||
Value params(kArrayType);
|
Value params(kArrayType);
|
||||||
params.PushBack(m_pool.user().toJSON(), allocator);
|
params.PushBack(m_user.toJSON(), allocator);
|
||||||
params.PushBack(m_pool.password().toJSON(), allocator);
|
params.PushBack(m_password.toJSON(), allocator);
|
||||||
|
|
||||||
JsonRequest::create(doc, m_sequence, "mining.authorize", params);
|
JsonRequest::create(doc, m_sequence, "mining.authorize", params);
|
||||||
|
|
||||||
@@ -356,11 +526,19 @@ void xmrig::EthStratumClient::onSubscribeResponse(const rapidjson::Value &result
|
|||||||
throw std::runtime_error("invalid mining.subscribe response: result is not an array");
|
throw std::runtime_error("invalid mining.subscribe response: result is not an array");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.GetArray().Size() <= 1) {
|
auto arr = result.GetArray();
|
||||||
|
|
||||||
|
if (arr.Size() <= 1) {
|
||||||
throw std::runtime_error("invalid mining.subscribe response: result array is too short");
|
throw std::runtime_error("invalid mining.subscribe response: result array is too short");
|
||||||
}
|
}
|
||||||
|
|
||||||
setExtraNonce(result.GetArray()[1]);
|
setExtraNonce(arr[1]);
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if ((arr.Size() > 2) && (arr[2].IsUint())) {
|
||||||
|
m_extraNonce2Size = arr[2].GetUint();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
if (m_pool.isNicehash()) {
|
if (m_pool.isNicehash()) {
|
||||||
using namespace rapidjson;
|
using namespace rapidjson;
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ private:
|
|||||||
|
|
||||||
bool m_authorized = false;
|
bool m_authorized = false;
|
||||||
std::pair<uint64_t, String> m_extraNonce{};
|
std::pair<uint64_t, String> m_extraNonce{};
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
uint64_t m_extraNonce2Size = 0;
|
||||||
|
uint64_t m_nextDifficulty = 0;
|
||||||
|
String m_ntime;
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ xmrig::Job::Job(bool nicehash, const Algorithm &algorithm, const String &clientI
|
|||||||
|
|
||||||
bool xmrig::Job::isEqual(const Job &other) const
|
bool xmrig::Job::isEqual(const Job &other) const
|
||||||
{
|
{
|
||||||
return m_id == other.m_id && m_clientId == other.m_clientId && memcmp(m_blob, other.m_blob, sizeof(m_blob)) == 0;
|
return m_id == other.m_id && m_clientId == other.m_clientId && memcmp(m_blob, other.m_blob, sizeof(m_blob)) == 0 && m_target == other.m_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public:
|
|||||||
inline const String &poolWallet() const { return m_poolWallet; }
|
inline const String &poolWallet() const { return m_poolWallet; }
|
||||||
inline const uint32_t *nonce() const { return reinterpret_cast<const uint32_t*>(m_blob + nonceOffset()); }
|
inline const uint32_t *nonce() const { return reinterpret_cast<const uint32_t*>(m_blob + nonceOffset()); }
|
||||||
inline const uint8_t *blob() const { return m_blob; }
|
inline const uint8_t *blob() const { return m_blob; }
|
||||||
inline int32_t nonceOffset() const { return (algorithm().family() == Algorithm::KAWPOW) ? 32 : 39; }
|
inline int32_t nonceOffset() const { auto f = algorithm().family(); return (f == Algorithm::KAWPOW) ? 32 : ((f == Algorithm::GHOSTRIDER) ? 76 : 39); }
|
||||||
inline size_t nonceSize() const { return (algorithm().family() == Algorithm::KAWPOW) ? 8 : 4; }
|
inline size_t nonceSize() const { return (algorithm().family() == Algorithm::KAWPOW) ? 8 : 4; }
|
||||||
inline size_t size() const { return m_size; }
|
inline size_t size() const { return m_size; }
|
||||||
inline uint32_t *nonce() { return reinterpret_cast<uint32_t*>(m_blob + nonceOffset()); }
|
inline uint32_t *nonce() { return reinterpret_cast<uint32_t*>(m_blob + nonceOffset()); }
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#include "base/kernel/Platform.h"
|
#include "base/kernel/Platform.h"
|
||||||
#include "base/net/stratum/Client.h"
|
#include "base/net/stratum/Client.h"
|
||||||
|
|
||||||
#ifdef XMRIG_ALGO_KAWPOW
|
#if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
|
||||||
# include "base/net/stratum/AutoClient.h"
|
# include "base/net/stratum/AutoClient.h"
|
||||||
# include "base/net/stratum/EthStratumClient.h"
|
# include "base/net/stratum/EthStratumClient.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -218,8 +218,9 @@ xmrig::IClient *xmrig::Pool::createClient(int id, IClientListener *listener) con
|
|||||||
IClient *client = nullptr;
|
IClient *client = nullptr;
|
||||||
|
|
||||||
if (m_mode == MODE_POOL) {
|
if (m_mode == MODE_POOL) {
|
||||||
# ifdef XMRIG_ALGO_KAWPOW
|
# if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
|
||||||
if ((m_algorithm.family() == Algorithm::KAWPOW) || (m_coin == Coin::RAVEN)) {
|
const uint32_t f = m_algorithm.family();
|
||||||
|
if ((f == Algorithm::KAWPOW) || (f == Algorithm::GHOSTRIDER) || (m_coin == Coin::RAVEN)) {
|
||||||
client = new EthStratumClient(id, Platform::userAgent(), listener);
|
client = new EthStratumClient(id, Platform::userAgent(), listener);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -236,7 +237,7 @@ xmrig::IClient *xmrig::Pool::createClient(int id, IClientListener *listener) con
|
|||||||
client = new SelfSelectClient(id, Platform::userAgent(), listener, m_submitToOrigin);
|
client = new SelfSelectClient(id, Platform::userAgent(), listener, m_submitToOrigin);
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
# ifdef XMRIG_ALGO_KAWPOW
|
# if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
|
||||||
else if (m_mode == MODE_AUTO_ETH) {
|
else if (m_mode == MODE_AUTO_ETH) {
|
||||||
client = new AutoClient(id, Platform::userAgent(), listener);
|
client = new AutoClient(id, Platform::userAgent(), listener);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,7 @@ public:
|
|||||||
inline int zmq_port() const { return m_zmqPort; }
|
inline int zmq_port() const { return m_zmqPort; }
|
||||||
inline uint64_t pollInterval() const { return m_pollInterval; }
|
inline uint64_t pollInterval() const { return m_pollInterval; }
|
||||||
inline void setAlgo(const Algorithm &algorithm) { m_algorithm = algorithm; }
|
inline void setAlgo(const Algorithm &algorithm) { m_algorithm = algorithm; }
|
||||||
|
inline void setUrl(const char *url) { m_url = Url(url); }
|
||||||
inline void setPassword(const String &password) { m_password = password; }
|
inline void setPassword(const String &password) { m_password = password; }
|
||||||
inline void setProxy(const ProxyUrl &proxy) { m_proxy = proxy; }
|
inline void setProxy(const ProxyUrl &proxy) { m_proxy = proxy; }
|
||||||
inline void setRigId(const String &rigId) { m_rigId = rigId; }
|
inline void setRigId(const String &rigId) { m_rigId = rigId; }
|
||||||
|
|||||||
@@ -72,7 +72,14 @@ int64_t xmrig::SelfSelectClient::submit(const JobResult &result)
|
|||||||
submitOriginDaemon(result);
|
submitOriginDaemon(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_client->submit(result);
|
uint64_t submit_result = m_client->submit(result);
|
||||||
|
|
||||||
|
if (m_submitToOrigin) {
|
||||||
|
// Ensure that the latest block template is available after block submission
|
||||||
|
getBlockTemplate();
|
||||||
|
}
|
||||||
|
|
||||||
|
return submit_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -285,9 +292,6 @@ void xmrig::SelfSelectClient::submitOriginDaemon(const JobResult& result)
|
|||||||
LOG_INFO("%s " GREEN_BOLD("submitted to origin daemon") " (%" PRId64 "/%" PRId64 ") "
|
LOG_INFO("%s " GREEN_BOLD("submitted to origin daemon") " (%" PRId64 "/%" PRId64 ") "
|
||||||
" diff " WHITE("%" PRIu64) " vs. " WHITE("%" PRIu64),
|
" diff " WHITE("%" PRIu64) " vs. " WHITE("%" PRIu64),
|
||||||
Tags::origin(), m_originSubmitted, m_originNotSubmitted, m_blockDiff, result.actualDiff(), result.diff);
|
Tags::origin(), m_originSubmitted, m_originNotSubmitted, m_blockDiff, result.actualDiff(), result.diff);
|
||||||
|
|
||||||
// Ensure that the latest block template is available after block submission
|
|
||||||
getBlockTemplate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void xmrig::SelfSelectClient::onHttpData(const HttpData &data)
|
void xmrig::SelfSelectClient::onHttpData(const HttpData &data)
|
||||||
|
|||||||
@@ -48,6 +48,40 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
|
|||||||
std::vector<char> blob(112 * 2 + 1, '0');
|
std::vector<char> blob(112 * 2 + 1, '0');
|
||||||
blob.back() = '\0';
|
blob.back() = '\0';
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (m_benchmark->algorithm() == Algorithm::GHOSTRIDER_RTM) {
|
||||||
|
const uint32_t q = (benchmark->rotation() / 20) & 1;
|
||||||
|
const uint32_t r = benchmark->rotation() % 20;
|
||||||
|
|
||||||
|
static constexpr uint32_t indices[20][3] = {
|
||||||
|
{ 0, 1, 2 },
|
||||||
|
{ 0, 1, 3 },
|
||||||
|
{ 0, 1, 4 },
|
||||||
|
{ 0, 1, 5 },
|
||||||
|
{ 0, 2, 3 },
|
||||||
|
{ 0, 2, 4 },
|
||||||
|
{ 0, 2, 5 },
|
||||||
|
{ 0, 3, 4 },
|
||||||
|
{ 0, 3, 5 },
|
||||||
|
{ 0, 4, 5 },
|
||||||
|
{ 1, 2, 3 },
|
||||||
|
{ 1, 2, 4 },
|
||||||
|
{ 1, 2, 5 },
|
||||||
|
{ 1, 3, 4 },
|
||||||
|
{ 1, 3, 5 },
|
||||||
|
{ 1, 4, 5 },
|
||||||
|
{ 2, 3, 4 },
|
||||||
|
{ 2, 3, 5 },
|
||||||
|
{ 2, 4, 5 },
|
||||||
|
{ 3, 4, 5 },
|
||||||
|
};
|
||||||
|
|
||||||
|
blob[ 8] = '0' + indices[r][q ? 2 : 1];
|
||||||
|
blob[ 9] = '0' + indices[r][0];
|
||||||
|
blob[11] = '0' + indices[r][q ? 1 : 2];
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
m_job.setAlgorithm(m_benchmark->algorithm());
|
m_job.setAlgorithm(m_benchmark->algorithm());
|
||||||
m_job.setBlob(blob.data());
|
m_job.setBlob(blob.data());
|
||||||
m_job.setDiff(std::numeric_limits<uint64_t>::max());
|
m_job.setDiff(std::numeric_limits<uint64_t>::max());
|
||||||
@@ -60,7 +94,7 @@ xmrig::BenchClient::BenchClient(const std::shared_ptr<BenchConfig> &benchmark, I
|
|||||||
BenchState::init(this, m_benchmark->size());
|
BenchState::init(this, m_benchmark->size());
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HTTP
|
# ifdef XMRIG_FEATURE_HTTP
|
||||||
if (m_benchmark->isSubmit()) {
|
if (m_benchmark->isSubmit() && (m_benchmark->algorithm().family() == Algorithm::RANDOM_X)) {
|
||||||
m_mode = ONLINE_BENCH;
|
m_mode = ONLINE_BENCH;
|
||||||
m_token = m_benchmark->token();
|
m_token = m_benchmark->token();
|
||||||
|
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ const char *BenchConfig::kHash = "hash";
|
|||||||
const char *BenchConfig::kId = "id";
|
const char *BenchConfig::kId = "id";
|
||||||
const char *BenchConfig::kSeed = "seed";
|
const char *BenchConfig::kSeed = "seed";
|
||||||
const char *BenchConfig::kSize = "size";
|
const char *BenchConfig::kSize = "size";
|
||||||
|
const char *BenchConfig::kRotation = "rotation";
|
||||||
const char *BenchConfig::kSubmit = "submit";
|
const char *BenchConfig::kSubmit = "submit";
|
||||||
const char *BenchConfig::kToken = "token";
|
const char *BenchConfig::kToken = "token";
|
||||||
const char *BenchConfig::kUser = "user";
|
const char *BenchConfig::kUser = "user";
|
||||||
@@ -53,7 +54,7 @@ const char *BenchConfig::kApiHost = "127.0.0.1";
|
|||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
xmrig::BenchConfig::BenchConfig(uint32_t size, const String &id, const rapidjson::Value &object, bool dmi) :
|
xmrig::BenchConfig::BenchConfig(uint32_t size, const String &id, const rapidjson::Value &object, bool dmi, uint32_t rotation) :
|
||||||
m_algorithm(Json::getString(object, kAlgo)),
|
m_algorithm(Json::getString(object, kAlgo)),
|
||||||
m_dmi(dmi),
|
m_dmi(dmi),
|
||||||
m_submit(Json::getBool(object, kSubmit)),
|
m_submit(Json::getBool(object, kSubmit)),
|
||||||
@@ -61,9 +62,15 @@ xmrig::BenchConfig::BenchConfig(uint32_t size, const String &id, const rapidjson
|
|||||||
m_seed(Json::getString(object, kSeed)),
|
m_seed(Json::getString(object, kSeed)),
|
||||||
m_token(Json::getString(object, kToken)),
|
m_token(Json::getString(object, kToken)),
|
||||||
m_user(Json::getString(object, kUser)),
|
m_user(Json::getString(object, kUser)),
|
||||||
m_size(size)
|
m_size(size),
|
||||||
|
m_rotation(rotation)
|
||||||
{
|
{
|
||||||
if (!m_algorithm.isValid() || m_algorithm.family() != Algorithm::RANDOM_X) {
|
auto f = m_algorithm.family();
|
||||||
|
if (!m_algorithm.isValid() || (f != Algorithm::RANDOM_X
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
&& f != Algorithm::GHOSTRIDER
|
||||||
|
# endif
|
||||||
|
)) {
|
||||||
m_algorithm = Algorithm::RX_0;
|
m_algorithm = Algorithm::RX_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,14 +87,17 @@ xmrig::BenchConfig *xmrig::BenchConfig::create(const rapidjson::Value &object, b
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint32_t size = getSize(Json::getString(object, kSize));
|
const uint32_t size = getSize(Json::getString(object, kSize));
|
||||||
const String id = Json::getString(object, kVerify);
|
const String id = Json::getString(object, kVerify);
|
||||||
|
|
||||||
|
const char* rotation_str = Json::getString(object, kRotation);
|
||||||
|
const uint32_t rotation = rotation_str ? strtoul(rotation_str, nullptr, 10) : 0;
|
||||||
|
|
||||||
if (size == 0 && id.isEmpty()) {
|
if (size == 0 && id.isEmpty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new BenchConfig(size, id, object, dmi);
|
return new BenchConfig(size, id, object, dmi, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public:
|
|||||||
static const char *kId;
|
static const char *kId;
|
||||||
static const char *kSeed;
|
static const char *kSeed;
|
||||||
static const char *kSize;
|
static const char *kSize;
|
||||||
|
static const char* kRotation;
|
||||||
static const char *kSubmit;
|
static const char *kSubmit;
|
||||||
static const char *kToken;
|
static const char *kToken;
|
||||||
static const char *kUser;
|
static const char *kUser;
|
||||||
@@ -50,7 +51,7 @@ public:
|
|||||||
static constexpr const uint16_t kApiPort = 18805;
|
static constexpr const uint16_t kApiPort = 18805;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
BenchConfig(uint32_t size, const String &id, const rapidjson::Value &object, bool dmi);
|
BenchConfig(uint32_t size, const String &id, const rapidjson::Value &object, bool dmi, uint32_t rotation);
|
||||||
|
|
||||||
static BenchConfig *create(const rapidjson::Value &object, bool dmi);
|
static BenchConfig *create(const rapidjson::Value &object, bool dmi);
|
||||||
|
|
||||||
@@ -63,6 +64,7 @@ public:
|
|||||||
inline const String &user() const { return m_user; }
|
inline const String &user() const { return m_user; }
|
||||||
inline uint32_t size() const { return m_size; }
|
inline uint32_t size() const { return m_size; }
|
||||||
inline uint64_t hash() const { return m_hash; }
|
inline uint64_t hash() const { return m_hash; }
|
||||||
|
inline uint32_t rotation() const { return m_rotation; }
|
||||||
|
|
||||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||||
|
|
||||||
@@ -77,6 +79,7 @@ private:
|
|||||||
String m_token;
|
String m_token;
|
||||||
String m_user;
|
String m_user;
|
||||||
uint32_t m_size;
|
uint32_t m_size;
|
||||||
|
uint32_t m_rotation;
|
||||||
uint64_t m_hash = 0;
|
uint64_t m_hash = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
44
src/base/tools/Chrono.cpp
Normal file
44
src/base/tools/Chrono.cpp
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
/* XMRig
|
||||||
|
* Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh>
|
||||||
|
* Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "Chrono.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_OS_WIN
|
||||||
|
# include <Windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
double Chrono::highResolutionMSecs()
|
||||||
|
{
|
||||||
|
# ifdef XMRIG_OS_WIN
|
||||||
|
LARGE_INTEGER f, t;
|
||||||
|
QueryPerformanceFrequency(&f);
|
||||||
|
QueryPerformanceCounter(&t);
|
||||||
|
return static_cast<double>(t.QuadPart) * 1e3 / f.QuadPart;
|
||||||
|
# else
|
||||||
|
using namespace std::chrono;
|
||||||
|
return static_cast<uint64_t>(duration_cast<nanoseconds>(high_resolution_clock::now().time_since_epoch()).count()) / 1e6;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} /* namespace xmrig */
|
||||||
@@ -29,12 +29,7 @@ namespace xmrig {
|
|||||||
class Chrono
|
class Chrono
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static inline uint64_t highResolutionMSecs()
|
static double highResolutionMSecs();
|
||||||
{
|
|
||||||
using namespace std::chrono;
|
|
||||||
|
|
||||||
return static_cast<uint64_t>(time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static inline uint64_t steadyMSecs()
|
static inline uint64_t steadyMSecs()
|
||||||
|
|||||||
@@ -244,7 +244,9 @@ bool xmrig::BlockTemplate::parse(bool hashes)
|
|||||||
ar.skip(m_extraSize);
|
ar.skip(m_extraSize);
|
||||||
|
|
||||||
while (ar_extra.index() < m_extraSize) {
|
while (ar_extra.index() < m_extraSize) {
|
||||||
uint64_t extra_tag = 0;
|
uint64_t extra_tag = 0;
|
||||||
|
uint64_t size = 0;
|
||||||
|
|
||||||
ar_extra(extra_tag);
|
ar_extra(extra_tag);
|
||||||
|
|
||||||
switch (extra_tag) {
|
switch (extra_tag) {
|
||||||
@@ -254,12 +256,15 @@ bool xmrig::BlockTemplate::parse(bool hashes)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x02: // TX_EXTRA_NONCE
|
case 0x02: // TX_EXTRA_NONCE
|
||||||
{
|
ar_extra(size);
|
||||||
uint64_t size = 0;
|
setOffset(TX_EXTRA_NONCE_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
|
||||||
ar_extra(size);
|
ar_extra(m_txExtraNonce, size);
|
||||||
setOffset(TX_EXTRA_NONCE_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
|
break;
|
||||||
ar_extra(m_txExtraNonce, size);
|
|
||||||
}
|
case 0x03: // TX_EXTRA_MERGE_MINING_TAG
|
||||||
|
ar_extra(size);
|
||||||
|
setOffset(TX_EXTRA_MERGE_MINING_TAG_OFFSET, offset(TX_EXTRA_OFFSET) + ar_extra.index());
|
||||||
|
ar_extra(m_txMergeMiningTag, size + kKeySize);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ public:
|
|||||||
TX_EXTRA_OFFSET,
|
TX_EXTRA_OFFSET,
|
||||||
TX_PUBKEY_OFFSET,
|
TX_PUBKEY_OFFSET,
|
||||||
TX_EXTRA_NONCE_OFFSET,
|
TX_EXTRA_NONCE_OFFSET,
|
||||||
|
TX_EXTRA_MERGE_MINING_TAG_OFFSET,
|
||||||
OFFSET_COUNT
|
OFFSET_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -86,6 +87,7 @@ public:
|
|||||||
inline uint64_t outputType() const { return m_outputType; }
|
inline uint64_t outputType() const { return m_outputType; }
|
||||||
inline const Span &ephPublicKey() const { return m_ephPublicKey; }
|
inline const Span &ephPublicKey() const { return m_ephPublicKey; }
|
||||||
inline const Span &txExtraNonce() const { return m_txExtraNonce; }
|
inline const Span &txExtraNonce() const { return m_txExtraNonce; }
|
||||||
|
inline const Span &txMergeMiningTag() const { return m_txMergeMiningTag; }
|
||||||
|
|
||||||
// Transaction hashes
|
// Transaction hashes
|
||||||
inline uint64_t numHashes() const { return m_numHashes; }
|
inline uint64_t numHashes() const { return m_numHashes; }
|
||||||
@@ -140,7 +142,7 @@ private:
|
|||||||
Span m_ephPublicKey;
|
Span m_ephPublicKey;
|
||||||
uint64_t m_extraSize = 0;
|
uint64_t m_extraSize = 0;
|
||||||
Span m_txExtraNonce;
|
Span m_txExtraNonce;
|
||||||
|
Span m_txMergeMiningTag = 0;
|
||||||
uint64_t m_numHashes = 0;
|
uint64_t m_numHashes = 0;
|
||||||
Buffer m_hashes;
|
Buffer m_hashes;
|
||||||
Buffer m_minerTxMerkleTreeBranch;
|
Buffer m_minerTxMerkleTreeBranch;
|
||||||
|
|||||||
@@ -94,6 +94,10 @@
|
|||||||
"ciphersuites": null,
|
"ciphersuites": null,
|
||||||
"dhparam": null
|
"dhparam": null
|
||||||
},
|
},
|
||||||
|
"dns": {
|
||||||
|
"ipv6": false,
|
||||||
|
"ttl": 30
|
||||||
|
},
|
||||||
"user-agent": null,
|
"user-agent": null,
|
||||||
"verbose": 0,
|
"verbose": 0,
|
||||||
"watch": true,
|
"watch": true,
|
||||||
|
|||||||
@@ -67,6 +67,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
# include "crypto/ghostrider/ghostrider.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
@@ -282,10 +287,12 @@ public:
|
|||||||
|
|
||||||
void printHashrate(bool details)
|
void printHashrate(bool details)
|
||||||
{
|
{
|
||||||
char num[16 * 4] = { 0 };
|
char num[16 * 5] = { 0 };
|
||||||
double speed[3] = { 0.0 };
|
double speed[3] = { 0.0 };
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
|
|
||||||
|
double avg_hashrate = 0.0;
|
||||||
|
|
||||||
for (auto backend : backends) {
|
for (auto backend : backends) {
|
||||||
const auto hashrate = backend->hashrate();
|
const auto hashrate = backend->hashrate();
|
||||||
if (hashrate) {
|
if (hashrate) {
|
||||||
@@ -294,6 +301,8 @@ public:
|
|||||||
speed[0] += hashrate->calc(Hashrate::ShortInterval);
|
speed[0] += hashrate->calc(Hashrate::ShortInterval);
|
||||||
speed[1] += hashrate->calc(Hashrate::MediumInterval);
|
speed[1] += hashrate->calc(Hashrate::MediumInterval);
|
||||||
speed[2] += hashrate->calc(Hashrate::LargeInterval);
|
speed[2] += hashrate->calc(Hashrate::LargeInterval);
|
||||||
|
|
||||||
|
avg_hashrate += hashrate->average();
|
||||||
}
|
}
|
||||||
|
|
||||||
backend->printHashrate(details);
|
backend->printHashrate(details);
|
||||||
@@ -313,12 +322,22 @@ public:
|
|||||||
h = "MH/s";
|
h = "MH/s";
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_INFO("%s " WHITE_BOLD("speed") " 10s/60s/15m " CYAN_BOLD("%s") CYAN(" %s %s ") CYAN_BOLD("%s") " max " CYAN_BOLD("%s %s"),
|
char avg_hashrate_buf[64];
|
||||||
|
avg_hashrate_buf[0] = '\0';
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (algorithm.family() == Algorithm::GHOSTRIDER) {
|
||||||
|
snprintf(avg_hashrate_buf, sizeof(avg_hashrate_buf), " avg " CYAN_BOLD("%s %s"), Hashrate::format(avg_hashrate * scale, num + 16 * 4, 16), h);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
LOG_INFO("%s " WHITE_BOLD("speed") " 10s/60s/15m " CYAN_BOLD("%s") CYAN(" %s %s ") CYAN_BOLD("%s") " max " CYAN_BOLD("%s %s") "%s",
|
||||||
Tags::miner(),
|
Tags::miner(),
|
||||||
Hashrate::format(speed[0] * scale, num, sizeof(num) / 4),
|
Hashrate::format(speed[0] * scale, num, 16),
|
||||||
Hashrate::format(speed[1] * scale, num + 16, sizeof(num) / 4),
|
Hashrate::format(speed[1] * scale, num + 16, 16),
|
||||||
Hashrate::format(speed[2] * scale, num + 16 * 2, sizeof(num) / 4), h,
|
Hashrate::format(speed[2] * scale, num + 16 * 2, 16), h,
|
||||||
Hashrate::format(maxHashrate[algorithm] * scale, num + 16 * 3, sizeof(num) / 4), h
|
Hashrate::format(maxHashrate[algorithm] * scale, num + 16 * 3, 16), h,
|
||||||
|
avg_hashrate_buf
|
||||||
);
|
);
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||||
@@ -334,6 +353,11 @@ public:
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
inline void initGhostRider() const { ghostrider::benchmark(); }
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
Algorithm algorithm;
|
Algorithm algorithm;
|
||||||
Algorithms algorithms;
|
Algorithms algorithms;
|
||||||
bool active = false;
|
bool active = false;
|
||||||
@@ -529,7 +553,13 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
|
|||||||
|
|
||||||
# ifdef XMRIG_ALGO_RANDOMX
|
# ifdef XMRIG_ALGO_RANDOMX
|
||||||
if (job.algorithm().family() == Algorithm::RANDOM_X && !Rx::isReady(job)) {
|
if (job.algorithm().family() == Algorithm::RANDOM_X && !Rx::isReady(job)) {
|
||||||
stop();
|
if (d_ptr->algorithm != job.algorithm()) {
|
||||||
|
stop();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Nonce::pause(true);
|
||||||
|
Nonce::touch();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -553,6 +583,12 @@ void xmrig::Miner::setJob(const Job &job, bool donate)
|
|||||||
constexpr const bool ready = true;
|
constexpr const bool ready = true;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (job.algorithm().family() == Algorithm::GHOSTRIDER) {
|
||||||
|
d_ptr->initGhostRider();
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
mutex.unlock();
|
mutex.unlock();
|
||||||
|
|
||||||
d_ptr->active = true;
|
d_ptr->active = true;
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ void xmrig::ConfigTransform::finalize(rapidjson::Document &doc)
|
|||||||
profile.AddMember(StringRef(kThreads), m_threads, allocator);
|
profile.AddMember(StringRef(kThreads), m_threads, allocator);
|
||||||
profile.AddMember(StringRef(kAffinity), m_affinity, allocator);
|
profile.AddMember(StringRef(kAffinity), m_affinity, allocator);
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_KAWPOW
|
||||||
doc[CpuConfig::kField].AddMember(StringRef(Algorithm::kKAWPOW), false, doc.GetAllocator());
|
doc[CpuConfig::kField].AddMember(StringRef(Algorithm::kKAWPOW), false, doc.GetAllocator());
|
||||||
|
# endif
|
||||||
doc[CpuConfig::kField].AddMember(StringRef(kAsterisk), profile, doc.GetAllocator());
|
doc[CpuConfig::kField].AddMember(StringRef(kAsterisk), profile, doc.GetAllocator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,6 +269,7 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
|||||||
case IConfig::BenchSeedKey: /* --seed */
|
case IConfig::BenchSeedKey: /* --seed */
|
||||||
case IConfig::BenchHashKey: /* --hash */
|
case IConfig::BenchHashKey: /* --hash */
|
||||||
case IConfig::UserKey: /* --user */
|
case IConfig::UserKey: /* --user */
|
||||||
|
case IConfig::RotationKey: /* --rotation */
|
||||||
return transformBenchmark(doc, key, arg);
|
return transformBenchmark(doc, key, arg);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
@@ -356,6 +359,9 @@ void xmrig::ConfigTransform::transformBenchmark(rapidjson::Document &doc, int ke
|
|||||||
case IConfig::UserKey: /* --user */
|
case IConfig::UserKey: /* --user */
|
||||||
return set(doc, BenchConfig::kBenchmark, BenchConfig::kUser, arg);
|
return set(doc, BenchConfig::kBenchmark, BenchConfig::kUser, arg);
|
||||||
|
|
||||||
|
case IConfig::RotationKey: /* --rotation */
|
||||||
|
return set(doc, BenchConfig::kBenchmark, BenchConfig::kRotation, arg);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ static const option options[] = {
|
|||||||
{ "hugepage-size", 1, nullptr, IConfig::HugePageSizeKey },
|
{ "hugepage-size", 1, nullptr, IConfig::HugePageSizeKey },
|
||||||
{ "huge-pages-jit", 0, nullptr, IConfig::HugePagesJitKey },
|
{ "huge-pages-jit", 0, nullptr, IConfig::HugePagesJitKey },
|
||||||
{ "hugepages-jit", 0, nullptr, IConfig::HugePagesJitKey },
|
{ "hugepages-jit", 0, nullptr, IConfig::HugePagesJitKey },
|
||||||
|
{ "rotation", 1, nullptr, IConfig::RotationKey },
|
||||||
{ "pass", 1, nullptr, IConfig::PasswordKey },
|
{ "pass", 1, nullptr, IConfig::PasswordKey },
|
||||||
{ "print-time", 1, nullptr, IConfig::PrintTimeKey },
|
{ "print-time", 1, nullptr, IConfig::PrintTimeKey },
|
||||||
{ "retries", 1, nullptr, IConfig::RetriesKey },
|
{ "retries", 1, nullptr, IConfig::RetriesKey },
|
||||||
|
|||||||
@@ -86,15 +86,54 @@ static void Salsa20_XORKeyStream_AVX256(const void* key, void* output, size_t si
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void sort_indices(int N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indices)
|
static inline bool smaller(const uint8_t* v, uint64_t a, uint64_t b)
|
||||||
|
{
|
||||||
|
const uint64_t value_a = a >> 21;
|
||||||
|
const uint64_t value_b = b >> 21;
|
||||||
|
|
||||||
|
if (value_a < value_b) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value_a > value_b) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
a &= (1 << 21) - 1;
|
||||||
|
b &= (1 << 21) - 1;
|
||||||
|
|
||||||
|
if (a == b) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint64_t data_a = bswap_64(*reinterpret_cast<const uint64_t*>(v + a + 5));
|
||||||
|
const uint64_t data_b = bswap_64(*reinterpret_cast<const uint64_t*>(v + b + 5));
|
||||||
|
return (data_a < data_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sort_indices(uint32_t N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indices)
|
||||||
{
|
{
|
||||||
uint32_t counters[2][COUNTING_SORT_SIZE] = {};
|
uint32_t counters[2][COUNTING_SORT_SIZE] = {};
|
||||||
|
|
||||||
for (int i = 0; i < N; ++i)
|
|
||||||
{
|
{
|
||||||
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i));
|
#define ITER(X) \
|
||||||
++counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)];
|
do { \
|
||||||
++counters[1][k >> (64 - COUNTING_SORT_BITS)];
|
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i + X)); \
|
||||||
|
++counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)]; \
|
||||||
|
++counters[1][k >> (64 - COUNTING_SORT_BITS)]; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
uint32_t i = 0;
|
||||||
|
const uint32_t n = N - 15;
|
||||||
|
for (; i < n; i += 16) {
|
||||||
|
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
|
||||||
|
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
|
||||||
|
}
|
||||||
|
for (; i < N; ++i) {
|
||||||
|
ITER(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef ITER
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t prev[2] = { counters[0][0], counters[1][0] };
|
uint32_t prev[2] = { counters[0][0], counters[1][0] };
|
||||||
@@ -109,41 +148,47 @@ void sort_indices(int N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indi
|
|||||||
prev[1] = cur[1];
|
prev[1] = cur[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = N - 1; i >= 0; --i)
|
|
||||||
{
|
{
|
||||||
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i));
|
#define ITER(X) \
|
||||||
tmp_indices[counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)]--] = (k & (static_cast<uint64_t>(-1) << 21)) | i;
|
do { \
|
||||||
}
|
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + (i - X))); \
|
||||||
|
tmp_indices[counters[0][(k >> (64 - COUNTING_SORT_BITS * 2)) & (COUNTING_SORT_SIZE - 1)]--] = (k & (static_cast<uint64_t>(-1) << 21)) | (i - X); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
for (int i = N - 1; i >= 0; --i)
|
uint32_t i = N;
|
||||||
{
|
for (; i >= 8; i -= 8) {
|
||||||
const uint64_t data = tmp_indices[i];
|
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
|
||||||
indices[counters[1][data >> (64 - COUNTING_SORT_BITS)]--] = data;
|
}
|
||||||
}
|
for (; i > 0; --i) {
|
||||||
|
ITER(1);
|
||||||
auto smaller = [v](uint64_t a, uint64_t b)
|
|
||||||
{
|
|
||||||
const uint64_t value_a = a >> 21;
|
|
||||||
const uint64_t value_b = b >> 21;
|
|
||||||
|
|
||||||
if (value_a < value_b) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value_a > value_b) {
|
#undef ITER
|
||||||
return false;
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
#define ITER(X) \
|
||||||
|
do { \
|
||||||
|
const uint64_t data = tmp_indices[i - X]; \
|
||||||
|
indices[counters[1][data >> (64 - COUNTING_SORT_BITS)]--] = data; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
uint32_t i = N;
|
||||||
|
for (; i >= 8; i -= 8) {
|
||||||
|
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
|
||||||
|
}
|
||||||
|
for (; i > 0; --i) {
|
||||||
|
ITER(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint64_t data_a = bswap_64(*reinterpret_cast<const uint64_t*>(v + (a % (1 << 21)) + 5));
|
#undef ITER
|
||||||
const uint64_t data_b = bswap_64(*reinterpret_cast<const uint64_t*>(v + (b % (1 << 21)) + 5));
|
}
|
||||||
return (data_a < data_b);
|
|
||||||
};
|
|
||||||
|
|
||||||
uint64_t prev_t = indices[0];
|
uint64_t prev_t = indices[0];
|
||||||
for (int i = 1; i < N; ++i)
|
for (uint32_t i = 1; i < N; ++i)
|
||||||
{
|
{
|
||||||
uint64_t t = indices[i];
|
uint64_t t = indices[i];
|
||||||
if (smaller(t, prev_t))
|
if (smaller(v, t, prev_t))
|
||||||
{
|
{
|
||||||
const uint64_t t2 = prev_t;
|
const uint64_t t2 = prev_t;
|
||||||
int j = i - 1;
|
int j = i - 1;
|
||||||
@@ -157,7 +202,7 @@ void sort_indices(int N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indi
|
|||||||
}
|
}
|
||||||
|
|
||||||
prev_t = indices[j];
|
prev_t = indices[j];
|
||||||
} while (smaller(t, prev_t));
|
} while (smaller(v, t, prev_t));
|
||||||
indices[j + 1] = t;
|
indices[j + 1] = t;
|
||||||
t = t2;
|
t = t2;
|
||||||
}
|
}
|
||||||
@@ -165,6 +210,144 @@ void sort_indices(int N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sort_indices2(uint32_t N, const uint8_t* v, uint64_t* indices, uint64_t* tmp_indices)
|
||||||
|
{
|
||||||
|
alignas(16) uint32_t counters[1 << COUNTING_SORT_BITS] = {};
|
||||||
|
alignas(16) uint32_t counters2[1 << COUNTING_SORT_BITS];
|
||||||
|
|
||||||
|
{
|
||||||
|
#define ITER(X) { \
|
||||||
|
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + i + X)); \
|
||||||
|
++counters[k >> (64 - COUNTING_SORT_BITS)]; \
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t i = 0;
|
||||||
|
const uint32_t n = (N / 32) * 32;
|
||||||
|
for (; i < n; i += 32) {
|
||||||
|
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
|
||||||
|
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
|
||||||
|
ITER(16); ITER(17); ITER(18); ITER(19); ITER(20); ITER(21); ITER(22); ITER(23);
|
||||||
|
ITER(24); ITER(25); ITER(26); ITER(27); ITER(28); ITER(29); ITER(30); ITER(31);
|
||||||
|
}
|
||||||
|
for (; i < N; ++i) {
|
||||||
|
ITER(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef ITER
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t prev = static_cast<uint32_t>(-1);
|
||||||
|
for (uint32_t i = 0; i < (1 << COUNTING_SORT_BITS); i += 16)
|
||||||
|
{
|
||||||
|
#define ITER(X) { \
|
||||||
|
const uint32_t cur = counters[i + X] + prev; \
|
||||||
|
counters[i + X] = cur; \
|
||||||
|
counters2[i + X] = cur; \
|
||||||
|
prev = cur; \
|
||||||
|
}
|
||||||
|
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
|
||||||
|
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
|
||||||
|
#undef ITER
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
#define ITER(X) \
|
||||||
|
do { \
|
||||||
|
const uint64_t k = bswap_64(*reinterpret_cast<const uint64_t*>(v + (i - X))); \
|
||||||
|
indices[counters[k >> (64 - COUNTING_SORT_BITS)]--] = (k & (static_cast<uint64_t>(-1) << 21)) | (i - X); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
uint32_t i = N;
|
||||||
|
for (; i >= 8; i -= 8) {
|
||||||
|
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
|
||||||
|
}
|
||||||
|
for (; i > 0; --i) {
|
||||||
|
ITER(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
#undef ITER
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t prev_i = 0;
|
||||||
|
for (uint32_t i0 = 0; i0 < (1 << COUNTING_SORT_BITS); ++i0) {
|
||||||
|
const uint32_t i = counters2[i0] + 1;
|
||||||
|
const uint32_t n = i - prev_i;
|
||||||
|
if (n > 1) {
|
||||||
|
memset(counters, 0, sizeof(uint32_t) * (1 << COUNTING_SORT_BITS));
|
||||||
|
|
||||||
|
const uint32_t n8 = (n / 8) * 8;
|
||||||
|
uint32_t j = 0;
|
||||||
|
|
||||||
|
#define ITER(X) { \
|
||||||
|
const uint64_t k = indices[prev_i + j + X]; \
|
||||||
|
++counters[(k >> (64 - COUNTING_SORT_BITS * 2)) & ((1 << COUNTING_SORT_BITS) - 1)]; \
|
||||||
|
tmp_indices[j + X] = k; \
|
||||||
|
}
|
||||||
|
for (; j < n8; j += 8) {
|
||||||
|
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
|
||||||
|
}
|
||||||
|
for (; j < n; ++j) {
|
||||||
|
ITER(0);
|
||||||
|
}
|
||||||
|
#undef ITER
|
||||||
|
|
||||||
|
uint32_t prev = static_cast<uint32_t>(-1);
|
||||||
|
for (uint32_t j = 0; j < (1 << COUNTING_SORT_BITS); j += 32)
|
||||||
|
{
|
||||||
|
#define ITER(X) { \
|
||||||
|
const uint32_t cur = counters[j + X] + prev; \
|
||||||
|
counters[j + X] = cur; \
|
||||||
|
prev = cur; \
|
||||||
|
}
|
||||||
|
ITER(0); ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7);
|
||||||
|
ITER(8); ITER(9); ITER(10); ITER(11); ITER(12); ITER(13); ITER(14); ITER(15);
|
||||||
|
ITER(16); ITER(17); ITER(18); ITER(19); ITER(20); ITER(21); ITER(22); ITER(23);
|
||||||
|
ITER(24); ITER(25); ITER(26); ITER(27); ITER(28); ITER(29); ITER(30); ITER(31);
|
||||||
|
#undef ITER
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ITER(X) { \
|
||||||
|
const uint64_t k = tmp_indices[j - X]; \
|
||||||
|
const uint32_t index = counters[(k >> (64 - COUNTING_SORT_BITS * 2)) & ((1 << COUNTING_SORT_BITS) - 1)]--; \
|
||||||
|
indices[prev_i + index] = k; \
|
||||||
|
}
|
||||||
|
for (j = n; j >= 8; j -= 8) {
|
||||||
|
ITER(1); ITER(2); ITER(3); ITER(4); ITER(5); ITER(6); ITER(7); ITER(8);
|
||||||
|
}
|
||||||
|
for (; j > 0; --j) {
|
||||||
|
ITER(1);
|
||||||
|
}
|
||||||
|
#undef ITER
|
||||||
|
|
||||||
|
uint64_t prev_t = indices[prev_i];
|
||||||
|
for (uint64_t* p = indices + prev_i + 1, *e = indices + i; p != e; ++p)
|
||||||
|
{
|
||||||
|
uint64_t t = *p;
|
||||||
|
if (smaller(v, t, prev_t))
|
||||||
|
{
|
||||||
|
const uint64_t t2 = prev_t;
|
||||||
|
uint64_t* p1 = p;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
*p1 = prev_t;
|
||||||
|
--p1;
|
||||||
|
|
||||||
|
if (p1 <= indices + prev_i) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_t = *(p1 - 1);
|
||||||
|
} while (smaller(v, t, prev_t));
|
||||||
|
*p1 = t;
|
||||||
|
t = t2;
|
||||||
|
}
|
||||||
|
prev_t = t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prev_i = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool xmrig::astrobwt::astrobwt_dero(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash, int stage2_max_size, bool avx2)
|
bool xmrig::astrobwt::astrobwt_dero(const void* input_data, uint32_t input_size, void* scratchpad, uint8_t* output_hash, int stage2_max_size, bool avx2)
|
||||||
{
|
{
|
||||||
alignas(8) uint8_t key[32];
|
alignas(8) uint8_t key[32];
|
||||||
@@ -219,7 +402,7 @@ bool xmrig::astrobwt::astrobwt_dero(const void* input_data, uint32_t input_size,
|
|||||||
Salsa20_XORKeyStream(key, stage2_output, stage2_size);
|
Salsa20_XORKeyStream(key, stage2_output, stage2_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
sort_indices(stage2_size + 1, stage2_output, indices, tmp_indices);
|
sort_indices2(stage2_size + 1, stage2_output, indices, tmp_indices);
|
||||||
|
|
||||||
{
|
{
|
||||||
const uint8_t* tmp = stage2_output - 1;
|
const uint8_t* tmp = stage2_output - 1;
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public:
|
|||||||
constexpr inline size_t memory() const { static_assert(Algorithm::isCN(ALGO), "invalid CRYPTONIGHT algorithm"); return Algorithm::l3(ALGO); }
|
constexpr inline size_t memory() const { static_assert(Algorithm::isCN(ALGO), "invalid CRYPTONIGHT algorithm"); return Algorithm::l3(ALGO); }
|
||||||
constexpr inline uint32_t iterations() const { static_assert(Algorithm::isCN(ALGO), "invalid CRYPTONIGHT algorithm"); return CN_ITER; }
|
constexpr inline uint32_t iterations() const { static_assert(Algorithm::isCN(ALGO), "invalid CRYPTONIGHT algorithm"); return CN_ITER; }
|
||||||
constexpr inline uint32_t mask() const { return static_cast<uint32_t>(((memory() - 1) / 16) * 16); }
|
constexpr inline uint32_t mask() const { return static_cast<uint32_t>(((memory() - 1) / 16) * 16); }
|
||||||
|
constexpr inline uint32_t half_mem() const { return mask() < memory() / 2; }
|
||||||
|
|
||||||
inline static uint32_t iterations(Algorithm::Id algo)
|
inline static uint32_t iterations(Algorithm::Id algo)
|
||||||
{
|
{
|
||||||
@@ -108,6 +109,16 @@ public:
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
if (algo == Algorithm::CN_GR_1) {
|
||||||
|
return 0x3FFF0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (algo == Algorithm::CN_GR_5) {
|
||||||
|
return 0x1FFF0;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return ((Algorithm::l3(algo) - 1) / 16) * 16;
|
return ((Algorithm::l3(algo) - 1) / 16) * 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -136,6 +147,18 @@ template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_UPX2>::iterations() co
|
|||||||
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_PICO_0>::mask() const { return 0x1FFF0; }
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_PICO_0>::mask() const { return 0x1FFF0; }
|
||||||
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_UPX2>::mask() const { return 0x1FFF0; }
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_UPX2>::mask() const { return 0x1FFF0; }
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_0>::iterations() const { return CN_ITER / 4; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_1>::iterations() const { return CN_ITER / 4; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_2>::iterations() const { return CN_ITER / 2; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_3>::iterations() const { return CN_ITER / 2; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_4>::iterations() const { return CN_ITER / 8; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_5>::iterations() const { return CN_ITER / 8; }
|
||||||
|
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_1>::mask() const { return 0x3FFF0; }
|
||||||
|
template<> constexpr inline uint32_t CnAlgo<Algorithm::CN_GR_5>::mask() const { return 0x1FFF0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
} /* namespace xmrig */
|
} /* namespace xmrig */
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,10 @@
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
bool cn_sse41_enabled = false;
|
||||||
|
bool cn_vaes_enabled = false;
|
||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_ASM
|
#ifdef XMRIG_FEATURE_ASM
|
||||||
# define ADD_FN_ASM(algo) do { \
|
# define ADD_FN_ASM(algo) do { \
|
||||||
m_map[algo]->data[AV_SINGLE][Assembly::INTEL] = cryptonight_single_hash_asm<algo, Assembly::INTEL>; \
|
m_map[algo]->data[AV_SINGLE][Assembly::INTEL] = cryptonight_single_hash_asm<algo, Assembly::INTEL>; \
|
||||||
@@ -97,6 +101,27 @@ cn_mainloop_fun cn_double_double_mainloop_sandybridge_asm = nullptr;
|
|||||||
cn_mainloop_fun cn_upx2_mainloop_asm = nullptr;
|
cn_mainloop_fun cn_upx2_mainloop_asm = nullptr;
|
||||||
cn_mainloop_fun cn_upx2_double_mainloop_asm = nullptr;
|
cn_mainloop_fun cn_upx2_double_mainloop_asm = nullptr;
|
||||||
|
|
||||||
|
cn_mainloop_fun cn_gr0_single_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr1_single_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr2_single_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr3_single_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr4_single_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr5_single_mainloop_asm = nullptr;
|
||||||
|
|
||||||
|
cn_mainloop_fun cn_gr0_double_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr1_double_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr2_double_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr3_double_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr4_double_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr5_double_mainloop_asm = nullptr;
|
||||||
|
|
||||||
|
cn_mainloop_fun cn_gr0_quad_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr1_quad_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr2_quad_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr3_quad_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr4_quad_mainloop_asm = nullptr;
|
||||||
|
cn_mainloop_fun cn_gr5_quad_mainloop_asm = nullptr;
|
||||||
|
|
||||||
|
|
||||||
template<Algorithm::Id SOURCE_ALGO = Algorithm::CN_2, typename T, typename U>
|
template<Algorithm::Id SOURCE_ALGO = Algorithm::CN_2, typename T, typename U>
|
||||||
static void patchCode(T dst, U src, const uint32_t iterations, const uint32_t mask = CnAlgo<Algorithm::CN_HALF>().mask())
|
static void patchCode(T dst, U src, const uint32_t iterations, const uint32_t mask = CnAlgo<Algorithm::CN_HALF>().mask())
|
||||||
@@ -136,7 +161,7 @@ static void patchCode(T dst, U src, const uint32_t iterations, const uint32_t ma
|
|||||||
|
|
||||||
static void patchAsmVariants()
|
static void patchAsmVariants()
|
||||||
{
|
{
|
||||||
const int allocation_size = 131072;
|
constexpr size_t allocation_size = 0x20000;
|
||||||
auto base = static_cast<uint8_t *>(VirtualMemory::allocateExecutableMemory(allocation_size, false));
|
auto base = static_cast<uint8_t *>(VirtualMemory::allocateExecutableMemory(allocation_size, false));
|
||||||
|
|
||||||
cn_half_mainloop_ivybridge_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x0000);
|
cn_half_mainloop_ivybridge_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x0000);
|
||||||
@@ -173,6 +198,29 @@ static void patchAsmVariants()
|
|||||||
cn_upx2_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x15000);
|
cn_upx2_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x15000);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
cn_gr0_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x16000);
|
||||||
|
cn_gr1_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x16800);
|
||||||
|
cn_gr2_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x17000);
|
||||||
|
cn_gr3_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x17800);
|
||||||
|
cn_gr4_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x18000);
|
||||||
|
cn_gr5_single_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x18800);
|
||||||
|
|
||||||
|
cn_gr0_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x19000);
|
||||||
|
cn_gr1_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x19800);
|
||||||
|
cn_gr2_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1A000);
|
||||||
|
cn_gr3_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1A800);
|
||||||
|
cn_gr4_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1B000);
|
||||||
|
cn_gr5_double_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1B800);
|
||||||
|
|
||||||
|
cn_gr0_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1C000);
|
||||||
|
cn_gr1_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1C800);
|
||||||
|
cn_gr2_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1D000);
|
||||||
|
cn_gr3_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1D800);
|
||||||
|
cn_gr4_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1E000);
|
||||||
|
cn_gr5_quad_mainloop_asm = reinterpret_cast<cn_mainloop_fun> (base + 0x1E800);
|
||||||
|
# endif
|
||||||
|
|
||||||
{
|
{
|
||||||
constexpr uint32_t ITER = CnAlgo<Algorithm::CN_HALF>().iterations();
|
constexpr uint32_t ITER = CnAlgo<Algorithm::CN_HALF>().iterations();
|
||||||
|
|
||||||
@@ -230,7 +278,30 @@ static void patchAsmVariants()
|
|||||||
patchCode<Algorithm::CN_RWZ>(cn_upx2_mainloop_asm, cnv2_rwz_mainloop_asm, ITER, MASK);
|
patchCode<Algorithm::CN_RWZ>(cn_upx2_mainloop_asm, cnv2_rwz_mainloop_asm, ITER, MASK);
|
||||||
patchCode<Algorithm::CN_RWZ>(cn_upx2_double_mainloop_asm, cnv2_rwz_double_mainloop_asm, ITER, MASK);
|
patchCode<Algorithm::CN_RWZ>(cn_upx2_double_mainloop_asm, cnv2_rwz_double_mainloop_asm, ITER, MASK);
|
||||||
}
|
}
|
||||||
#endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr0_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_0>().iterations(), CnAlgo<Algorithm::CN_GR_0>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr1_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_1>().iterations(), CnAlgo<Algorithm::CN_GR_1>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr2_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_2>().iterations(), CnAlgo<Algorithm::CN_GR_2>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr3_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_3>().iterations(), CnAlgo<Algorithm::CN_GR_3>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr4_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_4>().iterations(), CnAlgo<Algorithm::CN_GR_4>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr5_single_mainloop_asm, cnv1_single_mainloop_asm, CnAlgo<Algorithm::CN_GR_5>().iterations(), CnAlgo<Algorithm::CN_GR_5>().mask());
|
||||||
|
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr0_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_0>().iterations(), CnAlgo<Algorithm::CN_GR_0>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr1_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_1>().iterations(), CnAlgo<Algorithm::CN_GR_1>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr2_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_2>().iterations(), CnAlgo<Algorithm::CN_GR_2>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr3_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_3>().iterations(), CnAlgo<Algorithm::CN_GR_3>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr4_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_4>().iterations(), CnAlgo<Algorithm::CN_GR_4>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr5_double_mainloop_asm, cnv1_double_mainloop_asm, CnAlgo<Algorithm::CN_GR_5>().iterations(), CnAlgo<Algorithm::CN_GR_5>().mask());
|
||||||
|
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr0_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_0>().iterations(), CnAlgo<Algorithm::CN_GR_0>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr1_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_1>().iterations(), CnAlgo<Algorithm::CN_GR_1>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr2_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_2>().iterations(), CnAlgo<Algorithm::CN_GR_2>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr3_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_3>().iterations(), CnAlgo<Algorithm::CN_GR_3>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr4_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_4>().iterations(), CnAlgo<Algorithm::CN_GR_4>().mask());
|
||||||
|
patchCode<Algorithm::CN_1>(cn_gr5_quad_mainloop_asm, cnv1_quad_mainloop_asm, CnAlgo<Algorithm::CN_GR_5>().iterations(), CnAlgo<Algorithm::CN_GR_5>().mask());
|
||||||
|
# endif
|
||||||
|
|
||||||
VirtualMemory::protectRX(base, allocation_size);
|
VirtualMemory::protectRX(base, allocation_size);
|
||||||
VirtualMemory::flushInstructionCache(base, allocation_size);
|
VirtualMemory::flushInstructionCache(base, allocation_size);
|
||||||
@@ -310,12 +381,29 @@ xmrig::CnHash::CnHash()
|
|||||||
m_map[Algorithm::ASTROBWT_DERO]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO>;
|
m_map[Algorithm::ASTROBWT_DERO]->data[AV_SINGLE_SOFT][Assembly::NONE] = astrobwt::single_hash<Algorithm::ASTROBWT_DERO>;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
ADD_FN(Algorithm::CN_GR_0);
|
||||||
|
ADD_FN(Algorithm::CN_GR_1);
|
||||||
|
ADD_FN(Algorithm::CN_GR_2);
|
||||||
|
ADD_FN(Algorithm::CN_GR_3);
|
||||||
|
ADD_FN(Algorithm::CN_GR_4);
|
||||||
|
ADD_FN(Algorithm::CN_GR_5);
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_ASM
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
patchAsmVariants();
|
patchAsmVariants();
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xmrig::CnHash::~CnHash()
|
||||||
|
{
|
||||||
|
for (auto const& x : m_map) {
|
||||||
|
delete m_map[x.first];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
xmrig::cn_hash_fun xmrig::CnHash::fn(const Algorithm &algorithm, AlgoVariant av, Assembly::Id assembly)
|
xmrig::cn_hash_fun xmrig::CnHash::fn(const Algorithm &algorithm, AlgoVariant av, Assembly::Id assembly)
|
||||||
{
|
{
|
||||||
assert(cnHash.m_map.count(algorithm));
|
assert(cnHash.m_map.count(algorithm));
|
||||||
@@ -331,7 +419,7 @@ xmrig::cn_hash_fun xmrig::CnHash::fn(const Algorithm &algorithm, AlgoVariant av,
|
|||||||
|
|
||||||
# ifdef XMRIG_ALGO_CN_HEAVY
|
# ifdef XMRIG_ALGO_CN_HEAVY
|
||||||
// cn-heavy optimization for Zen3 CPUs
|
// cn-heavy optimization for Zen3 CPUs
|
||||||
if ((av == AV_SINGLE) && (assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3)) {
|
if ((av == AV_SINGLE) && (assembly != Assembly::NONE) && (Cpu::info()->arch() == ICpuInfo::ARCH_ZEN3) && (Cpu::info()->model() == 0x21)) {
|
||||||
switch (algorithm.id()) {
|
switch (algorithm.id()) {
|
||||||
case Algorithm::CN_HEAVY_0:
|
case Algorithm::CN_HEAVY_0:
|
||||||
return cryptonight_single_hash<Algorithm::CN_HEAVY_0, false, 3>;
|
return cryptonight_single_hash<Algorithm::CN_HEAVY_0, false, 3>;
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
CnHash();
|
CnHash();
|
||||||
|
virtual ~CnHash();
|
||||||
|
|
||||||
static cn_hash_fun fn(const Algorithm &algorithm, AlgoVariant av, Assembly::Id assembly);
|
static cn_hash_fun fn(const Algorithm &algorithm, AlgoVariant av, Assembly::Id assembly);
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,17 @@ struct cryptonight_r_data {
|
|||||||
struct cryptonight_ctx {
|
struct cryptonight_ctx {
|
||||||
alignas(16) uint8_t state[224];
|
alignas(16) uint8_t state[224];
|
||||||
alignas(16) uint8_t *memory;
|
alignas(16) uint8_t *memory;
|
||||||
|
const uint32_t* tweak1_table;
|
||||||
|
uint64_t tweak1_2;
|
||||||
|
|
||||||
uint8_t unused[40];
|
uint8_t unused[24];
|
||||||
const uint32_t *saes_table;
|
const uint32_t *saes_table;
|
||||||
|
|
||||||
cn_mainloop_fun_ms_abi generated_code;
|
cn_mainloop_fun_ms_abi generated_code;
|
||||||
cryptonight_r_data generated_code_data;
|
cryptonight_r_data generated_code_data;
|
||||||
|
|
||||||
|
alignas(16) uint8_t save_state[128];
|
||||||
|
bool first_half;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -349,6 +349,9 @@ static inline __m128i aes_round_tweak_div(const __m128i &in, const __m128i &key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
alignas(64) static const uint32_t tweak1_table[256] = { 268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456 };
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
@@ -368,12 +371,7 @@ static inline void cryptonight_monero_tweak(const uint8_t* l, uint64_t idx, __m1
|
|||||||
|
|
||||||
uint64_t vh = vgetq_lane_u64(tmp, 1);
|
uint64_t vh = vgetq_lane_u64(tmp, 1);
|
||||||
|
|
||||||
uint8_t x = vh >> 24;
|
mem_out[1] = vh ^ tweak1_table[static_cast<uint8_t>(vh >> 24)];
|
||||||
static const uint16_t table = 0x7531;
|
|
||||||
const uint8_t index = (((x >> (3)) & 6) | (x & 1)) << 1;
|
|
||||||
vh ^= ((table >> index) & 0x3) << 28;
|
|
||||||
|
|
||||||
mem_out[1] = vh;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -204,4 +204,7 @@
|
|||||||
v4_random_math(code##part, r##part); \
|
v4_random_math(code##part, r##part); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern bool cn_sse41_enabled;
|
||||||
|
extern bool cn_vaes_enabled;
|
||||||
|
|
||||||
#endif /* XMRIG_CRYPTONIGHT_MONERO_H */
|
#endif /* XMRIG_CRYPTONIGHT_MONERO_H */
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ const static uint8_t test_output_r[] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/0"
|
// "cn/0"
|
||||||
const static uint8_t test_output_v0[160] = {
|
const static uint8_t test_output_v0[256] = {
|
||||||
0x1A, 0x3F, 0xFB, 0xEE, 0x90, 0x9B, 0x42, 0x0D, 0x91, 0xF7, 0xBE, 0x6E, 0x5F, 0xB5, 0x6D, 0xB7,
|
0x1A, 0x3F, 0xFB, 0xEE, 0x90, 0x9B, 0x42, 0x0D, 0x91, 0xF7, 0xBE, 0x6E, 0x5F, 0xB5, 0x6D, 0xB7,
|
||||||
0x1B, 0x31, 0x10, 0xD8, 0x86, 0x01, 0x1E, 0x87, 0x7E, 0xE5, 0x78, 0x6A, 0xFD, 0x08, 0x01, 0x00,
|
0x1B, 0x31, 0x10, 0xD8, 0x86, 0x01, 0x1E, 0x87, 0x7E, 0xE5, 0x78, 0x6A, 0xFD, 0x08, 0x01, 0x00,
|
||||||
0x1B, 0x60, 0x6A, 0x3F, 0x4A, 0x07, 0xD6, 0x48, 0x9A, 0x1B, 0xCD, 0x07, 0x69, 0x7B, 0xD1, 0x66,
|
0x1B, 0x60, 0x6A, 0x3F, 0x4A, 0x07, 0xD6, 0x48, 0x9A, 0x1B, 0xCD, 0x07, 0x69, 0x7B, 0xD1, 0x66,
|
||||||
@@ -115,7 +115,7 @@ const static uint8_t test_output_v0[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/1" Cryptonight variant 1 (Monero v7)
|
// "cn/1" Cryptonight variant 1 (Monero v7)
|
||||||
const static uint8_t test_output_v1[160] = {
|
const static uint8_t test_output_v1[256] = {
|
||||||
0xF2, 0x2D, 0x3D, 0x62, 0x03, 0xD2, 0xA0, 0x8B, 0x41, 0xD9, 0x02, 0x72, 0x78, 0xD8, 0xBC, 0xC9,
|
0xF2, 0x2D, 0x3D, 0x62, 0x03, 0xD2, 0xA0, 0x8B, 0x41, 0xD9, 0x02, 0x72, 0x78, 0xD8, 0xBC, 0xC9,
|
||||||
0x83, 0xAC, 0xAD, 0xA9, 0xB6, 0x8E, 0x52, 0xE3, 0xC6, 0x89, 0x69, 0x2A, 0x50, 0xE9, 0x21, 0xD9,
|
0x83, 0xAC, 0xAD, 0xA9, 0xB6, 0x8E, 0x52, 0xE3, 0xC6, 0x89, 0x69, 0x2A, 0x50, 0xE9, 0x21, 0xD9,
|
||||||
0xC9, 0xFA, 0xE8, 0x42, 0x5D, 0x86, 0x88, 0xDC, 0x23, 0x6B, 0xCD, 0xBC, 0x42, 0xFD, 0xB4, 0x2D,
|
0xC9, 0xFA, 0xE8, 0x42, 0x5D, 0x86, 0x88, 0xDC, 0x23, 0x6B, 0xCD, 0xBC, 0x42, 0xFD, 0xB4, 0x2D,
|
||||||
@@ -130,7 +130,7 @@ const static uint8_t test_output_v1[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/2" Cryptonight variant 2 (Monero v8)
|
// "cn/2" Cryptonight variant 2 (Monero v8)
|
||||||
const static uint8_t test_output_v2[160] = {
|
const static uint8_t test_output_v2[256] = {
|
||||||
0x97, 0x37, 0x82, 0x82, 0xCF, 0x10, 0xE7, 0xAD, 0x03, 0x3F, 0x7B, 0x80, 0x74, 0xC4, 0x0E, 0x14,
|
0x97, 0x37, 0x82, 0x82, 0xCF, 0x10, 0xE7, 0xAD, 0x03, 0x3F, 0x7B, 0x80, 0x74, 0xC4, 0x0E, 0x14,
|
||||||
0xD0, 0x6E, 0x7F, 0x60, 0x9D, 0xDD, 0xDA, 0x78, 0x76, 0x80, 0xB5, 0x8C, 0x05, 0xF4, 0x3D, 0x21,
|
0xD0, 0x6E, 0x7F, 0x60, 0x9D, 0xDD, 0xDA, 0x78, 0x76, 0x80, 0xB5, 0x8C, 0x05, 0xF4, 0x3D, 0x21,
|
||||||
0x87, 0x1F, 0xCD, 0x68, 0x23, 0xF6, 0xA8, 0x79, 0xBB, 0x3F, 0x33, 0x95, 0x1C, 0x8E, 0x8E, 0x89,
|
0x87, 0x1F, 0xCD, 0x68, 0x23, 0xF6, 0xA8, 0x79, 0xBB, 0x3F, 0x33, 0x95, 0x1C, 0x8E, 0x8E, 0x89,
|
||||||
@@ -145,7 +145,7 @@ const static uint8_t test_output_v2[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/half"
|
// "cn/half"
|
||||||
const static uint8_t test_output_half[160] = {
|
const static uint8_t test_output_half[256] = {
|
||||||
0x5D, 0x4F, 0xBC, 0x35, 0x60, 0x97, 0xEA, 0x64, 0x40, 0xB0, 0x88, 0x8E, 0xDE, 0xB6, 0x35, 0xDD,
|
0x5D, 0x4F, 0xBC, 0x35, 0x60, 0x97, 0xEA, 0x64, 0x40, 0xB0, 0x88, 0x8E, 0xDE, 0xB6, 0x35, 0xDD,
|
||||||
0xC8, 0x4A, 0x0E, 0x39, 0x7C, 0x86, 0x84, 0x56, 0x89, 0x5C, 0x3F, 0x29, 0xBE, 0x73, 0x12, 0xA7,
|
0xC8, 0x4A, 0x0E, 0x39, 0x7C, 0x86, 0x84, 0x56, 0x89, 0x5C, 0x3F, 0x29, 0xBE, 0x73, 0x12, 0xA7,
|
||||||
0x02, 0xE6, 0x1D, 0x2B, 0xBC, 0x84, 0xB6, 0x71, 0x96, 0x71, 0xD5, 0x0C, 0xAC, 0x76, 0x0E, 0x6B,
|
0x02, 0xE6, 0x1D, 0x2B, 0xBC, 0x84, 0xB6, 0x71, 0x96, 0x71, 0xD5, 0x0C, 0xAC, 0x76, 0x0E, 0x6B,
|
||||||
@@ -160,7 +160,7 @@ const static uint8_t test_output_half[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/msr" Masari (MSR)
|
// "cn/msr" Masari (MSR)
|
||||||
const static uint8_t test_output_msr[160] = {
|
const static uint8_t test_output_msr[256] = {
|
||||||
0x3C, 0x7A, 0x61, 0x08, 0x4C, 0x5E, 0xB8, 0x65, 0xB4, 0x98, 0xAB, 0x2F, 0x5A, 0x1A, 0xC5, 0x2C,
|
0x3C, 0x7A, 0x61, 0x08, 0x4C, 0x5E, 0xB8, 0x65, 0xB4, 0x98, 0xAB, 0x2F, 0x5A, 0x1A, 0xC5, 0x2C,
|
||||||
0x49, 0xC1, 0x77, 0xC2, 0xD0, 0x13, 0x34, 0x42, 0xD6, 0x5E, 0xD5, 0x14, 0x33, 0x5C, 0x82, 0xC5,
|
0x49, 0xC1, 0x77, 0xC2, 0xD0, 0x13, 0x34, 0x42, 0xD6, 0x5E, 0xD5, 0x14, 0x33, 0x5C, 0x82, 0xC5,
|
||||||
0x69, 0xDF, 0x38, 0x51, 0x1B, 0xB3, 0xEB, 0x7D, 0xE7, 0x6B, 0x08, 0x8E, 0xB6, 0x7E, 0xB7, 0x1C,
|
0x69, 0xDF, 0x38, 0x51, 0x1B, 0xB3, 0xEB, 0x7D, 0xE7, 0x6B, 0x08, 0x8E, 0xB6, 0x7E, 0xB7, 0x1C,
|
||||||
@@ -175,7 +175,7 @@ const static uint8_t test_output_msr[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/xao" Alloy (XAO)
|
// "cn/xao" Alloy (XAO)
|
||||||
const static uint8_t test_output_xao[160] = {
|
const static uint8_t test_output_xao[256] = {
|
||||||
0x9A, 0x29, 0xD0, 0xC4, 0xAF, 0xDC, 0x63, 0x9B, 0x65, 0x53, 0xB1, 0xC8, 0x37, 0x35, 0x11, 0x4C,
|
0x9A, 0x29, 0xD0, 0xC4, 0xAF, 0xDC, 0x63, 0x9B, 0x65, 0x53, 0xB1, 0xC8, 0x37, 0x35, 0x11, 0x4C,
|
||||||
0x5D, 0x77, 0x16, 0x21, 0x42, 0x97, 0x5C, 0xB8, 0x50, 0xC0, 0xA5, 0x1F, 0x64, 0x07, 0xBD, 0x33,
|
0x5D, 0x77, 0x16, 0x21, 0x42, 0x97, 0x5C, 0xB8, 0x50, 0xC0, 0xA5, 0x1F, 0x64, 0x07, 0xBD, 0x33,
|
||||||
0xF1, 0xC9, 0x98, 0x40, 0x42, 0xDE, 0x39, 0xD1, 0xBA, 0x2D, 0xAD, 0xEC, 0xFE, 0xEA, 0xD8, 0x46,
|
0xF1, 0xC9, 0x98, 0x40, 0x42, 0xDE, 0x39, 0xD1, 0xBA, 0x2D, 0xAD, 0xEC, 0xFE, 0xEA, 0xD8, 0x46,
|
||||||
@@ -190,7 +190,7 @@ const static uint8_t test_output_xao[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn/rto" Arto (RTO)
|
// "cn/rto" Arto (RTO)
|
||||||
const static uint8_t test_output_rto[160] = {
|
const static uint8_t test_output_rto[256] = {
|
||||||
0x82, 0x66, 0x1E, 0x1C, 0x6E, 0x64, 0x36, 0x66, 0x84, 0x06, 0x32, 0x7A, 0x9B, 0xB1, 0x13, 0x19,
|
0x82, 0x66, 0x1E, 0x1C, 0x6E, 0x64, 0x36, 0x66, 0x84, 0x06, 0x32, 0x7A, 0x9B, 0xB1, 0x13, 0x19,
|
||||||
0xA5, 0x56, 0x16, 0x15, 0xDF, 0xEC, 0x1C, 0x9E, 0xE3, 0x88, 0x4A, 0x6C, 0x1C, 0xEB, 0x76, 0xA5,
|
0xA5, 0x56, 0x16, 0x15, 0xDF, 0xEC, 0x1C, 0x9E, 0xE3, 0x88, 0x4A, 0x6C, 0x1C, 0xEB, 0x76, 0xA5,
|
||||||
0xB3, 0xFB, 0xF4, 0x3F, 0x2B, 0x6A, 0x3A, 0x39, 0xA3, 0x6E, 0x08, 0x33, 0x67, 0x90, 0x31, 0xB9,
|
0xB3, 0xFB, 0xF4, 0x3F, 0x2B, 0x6A, 0x3A, 0x39, 0xA3, 0x6E, 0x08, 0x33, 0x67, 0x90, 0x31, 0xB9,
|
||||||
@@ -204,7 +204,7 @@ const static uint8_t test_output_rto[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "cn/rwz"
|
// "cn/rwz"
|
||||||
const static uint8_t test_output_rwz[160] = {
|
const static uint8_t test_output_rwz[256] = {
|
||||||
0x5f, 0x56, 0xc6, 0xb0, 0x99, 0x6b, 0xa2, 0x3e, 0x0b, 0xba, 0x07, 0x29, 0xc9, 0x90, 0x74, 0x85,
|
0x5f, 0x56, 0xc6, 0xb0, 0x99, 0x6b, 0xa2, 0x3e, 0x0b, 0xba, 0x07, 0x29, 0xc9, 0x90, 0x74, 0x85,
|
||||||
0x5a, 0x10, 0xe3, 0x08, 0x7f, 0xdb, 0xfe, 0x94, 0x75, 0x33, 0x54, 0x73, 0x76, 0xf0, 0x75, 0xb8,
|
0x5a, 0x10, 0xe3, 0x08, 0x7f, 0xdb, 0xfe, 0x94, 0x75, 0x33, 0x54, 0x73, 0x76, 0xf0, 0x75, 0xb8,
|
||||||
0x8b, 0x70, 0x43, 0x9a, 0xfc, 0xf5, 0xeb, 0x15, 0xbb, 0xf9, 0xad, 0x9d, 0x2a, 0xbd, 0x72, 0x52,
|
0x8b, 0x70, 0x43, 0x9a, 0xfc, 0xf5, 0xeb, 0x15, 0xbb, 0xf9, 0xad, 0x9d, 0x2a, 0xbd, 0x72, 0x52,
|
||||||
@@ -218,7 +218,7 @@ const static uint8_t test_output_rwz[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "cn/zls"
|
// "cn/zls"
|
||||||
const static uint8_t test_output_zls[160] = {
|
const static uint8_t test_output_zls[256] = {
|
||||||
0x51, 0x6E, 0x33, 0xC6, 0xE4, 0x46, 0xAB, 0xBC, 0xCD, 0xAD, 0x18, 0xC0, 0x4C, 0xD9, 0xA2, 0x5E,
|
0x51, 0x6E, 0x33, 0xC6, 0xE4, 0x46, 0xAB, 0xBC, 0xCD, 0xAD, 0x18, 0xC0, 0x4C, 0xD9, 0xA2, 0x5E,
|
||||||
0x64, 0x10, 0x28, 0x53, 0xB2, 0x0A, 0x42, 0xDF, 0xDE, 0xAA, 0x8B, 0x59, 0x9E, 0xCF, 0x40, 0xE2,
|
0x64, 0x10, 0x28, 0x53, 0xB2, 0x0A, 0x42, 0xDF, 0xDE, 0xAA, 0x8B, 0x59, 0x9E, 0xCF, 0x40, 0xE2,
|
||||||
0x0D, 0x62, 0x5B, 0x42, 0x18, 0xE2, 0x76, 0xAD, 0xD0, 0x74, 0x90, 0x60, 0x8D, 0xC4, 0xC7, 0x80,
|
0x0D, 0x62, 0x5B, 0x42, 0x18, 0xE2, 0x76, 0xAD, 0xD0, 0x74, 0x90, 0x60, 0x8D, 0xC4, 0xC7, 0x80,
|
||||||
@@ -232,7 +232,7 @@ const static uint8_t test_output_zls[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "cn/ccx"
|
// "cn/ccx"
|
||||||
const static uint8_t test_output_ccx[160] = {
|
const static uint8_t test_output_ccx[256] = {
|
||||||
0xB3, 0xA1, 0x67, 0x86, 0xD2, 0xC9, 0x85, 0xEC, 0xAD, 0xC4, 0x5F, 0x91, 0x05, 0x27, 0xC7, 0xA1,
|
0xB3, 0xA1, 0x67, 0x86, 0xD2, 0xC9, 0x85, 0xEC, 0xAD, 0xC4, 0x5F, 0x91, 0x05, 0x27, 0xC7, 0xA1,
|
||||||
0x96, 0xF0, 0xE1, 0xE9, 0x7C, 0x87, 0x09, 0x38, 0x1D, 0x7D, 0x41, 0x93, 0x35, 0xF8, 0x16, 0x72,
|
0x96, 0xF0, 0xE1, 0xE9, 0x7C, 0x87, 0x09, 0x38, 0x1D, 0x7D, 0x41, 0x93, 0x35, 0xF8, 0x16, 0x72,
|
||||||
0xC3, 0xBD, 0x8D, 0xE8, 0xD5, 0xAE, 0xB8, 0x59, 0x0A, 0x6C, 0xCB, 0x7B, 0x41, 0x30, 0xF7, 0x04,
|
0xC3, 0xBD, 0x8D, 0xE8, 0xD5, 0xAE, 0xB8, 0x59, 0x0A, 0x6C, 0xCB, 0x7B, 0x41, 0x30, 0xF7, 0x04,
|
||||||
@@ -246,7 +246,7 @@ const static uint8_t test_output_ccx[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "cn/double"
|
// "cn/double"
|
||||||
const static uint8_t test_output_double[160] = {
|
const static uint8_t test_output_double[256] = {
|
||||||
0xAE, 0xFB, 0xB3, 0xF0, 0xCC, 0x88, 0x04, 0x6D, 0x11, 0x9F, 0x6C, 0x54, 0xB9, 0x6D, 0x90, 0xC9,
|
0xAE, 0xFB, 0xB3, 0xF0, 0xCC, 0x88, 0x04, 0x6D, 0x11, 0x9F, 0x6C, 0x54, 0xB9, 0x6D, 0x90, 0xC9,
|
||||||
0xE8, 0x84, 0xEA, 0x3B, 0x59, 0x83, 0xA6, 0x0D, 0x50, 0xA4, 0x2D, 0x7D, 0x3E, 0xBE, 0x48, 0x21,
|
0xE8, 0x84, 0xEA, 0x3B, 0x59, 0x83, 0xA6, 0x0D, 0x50, 0xA4, 0x2D, 0x7D, 0x3E, 0xBE, 0x48, 0x21,
|
||||||
0x49, 0xCE, 0x8E, 0xF3, 0xBC, 0x8A, 0x36, 0xBF, 0x86, 0x37, 0x89, 0x55, 0x09, 0xBA, 0x22, 0xF8,
|
0x49, 0xCE, 0x8E, 0xF3, 0xBC, 0x8A, 0x36, 0xBF, 0x86, 0x37, 0x89, 0x55, 0x09, 0xBA, 0x22, 0xF8,
|
||||||
@@ -261,7 +261,7 @@ const static uint8_t test_output_double[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_CN_LITE
|
#ifdef XMRIG_ALGO_CN_LITE
|
||||||
// "cn-lite/0"
|
// "cn-lite/0"
|
||||||
const static uint8_t test_output_v0_lite[160] = {
|
const static uint8_t test_output_v0_lite[256] = {
|
||||||
0x36, 0x95, 0xB4, 0xB5, 0x3B, 0xB0, 0x03, 0x58, 0xB0, 0xAD, 0x38, 0xDC, 0x16, 0x0F, 0xEB, 0x9E,
|
0x36, 0x95, 0xB4, 0xB5, 0x3B, 0xB0, 0x03, 0x58, 0xB0, 0xAD, 0x38, 0xDC, 0x16, 0x0F, 0xEB, 0x9E,
|
||||||
0x00, 0x4E, 0xEC, 0xE0, 0x9B, 0x83, 0xA7, 0x2E, 0xF6, 0xBA, 0x98, 0x64, 0xD3, 0x51, 0x0C, 0x88,
|
0x00, 0x4E, 0xEC, 0xE0, 0x9B, 0x83, 0xA7, 0x2E, 0xF6, 0xBA, 0x98, 0x64, 0xD3, 0x51, 0x0C, 0x88,
|
||||||
0x28, 0xA2, 0x2B, 0xAD, 0x3F, 0x93, 0xD1, 0x40, 0x8F, 0xCA, 0x47, 0x2E, 0xB5, 0xAD, 0x1C, 0xBE,
|
0x28, 0xA2, 0x2B, 0xAD, 0x3F, 0x93, 0xD1, 0x40, 0x8F, 0xCA, 0x47, 0x2E, 0xB5, 0xAD, 0x1C, 0xBE,
|
||||||
@@ -276,7 +276,7 @@ const static uint8_t test_output_v0_lite[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn-lite/1" AEON v7
|
// "cn-lite/1" AEON v7
|
||||||
const static uint8_t test_output_v1_lite[160] = {
|
const static uint8_t test_output_v1_lite[256] = {
|
||||||
0x6D, 0x8C, 0xDC, 0x44, 0x4E, 0x9B, 0xBB, 0xFD, 0x68, 0xFC, 0x43, 0xFC, 0xD4, 0x85, 0x5B, 0x22,
|
0x6D, 0x8C, 0xDC, 0x44, 0x4E, 0x9B, 0xBB, 0xFD, 0x68, 0xFC, 0x43, 0xFC, 0xD4, 0x85, 0x5B, 0x22,
|
||||||
0x8C, 0x8A, 0x1B, 0xD9, 0x1D, 0x9D, 0x00, 0x28, 0x5B, 0xEC, 0x02, 0xB7, 0xCA, 0x2D, 0x67, 0x41,
|
0x8C, 0x8A, 0x1B, 0xD9, 0x1D, 0x9D, 0x00, 0x28, 0x5B, 0xEC, 0x02, 0xB7, 0xCA, 0x2D, 0x67, 0x41,
|
||||||
0x87, 0xC4, 0xE5, 0x70, 0x65, 0x3E, 0xB4, 0xC2, 0xB4, 0x2B, 0x7A, 0x0D, 0x54, 0x65, 0x59, 0x45,
|
0x87, 0xC4, 0xE5, 0x70, 0x65, 0x3E, 0xB4, 0xC2, 0xB4, 0x2B, 0x7A, 0x0D, 0x54, 0x65, 0x59, 0x45,
|
||||||
@@ -293,7 +293,7 @@ const static uint8_t test_output_v1_lite[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_CN_HEAVY
|
#ifdef XMRIG_ALGO_CN_HEAVY
|
||||||
// "cn-heavy/0"
|
// "cn-heavy/0"
|
||||||
const static uint8_t test_output_v0_heavy[160] = {
|
const static uint8_t test_output_v0_heavy[256] = {
|
||||||
0x99, 0x83, 0xF2, 0x1B, 0xDF, 0x20, 0x10, 0xA8, 0xD7, 0x07, 0xBB, 0x2F, 0x14, 0xD7, 0x86, 0x64,
|
0x99, 0x83, 0xF2, 0x1B, 0xDF, 0x20, 0x10, 0xA8, 0xD7, 0x07, 0xBB, 0x2F, 0x14, 0xD7, 0x86, 0x64,
|
||||||
0xBB, 0xE1, 0x18, 0x7F, 0x55, 0x01, 0x4B, 0x39, 0xE5, 0xF3, 0xD6, 0x93, 0x28, 0xE4, 0x8F, 0xC2,
|
0xBB, 0xE1, 0x18, 0x7F, 0x55, 0x01, 0x4B, 0x39, 0xE5, 0xF3, 0xD6, 0x93, 0x28, 0xE4, 0x8F, 0xC2,
|
||||||
0x4D, 0x94, 0x7D, 0xD6, 0xDB, 0x6E, 0x07, 0x48, 0x26, 0x4A, 0x51, 0x2E, 0xAC, 0xF3, 0x25, 0x4A,
|
0x4D, 0x94, 0x7D, 0xD6, 0xDB, 0x6E, 0x07, 0x48, 0x26, 0x4A, 0x51, 0x2E, 0xAC, 0xF3, 0x25, 0x4A,
|
||||||
@@ -308,7 +308,7 @@ const static uint8_t test_output_v0_heavy[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn-heavy/xhv"
|
// "cn-heavy/xhv"
|
||||||
const static uint8_t test_output_xhv_heavy[160] = {
|
const static uint8_t test_output_xhv_heavy[256] = {
|
||||||
0x5A, 0xC3, 0xF7, 0x85, 0xC4, 0x90, 0xC5, 0x85, 0x50, 0xEC, 0x95, 0xD2, 0x72, 0x65, 0x63, 0x57,
|
0x5A, 0xC3, 0xF7, 0x85, 0xC4, 0x90, 0xC5, 0x85, 0x50, 0xEC, 0x95, 0xD2, 0x72, 0x65, 0x63, 0x57,
|
||||||
0x7E, 0x7C, 0x1C, 0x21, 0x2D, 0x0C, 0xDE, 0x59, 0x12, 0x73, 0x20, 0x1E, 0x44, 0xFD, 0xD5, 0xB6,
|
0x7E, 0x7C, 0x1C, 0x21, 0x2D, 0x0C, 0xDE, 0x59, 0x12, 0x73, 0x20, 0x1E, 0x44, 0xFD, 0xD5, 0xB6,
|
||||||
0x1F, 0x4E, 0xB2, 0x0A, 0x36, 0x51, 0x4B, 0xF5, 0x4D, 0xC9, 0xE0, 0x90, 0x2C, 0x16, 0x47, 0x3F,
|
0x1F, 0x4E, 0xB2, 0x0A, 0x36, 0x51, 0x4B, 0xF5, 0x4D, 0xC9, 0xE0, 0x90, 0x2C, 0x16, 0x47, 0x3F,
|
||||||
@@ -323,7 +323,7 @@ const static uint8_t test_output_xhv_heavy[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn-heavy/tube"
|
// "cn-heavy/tube"
|
||||||
const static uint8_t test_output_tube_heavy[160] = {
|
const static uint8_t test_output_tube_heavy[256] = {
|
||||||
0xFE, 0x53, 0x35, 0x20, 0x76, 0xEA, 0xE6, 0x89, 0xFA, 0x3B, 0x4F, 0xDA, 0x61, 0x46, 0x34, 0xCF,
|
0xFE, 0x53, 0x35, 0x20, 0x76, 0xEA, 0xE6, 0x89, 0xFA, 0x3B, 0x4F, 0xDA, 0x61, 0x46, 0x34, 0xCF,
|
||||||
0xC3, 0x12, 0xEE, 0x0C, 0x38, 0x7D, 0xF2, 0xB8, 0xB7, 0x4D, 0xA2, 0xA1, 0x59, 0x74, 0x12, 0x35,
|
0xC3, 0x12, 0xEE, 0x0C, 0x38, 0x7D, 0xF2, 0xB8, 0xB7, 0x4D, 0xA2, 0xA1, 0x59, 0x74, 0x12, 0x35,
|
||||||
0xCD, 0x3F, 0x29, 0xDF, 0x07, 0x4A, 0x14, 0xAD, 0x0B, 0x98, 0x99, 0x37, 0xCA, 0x14, 0x68, 0xA3,
|
0xCD, 0x3F, 0x29, 0xDF, 0x07, 0x4A, 0x14, 0xAD, 0x0B, 0x98, 0x99, 0x37, 0xCA, 0x14, 0x68, 0xA3,
|
||||||
@@ -340,7 +340,7 @@ const static uint8_t test_output_tube_heavy[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_CN_PICO
|
#ifdef XMRIG_ALGO_CN_PICO
|
||||||
// "cn-pico/trtl"
|
// "cn-pico/trtl"
|
||||||
const static uint8_t test_output_pico_trtl[160] = {
|
const static uint8_t test_output_pico_trtl[256] = {
|
||||||
0x08, 0xF4, 0x21, 0xD7, 0x83, 0x31, 0x17, 0x30, 0x0E, 0xDA, 0x66, 0xE9, 0x8F, 0x4A, 0x25, 0x69,
|
0x08, 0xF4, 0x21, 0xD7, 0x83, 0x31, 0x17, 0x30, 0x0E, 0xDA, 0x66, 0xE9, 0x8F, 0x4A, 0x25, 0x69,
|
||||||
0x09, 0x3D, 0xF3, 0x00, 0x50, 0x01, 0x73, 0x94, 0x4E, 0xFC, 0x40, 0x1E, 0x9A, 0x4A, 0x17, 0xAF,
|
0x09, 0x3D, 0xF3, 0x00, 0x50, 0x01, 0x73, 0x94, 0x4E, 0xFC, 0x40, 0x1E, 0x9A, 0x4A, 0x17, 0xAF,
|
||||||
0xB2, 0x17, 0x2E, 0xC9, 0x46, 0x6E, 0x1A, 0xEE, 0x70, 0xEC, 0x85, 0x72, 0xA1, 0x4C, 0x23, 0x3E,
|
0xB2, 0x17, 0x2E, 0xC9, 0x46, 0x6E, 0x1A, 0xEE, 0x70, 0xEC, 0x85, 0x72, 0xA1, 0x4C, 0x23, 0x3E,
|
||||||
@@ -355,7 +355,7 @@ const static uint8_t test_output_pico_trtl[160] = {
|
|||||||
|
|
||||||
|
|
||||||
// "cn-pico/tlo"
|
// "cn-pico/tlo"
|
||||||
const static uint8_t test_output_pico_tlo[160] = {
|
const static uint8_t test_output_pico_tlo[256] = {
|
||||||
0x99, 0x75, 0xF2, 0xC1, 0xB3, 0xB4, 0x54, 0x34, 0xA4, 0x93, 0x86, 0x21, 0x30, 0x97, 0xF3, 0x1B,
|
0x99, 0x75, 0xF2, 0xC1, 0xB3, 0xB4, 0x54, 0x34, 0xA4, 0x93, 0x86, 0x21, 0x30, 0x97, 0xF3, 0x1B,
|
||||||
0xB4, 0xB9, 0xA6, 0x58, 0x6A, 0x7E, 0x81, 0xF4, 0x42, 0x9F, 0x6D, 0x5F, 0x65, 0xC3, 0x8D, 0x1A,
|
0xB4, 0xB9, 0xA6, 0x58, 0x6A, 0x7E, 0x81, 0xF4, 0x42, 0x9F, 0x6D, 0x5F, 0x65, 0xC3, 0x8D, 0x1A,
|
||||||
0xFC, 0x67, 0xDF, 0xCC, 0xB5, 0xFC, 0x90, 0xD7, 0x85, 0x5A, 0xE9, 0x03, 0x36, 0x1E, 0xAB, 0xD7,
|
0xFC, 0x67, 0xDF, 0xCC, 0xB5, 0xFC, 0x90, 0xD7, 0x85, 0x5A, 0xE9, 0x03, 0x36, 0x1E, 0xAB, 0xD7,
|
||||||
@@ -372,7 +372,7 @@ const static uint8_t test_output_pico_tlo[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_CN_FEMTO
|
#ifdef XMRIG_ALGO_CN_FEMTO
|
||||||
// "cn/upx2"
|
// "cn/upx2"
|
||||||
const static uint8_t test_output_femto_upx2[160] = {
|
const static uint8_t test_output_femto_upx2[256] = {
|
||||||
0xAA, 0xBB, 0xB8, 0xED, 0x14, 0xA8, 0x35, 0xFA, 0x22, 0xCF, 0xB1, 0xB5, 0xDE, 0xA8, 0x72, 0xB0,
|
0xAA, 0xBB, 0xB8, 0xED, 0x14, 0xA8, 0x35, 0xFA, 0x22, 0xCF, 0xB1, 0xB5, 0xDE, 0xA8, 0x72, 0xB0,
|
||||||
0xA1, 0xD6, 0xCB, 0xD8, 0x46, 0xF4, 0x39, 0x1C, 0x0F, 0x01, 0xF3, 0x87, 0x5E, 0x3A, 0x37, 0x61,
|
0xA1, 0xD6, 0xCB, 0xD8, 0x46, 0xF4, 0x39, 0x1C, 0x0F, 0x01, 0xF3, 0x87, 0x5E, 0x3A, 0x37, 0x61,
|
||||||
0x38, 0x59, 0x15, 0x72, 0xF8, 0x20, 0xD4, 0xDE, 0x25, 0x3C, 0xF5, 0x5A, 0x21, 0x92, 0xB6, 0x22,
|
0x38, 0x59, 0x15, 0x72, 0xF8, 0x20, 0xD4, 0xDE, 0x25, 0x3C, 0xF5, 0x5A, 0x21, 0x92, 0xB6, 0x22,
|
||||||
@@ -389,7 +389,7 @@ const static uint8_t test_output_femto_upx2[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_ARGON2
|
#ifdef XMRIG_ALGO_ARGON2
|
||||||
// "argon2/chukwa"
|
// "argon2/chukwa"
|
||||||
const static uint8_t argon2_chukwa_test_out[160] = {
|
const static uint8_t argon2_chukwa_test_out[256] = {
|
||||||
0xC1, 0x58, 0xA1, 0x05, 0xAE, 0x75, 0xC7, 0x56, 0x1C, 0xFD, 0x02, 0x90, 0x83, 0xA4, 0x7A, 0x87,
|
0xC1, 0x58, 0xA1, 0x05, 0xAE, 0x75, 0xC7, 0x56, 0x1C, 0xFD, 0x02, 0x90, 0x83, 0xA4, 0x7A, 0x87,
|
||||||
0x65, 0x3D, 0x51, 0xF9, 0x14, 0x12, 0x8E, 0x21, 0xC1, 0x97, 0x1D, 0x8B, 0x10, 0xC4, 0x90, 0x34,
|
0x65, 0x3D, 0x51, 0xF9, 0x14, 0x12, 0x8E, 0x21, 0xC1, 0x97, 0x1D, 0x8B, 0x10, 0xC4, 0x90, 0x34,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@@ -403,7 +403,7 @@ const static uint8_t argon2_chukwa_test_out[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "argon2/chukwav2"
|
// "argon2/chukwav2"
|
||||||
const static uint8_t argon2_chukwa_v2_test_out[160] = {
|
const static uint8_t argon2_chukwa_v2_test_out[256] = {
|
||||||
0x77, 0xCF, 0x69, 0x58, 0xB3, 0x53, 0x6E, 0x1F, 0x9F, 0x0D, 0x1E, 0xA1, 0x65, 0xF2, 0x28, 0x11,
|
0x77, 0xCF, 0x69, 0x58, 0xB3, 0x53, 0x6E, 0x1F, 0x9F, 0x0D, 0x1E, 0xA1, 0x65, 0xF2, 0x28, 0x11,
|
||||||
0xCA, 0x7B, 0xC4, 0x87, 0xEA, 0x9F, 0x52, 0x03, 0x0B, 0x50, 0x50, 0xC1, 0x7F, 0xCD, 0xD8, 0xF5,
|
0xCA, 0x7B, 0xC4, 0x87, 0xEA, 0x9F, 0x52, 0x03, 0x0B, 0x50, 0x50, 0xC1, 0x7F, 0xCD, 0xD8, 0xF5,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@@ -417,7 +417,7 @@ const static uint8_t argon2_chukwa_v2_test_out[160] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// "argon2/wrkz"
|
// "argon2/wrkz"
|
||||||
const static uint8_t argon2_wrkz_test_out[160] = {
|
const static uint8_t argon2_wrkz_test_out[256] = {
|
||||||
0x35, 0xE0, 0x83, 0xD4, 0xB9, 0xC6, 0x4C, 0x2A, 0x68, 0x82, 0x0A, 0x43, 0x1F, 0x61, 0x31, 0x19,
|
0x35, 0xE0, 0x83, 0xD4, 0xB9, 0xC6, 0x4C, 0x2A, 0x68, 0x82, 0x0A, 0x43, 0x1F, 0x61, 0x31, 0x19,
|
||||||
0x98, 0xA8, 0xCD, 0x18, 0x64, 0xDB, 0xA4, 0x07, 0x7E, 0x25, 0xB7, 0xF1, 0x21, 0xD5, 0x4B, 0xD1,
|
0x98, 0xA8, 0xCD, 0x18, 0x64, 0xDB, 0xA4, 0x07, 0x7E, 0x25, 0xB7, 0xF1, 0x21, 0xD5, 0x4B, 0xD1,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@@ -434,7 +434,7 @@ const static uint8_t argon2_wrkz_test_out[160] = {
|
|||||||
|
|
||||||
#ifdef XMRIG_ALGO_ASTROBWT
|
#ifdef XMRIG_ALGO_ASTROBWT
|
||||||
// "astrobwt"
|
// "astrobwt"
|
||||||
const static uint8_t astrobwt_dero_test_out[160] = {
|
const static uint8_t astrobwt_dero_test_out[256] = {
|
||||||
0x7E, 0x88, 0x44, 0xF2, 0xD6, 0xB7, 0xA4, 0x34, 0x98, 0xFE, 0x6D, 0x22, 0x65, 0x27, 0x68, 0x90,
|
0x7E, 0x88, 0x44, 0xF2, 0xD6, 0xB7, 0xA4, 0x34, 0x98, 0xFE, 0x6D, 0x22, 0x65, 0x27, 0x68, 0x90,
|
||||||
0x23, 0xDA, 0x8A, 0x52, 0xF9, 0xFC, 0x4E, 0xC6, 0x9E, 0x5A, 0xAA, 0xA6, 0x3E, 0xDC, 0xE1, 0xC1,
|
0x23, 0xDA, 0x8A, 0x52, 0xF9, 0xFC, 0x4E, 0xC6, 0x9E, 0x5A, 0xAA, 0xA6, 0x3E, 0xDC, 0xE1, 0xC1,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
@@ -450,6 +450,29 @@ const static uint8_t astrobwt_dero_test_out[160] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_ALGO_GHOSTRIDER
|
||||||
|
// "GhostRider"
|
||||||
|
const static uint8_t test_output_gr[256] = {
|
||||||
|
0x42, 0x17, 0x0C, 0xC1, 0x85, 0xE6, 0x76, 0x3C, 0xC7, 0xCB, 0x27, 0xC4, 0x17, 0x39, 0x2D, 0xE2,
|
||||||
|
0x29, 0x6B, 0x40, 0x66, 0x85, 0xA4, 0xE3, 0xD3, 0x8C, 0xE9, 0xA5, 0x8F, 0x10, 0xFC, 0x81, 0xE4,
|
||||||
|
0x90, 0x56, 0xF2, 0x9E, 0x00, 0xD0, 0xF8, 0xA1, 0x88, 0x82, 0x86, 0xC0, 0x86, 0x04, 0x6B, 0x0E,
|
||||||
|
0x9A, 0xDB, 0xDB, 0xFD, 0x23, 0x16, 0x77, 0x94, 0xFE, 0x58, 0x93, 0x05, 0x10, 0x3F, 0x27, 0x75,
|
||||||
|
0x51, 0x44, 0xF3, 0x5F, 0xE2, 0xF9, 0x61, 0xBE, 0xC0, 0x30, 0xB5, 0x8E, 0xB1, 0x1B, 0xA1, 0xF7,
|
||||||
|
0x06, 0x4E, 0xF1, 0x6A, 0xFD, 0xA5, 0x44, 0x8E, 0x64, 0x47, 0x8C, 0x67, 0x51, 0xE2, 0x5C, 0x55,
|
||||||
|
0x3E, 0x39, 0xA6, 0xA5, 0xF7, 0xB8, 0xD0, 0x5E, 0xE2, 0xBF, 0x92, 0x44, 0xD9, 0xAA, 0x76, 0x22,
|
||||||
|
0xE3, 0x3E, 0x15, 0x96, 0xD8, 0x6A, 0x78, 0x2D, 0xA9, 0x77, 0x24, 0x1A, 0x4B, 0xE7, 0x5A, 0x2E,
|
||||||
|
0x89, 0x77, 0xAE, 0x92, 0xE4, 0xA4, 0x2D, 0xAF, 0x0B, 0x27, 0x09, 0xB2, 0x5F, 0x95, 0x61, 0xA9,
|
||||||
|
0xA8, 0xBE, 0x5D, 0x39, 0xBE, 0x41, 0x5F, 0x9C, 0x67, 0x28, 0x48, 0x4F, 0xAE, 0x2A, 0x50, 0x2B,
|
||||||
|
0xB8, 0xC7, 0x42, 0x73, 0x51, 0x60, 0x59, 0xD8, 0x9C, 0xBA, 0x22, 0x2F, 0x8E, 0x34, 0xDE, 0xC8,
|
||||||
|
0x1B, 0xAE, 0x9E, 0xBD, 0xF7, 0xE8, 0xFD, 0x8A, 0x97, 0xBE, 0xF0, 0x47, 0xAC, 0x27, 0xDD, 0x28,
|
||||||
|
0xC9, 0x28, 0xA8, 0x7B, 0x2A, 0xB8, 0x90, 0x3E, 0xCA, 0xB4, 0x78, 0x44, 0xCE, 0xCD, 0x91, 0xEC,
|
||||||
|
0xC2, 0x5A, 0x17, 0x59, 0x7C, 0x14, 0xF8, 0x95, 0x28, 0x14, 0xC3, 0xAD, 0xC4, 0xE1, 0x13, 0x5A,
|
||||||
|
0xC4, 0xA7, 0xC7, 0x77, 0xAD, 0xF8, 0x09, 0x61, 0x16, 0xBB, 0xAA, 0x7E, 0xAB, 0xC3, 0x00, 0x25,
|
||||||
|
0xBA, 0xA8, 0x97, 0xC7, 0x7D, 0x38, 0x46, 0x0E, 0x59, 0xAC, 0xCB, 0xAE, 0xFE, 0x3C, 0x6F, 0x01
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -43,6 +43,11 @@
|
|||||||
#include "crypto/cn/soft_aes.h"
|
#include "crypto/cn/soft_aes.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_VAES
|
||||||
|
# include "crypto/cn/CryptoNight_x86_vaes.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#include "crypto/cn/c_groestl.h"
|
#include "crypto/cn/c_groestl.h"
|
||||||
@@ -285,23 +290,48 @@ inline constexpr uint64_t interleaved_index<0>(uint64_t k)
|
|||||||
|
|
||||||
|
|
||||||
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
||||||
static inline void cn_explode_scratchpad(const __m128i *input, __m128i *output)
|
static NOINLINE void cn_explode_scratchpad(cryptonight_ctx *ctx)
|
||||||
{
|
{
|
||||||
constexpr CnAlgo<ALGO> props;
|
constexpr CnAlgo<ALGO> props;
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes(ctx, props.memory(), props.half_mem());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
constexpr size_t N = (props.memory() / sizeof(__m128i)) / (props.half_mem() ? 2 : 1);
|
||||||
|
|
||||||
__m128i xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7;
|
__m128i xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7;
|
||||||
__m128i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
__m128i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m128i* input = reinterpret_cast<const __m128i*>(ctx->state);
|
||||||
|
__m128i* output = reinterpret_cast<__m128i*>(ctx->memory);
|
||||||
|
|
||||||
aes_genkey<SOFT_AES>(input, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
aes_genkey<SOFT_AES>(input, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
xin0 = _mm_load_si128(input + 4);
|
if (props.half_mem() && !ctx->first_half) {
|
||||||
xin1 = _mm_load_si128(input + 5);
|
const __m128i* p = reinterpret_cast<const __m128i*>(ctx->save_state);
|
||||||
xin2 = _mm_load_si128(input + 6);
|
xin0 = _mm_load_si128(p + 0);
|
||||||
xin3 = _mm_load_si128(input + 7);
|
xin1 = _mm_load_si128(p + 1);
|
||||||
xin4 = _mm_load_si128(input + 8);
|
xin2 = _mm_load_si128(p + 2);
|
||||||
xin5 = _mm_load_si128(input + 9);
|
xin3 = _mm_load_si128(p + 3);
|
||||||
xin6 = _mm_load_si128(input + 10);
|
xin4 = _mm_load_si128(p + 4);
|
||||||
xin7 = _mm_load_si128(input + 11);
|
xin5 = _mm_load_si128(p + 5);
|
||||||
|
xin6 = _mm_load_si128(p + 6);
|
||||||
|
xin7 = _mm_load_si128(p + 7);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xin0 = _mm_load_si128(input + 4);
|
||||||
|
xin1 = _mm_load_si128(input + 5);
|
||||||
|
xin2 = _mm_load_si128(input + 6);
|
||||||
|
xin3 = _mm_load_si128(input + 7);
|
||||||
|
xin4 = _mm_load_si128(input + 8);
|
||||||
|
xin5 = _mm_load_si128(input + 9);
|
||||||
|
xin6 = _mm_load_si128(input + 10);
|
||||||
|
xin7 = _mm_load_si128(input + 11);
|
||||||
|
}
|
||||||
|
|
||||||
if (props.isHeavy()) {
|
if (props.isHeavy()) {
|
||||||
for (size_t i = 0; i < 16; i++) {
|
for (size_t i = 0; i < 16; i++) {
|
||||||
@@ -320,50 +350,80 @@ static inline void cn_explode_scratchpad(const __m128i *input, __m128i *output)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < props.memory() / sizeof(__m128i); i += 8) {
|
constexpr int output_increment = (64 << interleave) / sizeof(__m128i);
|
||||||
if (interleave > 0) {
|
constexpr int prefetch_dist = 2048 / sizeof(__m128i);
|
||||||
_mm_prefetch((const char*)(output), _MM_HINT_T0);
|
|
||||||
_mm_prefetch((const char*)(output + (64 << interleave) / sizeof(__m128i)), _MM_HINT_T0);
|
|
||||||
}
|
|
||||||
|
|
||||||
aes_round<SOFT_AES>(k0, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
__m128i* e = output + (N << interleave) - prefetch_dist;
|
||||||
aes_round<SOFT_AES>(k1, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
__m128i* prefetch_ptr = output + prefetch_dist;
|
||||||
aes_round<SOFT_AES>(k2, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k3, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k4, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k5, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k6, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k7, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k8, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
aes_round<SOFT_AES>(k9, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
|
||||||
|
|
||||||
_mm_store_si128(output + 0, xin0);
|
for (int i = 0; i < 2; ++i) {
|
||||||
_mm_store_si128(output + 1, xin1);
|
do {
|
||||||
_mm_store_si128(output + 2, xin2);
|
_mm_prefetch((const char*)(prefetch_ptr), _MM_HINT_T0);
|
||||||
_mm_store_si128(output + 3, xin3);
|
_mm_prefetch((const char*)(prefetch_ptr + output_increment), _MM_HINT_T0);
|
||||||
|
|
||||||
constexpr int output_increment = (64 << interleave) / sizeof(__m128i);
|
aes_round<SOFT_AES>(k0, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k1, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k2, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k3, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k4, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k5, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k6, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k7, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k8, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
aes_round<SOFT_AES>(k9, &xin0, &xin1, &xin2, &xin3, &xin4, &xin5, &xin6, &xin7);
|
||||||
|
|
||||||
_mm_store_si128(output + output_increment + 0, xin4);
|
_mm_store_si128(output + 0, xin0);
|
||||||
_mm_store_si128(output + output_increment + 1, xin5);
|
_mm_store_si128(output + 1, xin1);
|
||||||
_mm_store_si128(output + output_increment + 2, xin6);
|
_mm_store_si128(output + 2, xin2);
|
||||||
_mm_store_si128(output + output_increment + 3, xin7);
|
_mm_store_si128(output + 3, xin3);
|
||||||
|
|
||||||
output += output_increment * 2;
|
_mm_store_si128(output + output_increment + 0, xin4);
|
||||||
|
_mm_store_si128(output + output_increment + 1, xin5);
|
||||||
|
_mm_store_si128(output + output_increment + 2, xin6);
|
||||||
|
_mm_store_si128(output + output_increment + 3, xin7);
|
||||||
|
|
||||||
|
output += output_increment * 2;
|
||||||
|
prefetch_ptr += output_increment * 2;
|
||||||
|
} while (output < e);
|
||||||
|
e += prefetch_dist;
|
||||||
|
prefetch_ptr = output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (props.half_mem() && ctx->first_half) {
|
||||||
|
__m128i* p = reinterpret_cast<__m128i*>(ctx->save_state);
|
||||||
|
_mm_store_si128(p + 0, xin0);
|
||||||
|
_mm_store_si128(p + 1, xin1);
|
||||||
|
_mm_store_si128(p + 2, xin2);
|
||||||
|
_mm_store_si128(p + 3, xin3);
|
||||||
|
_mm_store_si128(p + 4, xin4);
|
||||||
|
_mm_store_si128(p + 5, xin5);
|
||||||
|
_mm_store_si128(p + 6, xin6);
|
||||||
|
_mm_store_si128(p + 7, xin7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
||||||
static inline void cn_implode_scratchpad(const __m128i *input, __m128i *output)
|
static NOINLINE void cn_implode_scratchpad(cryptonight_ctx *ctx)
|
||||||
{
|
{
|
||||||
constexpr CnAlgo<ALGO> props;
|
constexpr CnAlgo<ALGO> props;
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes(ctx, props.memory(), props.half_mem());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
constexpr bool IS_HEAVY = props.isHeavy();
|
constexpr bool IS_HEAVY = props.isHeavy();
|
||||||
|
constexpr size_t N = (props.memory() / sizeof(__m128i)) / (props.half_mem() ? 2 : 1);
|
||||||
|
|
||||||
__m128i xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7;
|
__m128i xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7;
|
||||||
__m128i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
__m128i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m128i *input = reinterpret_cast<const __m128i*>(ctx->memory);
|
||||||
|
__m128i *output = reinterpret_cast<__m128i*>(ctx->state);
|
||||||
|
|
||||||
aes_genkey<SOFT_AES>(output + 2, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
aes_genkey<SOFT_AES>(output + 2, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
xout0 = _mm_load_si128(output + 4);
|
xout0 = _mm_load_si128(output + 4);
|
||||||
@@ -376,46 +436,54 @@ static inline void cn_implode_scratchpad(const __m128i *input, __m128i *output)
|
|||||||
xout7 = _mm_load_si128(output + 11);
|
xout7 = _mm_load_si128(output + 11);
|
||||||
|
|
||||||
const __m128i* input_begin = input;
|
const __m128i* input_begin = input;
|
||||||
for (size_t i = 0; i < props.memory() / sizeof(__m128i);) {
|
for (size_t part = 0; part < (props.half_mem() ? 2 : 1); ++part) {
|
||||||
xout0 = _mm_xor_si128(_mm_load_si128(input + 0), xout0);
|
if (props.half_mem() && (part == 1)) {
|
||||||
xout1 = _mm_xor_si128(_mm_load_si128(input + 1), xout1);
|
input = input_begin;
|
||||||
xout2 = _mm_xor_si128(_mm_load_si128(input + 2), xout2);
|
ctx->first_half = false;
|
||||||
xout3 = _mm_xor_si128(_mm_load_si128(input + 3), xout3);
|
cn_explode_scratchpad<ALGO, SOFT_AES, interleave>(ctx);
|
||||||
|
|
||||||
constexpr int input_increment = (64 << interleave) / sizeof(__m128i);
|
|
||||||
|
|
||||||
xout4 = _mm_xor_si128(_mm_load_si128(input + input_increment + 0), xout4);
|
|
||||||
xout5 = _mm_xor_si128(_mm_load_si128(input + input_increment + 1), xout5);
|
|
||||||
xout6 = _mm_xor_si128(_mm_load_si128(input + input_increment + 2), xout6);
|
|
||||||
xout7 = _mm_xor_si128(_mm_load_si128(input + input_increment + 3), xout7);
|
|
||||||
|
|
||||||
input += input_increment * 2;
|
|
||||||
i += 8;
|
|
||||||
|
|
||||||
if ((interleave > 0) && (i < props.memory() / sizeof(__m128i))) {
|
|
||||||
_mm_prefetch((const char*)(input), _MM_HINT_T0);
|
|
||||||
_mm_prefetch((const char*)(input + (64 << interleave) / sizeof(__m128i)), _MM_HINT_T0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
aes_round<SOFT_AES>(k0, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
for (size_t i = 0; i < N;) {
|
||||||
aes_round<SOFT_AES>(k1, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
xout0 = _mm_xor_si128(_mm_load_si128(input + 0), xout0);
|
||||||
aes_round<SOFT_AES>(k2, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
xout1 = _mm_xor_si128(_mm_load_si128(input + 1), xout1);
|
||||||
aes_round<SOFT_AES>(k3, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
xout2 = _mm_xor_si128(_mm_load_si128(input + 2), xout2);
|
||||||
aes_round<SOFT_AES>(k4, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
xout3 = _mm_xor_si128(_mm_load_si128(input + 3), xout3);
|
||||||
aes_round<SOFT_AES>(k5, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
|
||||||
aes_round<SOFT_AES>(k6, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
|
||||||
aes_round<SOFT_AES>(k7, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
|
||||||
aes_round<SOFT_AES>(k8, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
|
||||||
aes_round<SOFT_AES>(k9, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
|
||||||
|
|
||||||
if (IS_HEAVY) {
|
constexpr int input_increment = (64 << interleave) / sizeof(__m128i);
|
||||||
mix_and_propagate(xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
|
||||||
|
xout4 = _mm_xor_si128(_mm_load_si128(input + input_increment + 0), xout4);
|
||||||
|
xout5 = _mm_xor_si128(_mm_load_si128(input + input_increment + 1), xout5);
|
||||||
|
xout6 = _mm_xor_si128(_mm_load_si128(input + input_increment + 2), xout6);
|
||||||
|
xout7 = _mm_xor_si128(_mm_load_si128(input + input_increment + 3), xout7);
|
||||||
|
|
||||||
|
input += input_increment * 2;
|
||||||
|
i += 8;
|
||||||
|
|
||||||
|
if (i < N) {
|
||||||
|
_mm_prefetch((const char*)(input), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(input + input_increment), _MM_HINT_T0);
|
||||||
|
}
|
||||||
|
|
||||||
|
aes_round<SOFT_AES>(k0, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k1, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k2, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k3, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k4, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k5, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k6, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k7, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k8, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
aes_round<SOFT_AES>(k9, &xout0, &xout1, &xout2, &xout3, &xout4, &xout5, &xout6, &xout7);
|
||||||
|
|
||||||
|
if (IS_HEAVY) {
|
||||||
|
mix_and_propagate(xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IS_HEAVY) {
|
if (IS_HEAVY) {
|
||||||
input = input_begin;
|
input = input_begin;
|
||||||
for (size_t i = 0; i < props.memory() / sizeof(__m128i);) {
|
for (size_t i = 0; i < N;) {
|
||||||
xout0 = _mm_xor_si128(_mm_load_si128(input + 0), xout0);
|
xout0 = _mm_xor_si128(_mm_load_si128(input + 0), xout0);
|
||||||
xout1 = _mm_xor_si128(_mm_load_si128(input + 1), xout1);
|
xout1 = _mm_xor_si128(_mm_load_si128(input + 1), xout1);
|
||||||
xout2 = _mm_xor_si128(_mm_load_si128(input + 2), xout2);
|
xout2 = _mm_xor_si128(_mm_load_si128(input + 2), xout2);
|
||||||
@@ -523,6 +591,9 @@ static inline __m128i int_sqrt_v2(const uint64_t n0)
|
|||||||
void v4_soft_aes_compile_code(const V4_Instruction *code, int code_size, void *machine_code, xmrig::Assembly ASM);
|
void v4_soft_aes_compile_code(const V4_Instruction *code, int code_size, void *machine_code, xmrig::Assembly ASM);
|
||||||
|
|
||||||
|
|
||||||
|
alignas(64) static const uint32_t tweak1_table[256] = { 268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,268435456,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,805306368,0,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456,805306368,268435456 };
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
@@ -541,12 +612,7 @@ static inline void cryptonight_monero_tweak(uint64_t *mem_out, const uint8_t *l,
|
|||||||
tmp = _mm_castps_si128(_mm_movehl_ps(_mm_castsi128_ps(tmp), _mm_castsi128_ps(tmp)));
|
tmp = _mm_castps_si128(_mm_movehl_ps(_mm_castsi128_ps(tmp), _mm_castsi128_ps(tmp)));
|
||||||
uint64_t vh = _mm_cvtsi128_si64(tmp);
|
uint64_t vh = _mm_cvtsi128_si64(tmp);
|
||||||
|
|
||||||
uint8_t x = static_cast<uint8_t>(vh >> 24);
|
mem_out[1] = vh ^ tweak1_table[static_cast<uint32_t>(vh) >> 24];
|
||||||
static const uint16_t table = 0x7531;
|
|
||||||
const uint8_t index = (((x >> (3)) & 6) | (x & 1)) << 1;
|
|
||||||
vh ^= ((table >> index) & 0x3) << 28;
|
|
||||||
|
|
||||||
mem_out[1] = vh;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -568,9 +634,35 @@ static inline void cryptonight_conceal_tweak(__m128i& cx, __m128& conc_var)
|
|||||||
cx = _mm_xor_si128(cx, _mm_cvttps_epi32(nc));
|
cx = _mm_xor_si128(cx, _mm_cvttps_epi32(nc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_ASM
|
||||||
|
template<Algorithm::Id ALGO>
|
||||||
|
static void cryptonight_single_hash_gr_sse41(const uint8_t* __restrict__ input, size_t size, uint8_t* __restrict__ output, cryptonight_ctx** __restrict__ ctx, uint64_t height);
|
||||||
|
#endif
|
||||||
|
|
||||||
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
template<Algorithm::Id ALGO, bool SOFT_AES, int interleave>
|
||||||
inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
|
if (!SOFT_AES) {
|
||||||
|
switch (ALGO) {
|
||||||
|
case Algorithm::CN_GR_0:
|
||||||
|
case Algorithm::CN_GR_1:
|
||||||
|
case Algorithm::CN_GR_2:
|
||||||
|
case Algorithm::CN_GR_3:
|
||||||
|
case Algorithm::CN_GR_4:
|
||||||
|
case Algorithm::CN_GR_5:
|
||||||
|
if (cn_sse41_enabled) {
|
||||||
|
cryptonight_single_hash_gr_sse41<ALGO>(input, size, output, ctx, height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
constexpr CnAlgo<ALGO> props;
|
constexpr CnAlgo<ALGO> props;
|
||||||
constexpr size_t MASK = props.mask();
|
constexpr size_t MASK = props.mask();
|
||||||
constexpr Algorithm::Id BASE = props.base();
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
@@ -587,7 +679,11 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
}
|
}
|
||||||
|
|
||||||
keccak(input, size, ctx[0]->state);
|
keccak(input, size, ctx[0]->state);
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, interleave>(reinterpret_cast<const __m128i *>(ctx[0]->state), reinterpret_cast<__m128i *>(ctx[0]->memory));
|
|
||||||
|
if (props.half_mem()) {
|
||||||
|
ctx[0]->first_half = true;
|
||||||
|
}
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, interleave>(ctx[0]);
|
||||||
|
|
||||||
uint64_t *h0 = reinterpret_cast<uint64_t*>(ctx[0]->state);
|
uint64_t *h0 = reinterpret_cast<uint64_t*>(ctx[0]->state);
|
||||||
uint8_t *l0 = ctx[0]->memory;
|
uint8_t *l0 = ctx[0]->memory;
|
||||||
@@ -712,7 +808,7 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
|
|
||||||
int64_t d5;
|
int64_t d5;
|
||||||
|
|
||||||
# if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 8))
|
# if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 8)) || !defined(XMRIG_64_BIT)
|
||||||
d5 = d | 5;
|
d5 = d | 5;
|
||||||
# else
|
# else
|
||||||
// Workaround for stupid GCC which converts to 32 bit before doing "| 5" and then converts back to 64 bit
|
// Workaround for stupid GCC which converts to 32 bit before doing "| 5" and then converts back to 64 bit
|
||||||
@@ -742,7 +838,7 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, interleave>(reinterpret_cast<const __m128i *>(ctx[0]->memory), reinterpret_cast<__m128i *>(ctx[0]->state));
|
cn_implode_scratchpad<ALGO, SOFT_AES, interleave>(ctx[0]);
|
||||||
keccakf(h0, 24);
|
keccakf(h0, 24);
|
||||||
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
||||||
}
|
}
|
||||||
@@ -752,13 +848,16 @@ inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
|
|
||||||
|
|
||||||
#ifdef XMRIG_FEATURE_ASM
|
#ifdef XMRIG_FEATURE_ASM
|
||||||
|
extern "C" void cnv1_single_mainloop_asm(cryptonight_ctx * *ctx);
|
||||||
|
extern "C" void cnv1_double_mainloop_asm(cryptonight_ctx **ctx);
|
||||||
|
extern "C" void cnv1_quad_mainloop_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_mainloop_ivybridge_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_mainloop_ivybridge_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_mainloop_ryzen_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_mainloop_ryzen_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_mainloop_bulldozer_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_mainloop_bulldozer_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_double_mainloop_sandybridge_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_double_mainloop_sandybridge_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_rwz_mainloop_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_rwz_mainloop_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_rwz_double_mainloop_asm(cryptonight_ctx **ctx);
|
extern "C" void cnv2_rwz_double_mainloop_asm(cryptonight_ctx **ctx);
|
||||||
extern "C" void cnv2_upx_double_mainloop_zen3_asm(cryptonight_ctx * *ctx);
|
extern "C" void cnv2_upx_double_mainloop_zen3_asm(cryptonight_ctx **ctx);
|
||||||
|
|
||||||
|
|
||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
@@ -795,6 +894,28 @@ extern cn_mainloop_fun cn_double_double_mainloop_sandybridge_asm;
|
|||||||
extern cn_mainloop_fun cn_upx2_mainloop_asm;
|
extern cn_mainloop_fun cn_upx2_mainloop_asm;
|
||||||
extern cn_mainloop_fun cn_upx2_double_mainloop_asm;
|
extern cn_mainloop_fun cn_upx2_double_mainloop_asm;
|
||||||
|
|
||||||
|
extern cn_mainloop_fun cn_gr0_single_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr1_single_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr2_single_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr3_single_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr4_single_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr5_single_mainloop_asm;
|
||||||
|
|
||||||
|
extern cn_mainloop_fun cn_gr0_double_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr1_double_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr2_double_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr3_double_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr4_double_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr5_double_mainloop_asm;
|
||||||
|
|
||||||
|
extern cn_mainloop_fun cn_gr0_quad_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr1_quad_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr2_quad_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr3_quad_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr4_quad_mainloop_asm;
|
||||||
|
extern cn_mainloop_fun cn_gr5_quad_mainloop_asm;
|
||||||
|
|
||||||
|
|
||||||
} // namespace xmrig
|
} // namespace xmrig
|
||||||
|
|
||||||
|
|
||||||
@@ -833,7 +954,11 @@ inline void cryptonight_single_hash_asm(const uint8_t *__restrict__ input, size_
|
|||||||
}
|
}
|
||||||
|
|
||||||
keccak(input, size, ctx[0]->state);
|
keccak(input, size, ctx[0]->state);
|
||||||
cn_explode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[0]->state), reinterpret_cast<__m128i*>(ctx[0]->memory));
|
|
||||||
|
if (props.half_mem()) {
|
||||||
|
ctx[0]->first_half = true;
|
||||||
|
}
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
|
||||||
if (ALGO == Algorithm::CN_2) {
|
if (ALGO == Algorithm::CN_2) {
|
||||||
if (ASM == Assembly::INTEL) {
|
if (ASM == Assembly::INTEL) {
|
||||||
@@ -915,7 +1040,7 @@ inline void cryptonight_single_hash_asm(const uint8_t *__restrict__ input, size_
|
|||||||
ctx[0]->generated_code(ctx);
|
ctx[0]->generated_code(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
cn_implode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[0]->memory), reinterpret_cast<__m128i*>(ctx[0]->state));
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
||||||
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
||||||
}
|
}
|
||||||
@@ -937,8 +1062,21 @@ inline void cryptonight_double_hash_asm(const uint8_t *__restrict__ input, size_
|
|||||||
keccak(input, size, ctx[0]->state);
|
keccak(input, size, ctx[0]->state);
|
||||||
keccak(input + size, size, ctx[1]->state);
|
keccak(input + size, size, ctx[1]->state);
|
||||||
|
|
||||||
cn_explode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[0]->state), reinterpret_cast<__m128i*>(ctx[0]->memory));
|
if (props.half_mem()) {
|
||||||
cn_explode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[1]->state), reinterpret_cast<__m128i*>(ctx[1]->memory));
|
ctx[0]->first_half = true;
|
||||||
|
ctx[1]->first_half = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
if (ALGO == Algorithm::CN_2) {
|
if (ALGO == Algorithm::CN_2) {
|
||||||
cnv2_double_mainloop_sandybridge_asm(ctx);
|
cnv2_double_mainloop_sandybridge_asm(ctx);
|
||||||
@@ -977,8 +1115,16 @@ inline void cryptonight_double_hash_asm(const uint8_t *__restrict__ input, size_
|
|||||||
ctx[0]->generated_code(ctx);
|
ctx[0]->generated_code(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
cn_implode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[0]->memory), reinterpret_cast<__m128i*>(ctx[0]->state));
|
# ifdef XMRIG_VAES
|
||||||
cn_implode_scratchpad<ALGO, false, 0>(reinterpret_cast<const __m128i*>(ctx[1]->memory), reinterpret_cast<__m128i*>(ctx[1]->state));
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[1]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[1]->state), 24);
|
||||||
@@ -995,9 +1141,130 @@ inline void cryptonight_double_hash_asm(const uint8_t *__restrict__ input, size_
|
|||||||
namespace xmrig {
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_ASM
|
||||||
|
template<Algorithm::Id ALGO>
|
||||||
|
static NOINLINE void cryptonight_single_hash_gr_sse41(const uint8_t* __restrict__ input, size_t size, uint8_t* __restrict__ output, cryptonight_ctx** __restrict__ ctx, uint64_t height)
|
||||||
|
{
|
||||||
|
constexpr CnAlgo<ALGO> props;
|
||||||
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
|
|
||||||
|
if (BASE == Algorithm::CN_1 && size < 43) {
|
||||||
|
memset(output, 0, 32);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
keccak(input, size, ctx[0]->state);
|
||||||
|
|
||||||
|
if (props.half_mem()) {
|
||||||
|
ctx[0]->first_half = true;
|
||||||
|
}
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
|
||||||
|
VARIANT1_INIT(0);
|
||||||
|
ctx[0]->tweak1_2 = tweak1_2_0;
|
||||||
|
ctx[0]->tweak1_table = tweak1_table;
|
||||||
|
if (ALGO == Algorithm::CN_GR_0) cn_gr0_single_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_1) cn_gr1_single_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_2) cn_gr2_single_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_3) cn_gr3_single_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_4) cn_gr4_single_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_5) cn_gr5_single_mainloop_asm(ctx);
|
||||||
|
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
||||||
|
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<Algorithm::Id ALGO>
|
||||||
|
static NOINLINE void cryptonight_double_hash_gr_sse41(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
||||||
|
{
|
||||||
|
constexpr CnAlgo<ALGO> props;
|
||||||
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
|
|
||||||
|
if (BASE == Algorithm::CN_1 && size < 43) {
|
||||||
|
memset(output, 0, 64);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
keccak(input, size, ctx[0]->state);
|
||||||
|
keccak(input + size, size, ctx[1]->state);
|
||||||
|
|
||||||
|
if (props.half_mem()) {
|
||||||
|
ctx[0]->first_half = true;
|
||||||
|
ctx[1]->first_half = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
VARIANT1_INIT(0);
|
||||||
|
VARIANT1_INIT(1);
|
||||||
|
|
||||||
|
ctx[0]->tweak1_2 = tweak1_2_0;
|
||||||
|
ctx[1]->tweak1_2 = tweak1_2_1;
|
||||||
|
|
||||||
|
ctx[0]->tweak1_table = tweak1_table;
|
||||||
|
|
||||||
|
if (ALGO == Algorithm::CN_GR_0) cn_gr0_double_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_1) cn_gr1_double_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_2) cn_gr2_double_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_3) cn_gr3_double_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_4) cn_gr4_double_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_5) cn_gr5_double_mainloop_asm(ctx);
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[1]->state), 24);
|
||||||
|
|
||||||
|
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
||||||
|
extra_hashes[ctx[1]->state[0] & 3](ctx[1]->state, 200, output + 32);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
template<Algorithm::Id ALGO, bool SOFT_AES>
|
template<Algorithm::Id ALGO, bool SOFT_AES>
|
||||||
inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
|
if (!SOFT_AES) {
|
||||||
|
switch (ALGO) {
|
||||||
|
case Algorithm::CN_GR_0:
|
||||||
|
case Algorithm::CN_GR_1:
|
||||||
|
case Algorithm::CN_GR_2:
|
||||||
|
case Algorithm::CN_GR_3:
|
||||||
|
case Algorithm::CN_GR_4:
|
||||||
|
case Algorithm::CN_GR_5:
|
||||||
|
if (cn_sse41_enabled) {
|
||||||
|
cryptonight_double_hash_gr_sse41<ALGO>(input, size, output, ctx, height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
constexpr CnAlgo<ALGO> props;
|
constexpr CnAlgo<ALGO> props;
|
||||||
constexpr size_t MASK = props.mask();
|
constexpr size_t MASK = props.mask();
|
||||||
constexpr Algorithm::Id BASE = props.base();
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
@@ -1029,8 +1296,21 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
VARIANT4_RANDOM_MATH_INIT(0);
|
VARIANT4_RANDOM_MATH_INIT(0);
|
||||||
VARIANT4_RANDOM_MATH_INIT(1);
|
VARIANT4_RANDOM_MATH_INIT(1);
|
||||||
|
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i *>(h0), reinterpret_cast<__m128i *>(l0));
|
if (props.half_mem()) {
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i *>(h1), reinterpret_cast<__m128i *>(l1));
|
ctx[0]->first_half = true;
|
||||||
|
ctx[1]->first_half = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[0]);
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t al0 = h0[0] ^ h0[4];
|
uint64_t al0 = h0[0] ^ h0[4];
|
||||||
uint64_t al1 = h1[0] ^ h1[4];
|
uint64_t al1 = h1[0] ^ h1[4];
|
||||||
@@ -1225,8 +1505,16 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
bx10 = cx1;
|
bx10 = cx1;
|
||||||
}
|
}
|
||||||
|
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i *>(l0), reinterpret_cast<__m128i *>(h0));
|
# ifdef XMRIG_VAES
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i *>(l1), reinterpret_cast<__m128i *>(h1));
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[0]);
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[1]);
|
||||||
|
}
|
||||||
|
|
||||||
keccakf(h0, 24);
|
keccakf(h0, 24);
|
||||||
keccakf(h1, 24);
|
keccakf(h1, 24);
|
||||||
@@ -1236,6 +1524,85 @@ inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XMRIG_FEATURE_ASM
|
||||||
|
template<Algorithm::Id ALGO>
|
||||||
|
static NOINLINE void cryptonight_quad_hash_gr_sse41(const uint8_t* __restrict__ input, size_t size, uint8_t* __restrict__ output, cryptonight_ctx** __restrict__ ctx, uint64_t height)
|
||||||
|
{
|
||||||
|
constexpr CnAlgo<ALGO> props;
|
||||||
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
|
|
||||||
|
if (BASE == Algorithm::CN_1 && size < 43) {
|
||||||
|
memset(output, 0, 32 * 4);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
keccak(input + size * 0, size, ctx[0]->state);
|
||||||
|
keccak(input + size * 1, size, ctx[1]->state);
|
||||||
|
keccak(input + size * 2, size, ctx[2]->state);
|
||||||
|
keccak(input + size * 3, size, ctx[3]->state);
|
||||||
|
|
||||||
|
if (props.half_mem()) {
|
||||||
|
ctx[0]->first_half = true;
|
||||||
|
ctx[1]->first_half = true;
|
||||||
|
ctx[2]->first_half = true;
|
||||||
|
ctx[3]->first_half = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[2], ctx[3], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[2]);
|
||||||
|
cn_explode_scratchpad<ALGO, false, 0>(ctx[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
VARIANT1_INIT(0); ctx[0]->tweak1_2 = tweak1_2_0;
|
||||||
|
VARIANT1_INIT(1); ctx[1]->tweak1_2 = tweak1_2_1;
|
||||||
|
VARIANT1_INIT(2); ctx[2]->tweak1_2 = tweak1_2_2;
|
||||||
|
VARIANT1_INIT(3); ctx[3]->tweak1_2 = tweak1_2_3;
|
||||||
|
|
||||||
|
ctx[0]->tweak1_table = tweak1_table;
|
||||||
|
|
||||||
|
if (ALGO == Algorithm::CN_GR_0) cn_gr0_quad_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_1) cn_gr1_quad_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_2) cn_gr2_quad_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_3) cn_gr3_quad_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_4) cn_gr4_quad_mainloop_asm(ctx);
|
||||||
|
if (ALGO == Algorithm::CN_GR_5) cn_gr5_quad_mainloop_asm(ctx);
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[2], ctx[3], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[0]);
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[1]);
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[2]);
|
||||||
|
cn_implode_scratchpad<ALGO, false, 0>(ctx[3]);
|
||||||
|
}
|
||||||
|
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[0]->state), 24);
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[1]->state), 24);
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[2]->state), 24);
|
||||||
|
keccakf(reinterpret_cast<uint64_t*>(ctx[3]->state), 24);
|
||||||
|
|
||||||
|
extra_hashes[ctx[0]->state[0] & 3](ctx[0]->state, 200, output);
|
||||||
|
extra_hashes[ctx[1]->state[0] & 3](ctx[1]->state, 200, output + 32);
|
||||||
|
extra_hashes[ctx[2]->state[0] & 3](ctx[2]->state, 200, output + 64);
|
||||||
|
extra_hashes[ctx[3]->state[0] & 3](ctx[3]->state, 200, output + 96);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define CN_STEP1(a, b0, b1, c, l, ptr, idx, conc_var) \
|
#define CN_STEP1(a, b0, b1, c, l, ptr, idx, conc_var) \
|
||||||
ptr = reinterpret_cast<__m128i*>(&l[idx & MASK]); \
|
ptr = reinterpret_cast<__m128i*>(&l[idx & MASK]); \
|
||||||
c = _mm_load_si128(ptr); \
|
c = _mm_load_si128(ptr); \
|
||||||
@@ -1371,7 +1738,10 @@ inline void cryptonight_triple_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
|
|
||||||
for (size_t i = 0; i < 3; i++) {
|
for (size_t i = 0; i < 3; i++) {
|
||||||
keccak(input + size * i, size, ctx[i]->state);
|
keccak(input + size * i, size, ctx[i]->state);
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->state), reinterpret_cast<__m128i*>(ctx[i]->memory));
|
if (props.half_mem()) {
|
||||||
|
ctx[i]->first_half = true;
|
||||||
|
}
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* l0 = ctx[0]->memory;
|
uint8_t* l0 = ctx[0]->memory;
|
||||||
@@ -1416,7 +1786,7 @@ inline void cryptonight_triple_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < 3; i++) {
|
for (size_t i = 0; i < 3; i++) {
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->memory), reinterpret_cast<__m128i*>(ctx[i]->state));
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[i]);
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
||||||
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
||||||
}
|
}
|
||||||
@@ -1426,6 +1796,27 @@ inline void cryptonight_triple_hash(const uint8_t *__restrict__ input, size_t si
|
|||||||
template<Algorithm::Id ALGO, bool SOFT_AES>
|
template<Algorithm::Id ALGO, bool SOFT_AES>
|
||||||
inline void cryptonight_quad_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
inline void cryptonight_quad_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx **__restrict__ ctx, uint64_t height)
|
||||||
{
|
{
|
||||||
|
# ifdef XMRIG_FEATURE_ASM
|
||||||
|
if (!SOFT_AES) {
|
||||||
|
switch (ALGO) {
|
||||||
|
case Algorithm::CN_GR_0:
|
||||||
|
case Algorithm::CN_GR_1:
|
||||||
|
case Algorithm::CN_GR_2:
|
||||||
|
case Algorithm::CN_GR_3:
|
||||||
|
case Algorithm::CN_GR_4:
|
||||||
|
case Algorithm::CN_GR_5:
|
||||||
|
if (cn_sse41_enabled) {
|
||||||
|
cryptonight_quad_hash_gr_sse41<ALGO>(input, size, output, ctx, height);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
constexpr CnAlgo<ALGO> props;
|
constexpr CnAlgo<ALGO> props;
|
||||||
constexpr size_t MASK = props.mask();
|
constexpr size_t MASK = props.mask();
|
||||||
constexpr Algorithm::Id BASE = props.base();
|
constexpr Algorithm::Id BASE = props.base();
|
||||||
@@ -1445,7 +1836,23 @@ inline void cryptonight_quad_hash(const uint8_t *__restrict__ input, size_t size
|
|||||||
|
|
||||||
for (size_t i = 0; i < 4; i++) {
|
for (size_t i = 0; i < 4; i++) {
|
||||||
keccak(input + size * i, size, ctx[i]->state);
|
keccak(input + size * i, size, ctx[i]->state);
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->state), reinterpret_cast<__m128i*>(ctx[i]->memory));
|
if (props.half_mem()) {
|
||||||
|
ctx[i]->first_half = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx[2], ctx[3], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[0]);
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[1]);
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[2]);
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* l0 = ctx[0]->memory;
|
uint8_t* l0 = ctx[0]->memory;
|
||||||
@@ -1497,8 +1904,21 @@ inline void cryptonight_quad_hash(const uint8_t *__restrict__ input, size_t size
|
|||||||
CN_STEP4(3, ax3, bx30, bx31, cx3, l3, mc3, ptr3, idx3);
|
CN_STEP4(3, ax3, bx30, bx31, cx3, l3, mc3, ptr3, idx3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef XMRIG_VAES
|
||||||
|
if (!SOFT_AES && !props.isHeavy() && cn_vaes_enabled) {
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[0], ctx[1], props.memory(), props.half_mem());
|
||||||
|
cn_implode_scratchpad_vaes_double(ctx[2], ctx[3], props.memory(), props.half_mem());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
# endif
|
||||||
|
{
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[0]);
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[1]);
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[2]);
|
||||||
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[3]);
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < 4; i++) {
|
for (size_t i = 0; i < 4; i++) {
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->memory), reinterpret_cast<__m128i*>(ctx[i]->state));
|
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
||||||
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
||||||
}
|
}
|
||||||
@@ -1527,7 +1947,10 @@ inline void cryptonight_penta_hash(const uint8_t *__restrict__ input, size_t siz
|
|||||||
|
|
||||||
for (size_t i = 0; i < 5; i++) {
|
for (size_t i = 0; i < 5; i++) {
|
||||||
keccak(input + size * i, size, ctx[i]->state);
|
keccak(input + size * i, size, ctx[i]->state);
|
||||||
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->state), reinterpret_cast<__m128i*>(ctx[i]->memory));
|
if (props.half_mem()) {
|
||||||
|
ctx[i]->first_half = true;
|
||||||
|
}
|
||||||
|
cn_explode_scratchpad<ALGO, SOFT_AES, 0>(ctx[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t* l0 = ctx[0]->memory;
|
uint8_t* l0 = ctx[0]->memory;
|
||||||
@@ -1588,7 +2011,7 @@ inline void cryptonight_penta_hash(const uint8_t *__restrict__ input, size_t siz
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < 5; i++) {
|
for (size_t i = 0; i < 5; i++) {
|
||||||
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(reinterpret_cast<const __m128i*>(ctx[i]->memory), reinterpret_cast<__m128i*>(ctx[i]->state));
|
cn_implode_scratchpad<ALGO, SOFT_AES, 0>(ctx[i]);
|
||||||
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
keccakf(reinterpret_cast<uint64_t*>(ctx[i]->state), 24);
|
||||||
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
extra_hashes[ctx[i]->state[0] & 3](ctx[i]->state, 200, output + 32 * i);
|
||||||
}
|
}
|
||||||
|
|||||||
478
src/crypto/cn/CryptoNight_x86_vaes.cpp
Normal file
478
src/crypto/cn/CryptoNight_x86_vaes.cpp
Normal file
@@ -0,0 +1,478 @@
|
|||||||
|
/* XMRig
|
||||||
|
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||||
|
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||||
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "CryptoNight_x86_vaes.h"
|
||||||
|
#include "CryptoNight_monero.h"
|
||||||
|
#include "CryptoNight.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# include <x86intrin.h>
|
||||||
|
#if !defined(__clang__) && !defined(__ICC) && __GNUC__ < 10
|
||||||
|
static inline __m256i
|
||||||
|
__attribute__((__always_inline__))
|
||||||
|
_mm256_loadu2_m128i(const __m128i* const hiaddr, const __m128i* const loaddr)
|
||||||
|
{
|
||||||
|
return _mm256_inserti128_si256(
|
||||||
|
_mm256_castsi128_si256(_mm_loadu_si128(loaddr)), _mm_loadu_si128(hiaddr), 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
__attribute__((__always_inline__))
|
||||||
|
_mm256_storeu2_m128i(__m128i* const hiaddr, __m128i* const loaddr, const __m256i a)
|
||||||
|
{
|
||||||
|
_mm_storeu_si128(loaddr, _mm256_castsi256_si128(a));
|
||||||
|
_mm_storeu_si128(hiaddr, _mm256_extracti128_si256(a, 1));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
# include <intrin.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// This will shift and xor tmp1 into itself as 4 32-bit vals such as
|
||||||
|
// sl_xor(a1 a2 a3 a4) = a1 (a2^a1) (a3^a2^a1) (a4^a3^a2^a1)
|
||||||
|
static FORCEINLINE __m128i sl_xor(__m128i tmp1)
|
||||||
|
{
|
||||||
|
__m128i tmp4;
|
||||||
|
tmp4 = _mm_slli_si128(tmp1, 0x04);
|
||||||
|
tmp1 = _mm_xor_si128(tmp1, tmp4);
|
||||||
|
tmp4 = _mm_slli_si128(tmp4, 0x04);
|
||||||
|
tmp1 = _mm_xor_si128(tmp1, tmp4);
|
||||||
|
tmp4 = _mm_slli_si128(tmp4, 0x04);
|
||||||
|
tmp1 = _mm_xor_si128(tmp1, tmp4);
|
||||||
|
return tmp1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<uint8_t rcon>
|
||||||
|
static FORCEINLINE void aes_genkey_sub(__m128i* xout0, __m128i* xout2)
|
||||||
|
{
|
||||||
|
__m128i xout1 = _mm_aeskeygenassist_si128(*xout2, rcon);
|
||||||
|
xout1 = _mm_shuffle_epi32(xout1, 0xFF); // see PSHUFD, set all elems to 4th elem
|
||||||
|
*xout0 = sl_xor(*xout0);
|
||||||
|
*xout0 = _mm_xor_si128(*xout0, xout1);
|
||||||
|
xout1 = _mm_aeskeygenassist_si128(*xout0, 0x00);
|
||||||
|
xout1 = _mm_shuffle_epi32(xout1, 0xAA); // see PSHUFD, set all elems to 3rd elem
|
||||||
|
*xout2 = sl_xor(*xout2);
|
||||||
|
*xout2 = _mm_xor_si128(*xout2, xout1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NOINLINE void vaes_genkey(const __m128i* memory, __m256i* k0, __m256i* k1, __m256i* k2, __m256i* k3, __m256i* k4, __m256i* k5, __m256i* k6, __m256i* k7, __m256i* k8, __m256i* k9)
|
||||||
|
{
|
||||||
|
__m128i xout0 = _mm_load_si128(memory);
|
||||||
|
__m128i xout2 = _mm_load_si128(memory + 1);
|
||||||
|
*k0 = _mm256_set_m128i(xout0, xout0);
|
||||||
|
*k1 = _mm256_set_m128i(xout2, xout2);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x01>(&xout0, &xout2);
|
||||||
|
*k2 = _mm256_set_m128i(xout0, xout0);
|
||||||
|
*k3 = _mm256_set_m128i(xout2, xout2);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x02>(&xout0, &xout2);
|
||||||
|
*k4 = _mm256_set_m128i(xout0, xout0);
|
||||||
|
*k5 = _mm256_set_m128i(xout2, xout2);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x04>(&xout0, &xout2);
|
||||||
|
*k6 = _mm256_set_m128i(xout0, xout0);
|
||||||
|
*k7 = _mm256_set_m128i(xout2, xout2);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x08>(&xout0, &xout2);
|
||||||
|
*k8 = _mm256_set_m128i(xout0, xout0);
|
||||||
|
*k9 = _mm256_set_m128i(xout2, xout2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NOINLINE void vaes_genkey_double(const __m128i* memory1, const __m128i* memory2, __m256i* k0, __m256i* k1, __m256i* k2, __m256i* k3, __m256i* k4, __m256i* k5, __m256i* k6, __m256i* k7, __m256i* k8, __m256i* k9)
|
||||||
|
{
|
||||||
|
__m128i xout0 = _mm_load_si128(memory1);
|
||||||
|
__m128i xout1 = _mm_load_si128(memory1 + 1);
|
||||||
|
__m128i xout2 = _mm_load_si128(memory2);
|
||||||
|
__m128i xout3 = _mm_load_si128(memory2 + 1);
|
||||||
|
*k0 = _mm256_set_m128i(xout2, xout0);
|
||||||
|
*k1 = _mm256_set_m128i(xout3, xout1);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x01>(&xout0, &xout1);
|
||||||
|
aes_genkey_sub<0x01>(&xout2, &xout3);
|
||||||
|
*k2 = _mm256_set_m128i(xout2, xout0);
|
||||||
|
*k3 = _mm256_set_m128i(xout3, xout1);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x02>(&xout0, &xout1);
|
||||||
|
aes_genkey_sub<0x02>(&xout2, &xout3);
|
||||||
|
*k4 = _mm256_set_m128i(xout2, xout0);
|
||||||
|
*k5 = _mm256_set_m128i(xout3, xout1);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x04>(&xout0, &xout1);
|
||||||
|
aes_genkey_sub<0x04>(&xout2, &xout3);
|
||||||
|
*k6 = _mm256_set_m128i(xout2, xout0);
|
||||||
|
*k7 = _mm256_set_m128i(xout3, xout1);
|
||||||
|
|
||||||
|
aes_genkey_sub<0x08>(&xout0, &xout1);
|
||||||
|
aes_genkey_sub<0x08>(&xout2, &xout3);
|
||||||
|
*k8 = _mm256_set_m128i(xout2, xout0);
|
||||||
|
*k9 = _mm256_set_m128i(xout3, xout1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static FORCEINLINE void vaes_round(__m256i key, __m256i& x01, __m256i& x23, __m256i& x45, __m256i& x67)
|
||||||
|
{
|
||||||
|
x01 = _mm256_aesenc_epi128(x01, key);
|
||||||
|
x23 = _mm256_aesenc_epi128(x23, key);
|
||||||
|
x45 = _mm256_aesenc_epi128(x45, key);
|
||||||
|
x67 = _mm256_aesenc_epi128(x67, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static FORCEINLINE void vaes_round(__m256i key, __m256i& x0, __m256i& x1, __m256i& x2, __m256i& x3, __m256i& x4, __m256i& x5, __m256i& x6, __m256i& x7)
|
||||||
|
{
|
||||||
|
x0 = _mm256_aesenc_epi128(x0, key);
|
||||||
|
x1 = _mm256_aesenc_epi128(x1, key);
|
||||||
|
x2 = _mm256_aesenc_epi128(x2, key);
|
||||||
|
x3 = _mm256_aesenc_epi128(x3, key);
|
||||||
|
x4 = _mm256_aesenc_epi128(x4, key);
|
||||||
|
x5 = _mm256_aesenc_epi128(x5, key);
|
||||||
|
x6 = _mm256_aesenc_epi128(x6, key);
|
||||||
|
x7 = _mm256_aesenc_epi128(x7, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
NOINLINE void cn_explode_scratchpad_vaes(cryptonight_ctx* ctx, size_t memory, bool half_mem)
|
||||||
|
{
|
||||||
|
const size_t N = (memory / sizeof(__m256i)) / (half_mem ? 2 : 1);
|
||||||
|
|
||||||
|
__m256i xin01, xin23, xin45, xin67;
|
||||||
|
__m256i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m128i* input = reinterpret_cast<const __m128i*>(ctx->state);
|
||||||
|
__m256i* output = reinterpret_cast<__m256i*>(ctx->memory);
|
||||||
|
|
||||||
|
vaes_genkey(input, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
|
if (half_mem && !ctx->first_half) {
|
||||||
|
const __m256i* p = reinterpret_cast<const __m256i*>(ctx->save_state);
|
||||||
|
xin01 = _mm256_loadu_si256(p + 0);
|
||||||
|
xin23 = _mm256_loadu_si256(p + 1);
|
||||||
|
xin45 = _mm256_loadu_si256(p + 2);
|
||||||
|
xin67 = _mm256_loadu_si256(p + 3);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
xin01 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(input + 4));
|
||||||
|
xin23 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(input + 6));
|
||||||
|
xin45 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(input + 8));
|
||||||
|
xin67 = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(input + 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr int output_increment = 64 / sizeof(__m256i);
|
||||||
|
constexpr int prefetch_dist = 2048 / sizeof(__m256i);
|
||||||
|
|
||||||
|
__m256i* e = output + N - prefetch_dist;
|
||||||
|
__m256i* prefetch_ptr = output + prefetch_dist;
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; ++i) {
|
||||||
|
do {
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr + output_increment), _MM_HINT_T0);
|
||||||
|
|
||||||
|
vaes_round(k0, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k1, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k2, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k3, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k4, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k5, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k6, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k7, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k8, xin01, xin23, xin45, xin67);
|
||||||
|
vaes_round(k9, xin01, xin23, xin45, xin67);
|
||||||
|
|
||||||
|
_mm256_store_si256(output + 0, xin01);
|
||||||
|
_mm256_store_si256(output + 1, xin23);
|
||||||
|
|
||||||
|
_mm256_store_si256(output + output_increment + 0, xin45);
|
||||||
|
_mm256_store_si256(output + output_increment + 1, xin67);
|
||||||
|
|
||||||
|
output += output_increment * 2;
|
||||||
|
prefetch_ptr += output_increment * 2;
|
||||||
|
} while (output < e);
|
||||||
|
e += prefetch_dist;
|
||||||
|
prefetch_ptr = output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (half_mem && ctx->first_half) {
|
||||||
|
__m256i* p = reinterpret_cast<__m256i*>(ctx->save_state);
|
||||||
|
_mm256_storeu_si256(p + 0, xin01);
|
||||||
|
_mm256_storeu_si256(p + 1, xin23);
|
||||||
|
_mm256_storeu_si256(p + 2, xin45);
|
||||||
|
_mm256_storeu_si256(p + 3, xin67);
|
||||||
|
}
|
||||||
|
|
||||||
|
_mm256_zeroupper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NOINLINE void cn_explode_scratchpad_vaes_double(cryptonight_ctx* ctx1, cryptonight_ctx* ctx2, size_t memory, bool half_mem)
|
||||||
|
{
|
||||||
|
const size_t N = (memory / sizeof(__m128i)) / (half_mem ? 2 : 1);
|
||||||
|
|
||||||
|
__m256i xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7;
|
||||||
|
__m256i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m128i* input1 = reinterpret_cast<const __m128i*>(ctx1->state);
|
||||||
|
const __m128i* input2 = reinterpret_cast<const __m128i*>(ctx2->state);
|
||||||
|
|
||||||
|
__m128i* output1 = reinterpret_cast<__m128i*>(ctx1->memory);
|
||||||
|
__m128i* output2 = reinterpret_cast<__m128i*>(ctx2->memory);
|
||||||
|
|
||||||
|
vaes_genkey_double(input1, input2, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
|
{
|
||||||
|
const bool b = half_mem && !ctx1->first_half && !ctx2->first_half;
|
||||||
|
const __m128i* p1 = b ? reinterpret_cast<const __m128i*>(ctx1->save_state) : (input1 + 4);
|
||||||
|
const __m128i* p2 = b ? reinterpret_cast<const __m128i*>(ctx2->save_state) : (input2 + 4);
|
||||||
|
xin0 = _mm256_loadu2_m128i(p2 + 0, p1 + 0);
|
||||||
|
xin1 = _mm256_loadu2_m128i(p2 + 1, p1 + 1);
|
||||||
|
xin2 = _mm256_loadu2_m128i(p2 + 2, p1 + 2);
|
||||||
|
xin3 = _mm256_loadu2_m128i(p2 + 3, p1 + 3);
|
||||||
|
xin4 = _mm256_loadu2_m128i(p2 + 4, p1 + 4);
|
||||||
|
xin5 = _mm256_loadu2_m128i(p2 + 5, p1 + 5);
|
||||||
|
xin6 = _mm256_loadu2_m128i(p2 + 6, p1 + 6);
|
||||||
|
xin7 = _mm256_loadu2_m128i(p2 + 7, p1 + 7);
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr int output_increment = 64 / sizeof(__m128i);
|
||||||
|
constexpr int prefetch_dist = 2048 / sizeof(__m128i);
|
||||||
|
|
||||||
|
__m128i* e = output1 + N - prefetch_dist;
|
||||||
|
__m128i* prefetch_ptr1 = output1 + prefetch_dist;
|
||||||
|
__m128i* prefetch_ptr2 = output2 + prefetch_dist;
|
||||||
|
|
||||||
|
for (int i = 0; i < 2; ++i) {
|
||||||
|
do {
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr1), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr1 + output_increment), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr2), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(prefetch_ptr2 + output_increment), _MM_HINT_T0);
|
||||||
|
|
||||||
|
vaes_round(k0, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k1, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k2, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k3, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k4, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k5, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k6, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k7, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k8, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
vaes_round(k9, xin0, xin1, xin2, xin3, xin4, xin5, xin6, xin7);
|
||||||
|
|
||||||
|
_mm256_storeu2_m128i(output2 + 0, output1 + 0, xin0);
|
||||||
|
_mm256_storeu2_m128i(output2 + 1, output1 + 1, xin1);
|
||||||
|
_mm256_storeu2_m128i(output2 + 2, output1 + 2, xin2);
|
||||||
|
_mm256_storeu2_m128i(output2 + 3, output1 + 3, xin3);
|
||||||
|
|
||||||
|
_mm256_storeu2_m128i(output2 + output_increment + 0, output1 + output_increment + 0, xin4);
|
||||||
|
_mm256_storeu2_m128i(output2 + output_increment + 1, output1 + output_increment + 1, xin5);
|
||||||
|
_mm256_storeu2_m128i(output2 + output_increment + 2, output1 + output_increment + 2, xin6);
|
||||||
|
_mm256_storeu2_m128i(output2 + output_increment + 3, output1 + output_increment + 3, xin7);
|
||||||
|
|
||||||
|
output1 += output_increment * 2;
|
||||||
|
prefetch_ptr1 += output_increment * 2;
|
||||||
|
output2 += output_increment * 2;
|
||||||
|
prefetch_ptr2 += output_increment * 2;
|
||||||
|
} while (output1 < e);
|
||||||
|
e += prefetch_dist;
|
||||||
|
prefetch_ptr1 = output1;
|
||||||
|
prefetch_ptr2 = output2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (half_mem && ctx1->first_half && ctx2->first_half) {
|
||||||
|
__m128i* p1 = reinterpret_cast<__m128i*>(ctx1->save_state);
|
||||||
|
__m128i* p2 = reinterpret_cast<__m128i*>(ctx2->save_state);
|
||||||
|
_mm256_storeu2_m128i(p2 + 0, p1 + 0, xin0);
|
||||||
|
_mm256_storeu2_m128i(p2 + 1, p1 + 1, xin1);
|
||||||
|
_mm256_storeu2_m128i(p2 + 2, p1 + 2, xin2);
|
||||||
|
_mm256_storeu2_m128i(p2 + 3, p1 + 3, xin3);
|
||||||
|
_mm256_storeu2_m128i(p2 + 4, p1 + 4, xin4);
|
||||||
|
_mm256_storeu2_m128i(p2 + 5, p1 + 5, xin5);
|
||||||
|
_mm256_storeu2_m128i(p2 + 6, p1 + 6, xin6);
|
||||||
|
_mm256_storeu2_m128i(p2 + 7, p1 + 7, xin7);
|
||||||
|
}
|
||||||
|
|
||||||
|
_mm256_zeroupper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NOINLINE void cn_implode_scratchpad_vaes(cryptonight_ctx* ctx, size_t memory, bool half_mem)
|
||||||
|
{
|
||||||
|
const size_t N = (memory / sizeof(__m256i)) / (half_mem ? 2 : 1);
|
||||||
|
|
||||||
|
__m256i xout01, xout23, xout45, xout67;
|
||||||
|
__m256i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m256i* input = reinterpret_cast<const __m256i*>(ctx->memory);
|
||||||
|
__m256i* output = reinterpret_cast<__m256i*>(ctx->state);
|
||||||
|
|
||||||
|
vaes_genkey(reinterpret_cast<__m128i*>(output) + 2, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
|
xout01 = _mm256_loadu_si256(output + 2);
|
||||||
|
xout23 = _mm256_loadu_si256(output + 3);
|
||||||
|
xout45 = _mm256_loadu_si256(output + 4);
|
||||||
|
xout67 = _mm256_loadu_si256(output + 5);
|
||||||
|
|
||||||
|
const __m256i* input_begin = input;
|
||||||
|
for (size_t part = 0; part < (half_mem ? 2 : 1); ++part) {
|
||||||
|
if (half_mem && (part == 1)) {
|
||||||
|
input = input_begin;
|
||||||
|
ctx->first_half = false;
|
||||||
|
cn_explode_scratchpad_vaes(ctx, memory, half_mem);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N;) {
|
||||||
|
xout01 = _mm256_xor_si256(xout01, input[0]);
|
||||||
|
xout23 = _mm256_xor_si256(xout23, input[1]);
|
||||||
|
|
||||||
|
constexpr int input_increment = 64 / sizeof(__m256i);
|
||||||
|
|
||||||
|
xout45 = _mm256_xor_si256(xout45, input[input_increment]);
|
||||||
|
xout67 = _mm256_xor_si256(xout67, input[input_increment + 1]);
|
||||||
|
|
||||||
|
input += input_increment * 2;
|
||||||
|
i += 4;
|
||||||
|
|
||||||
|
if (i < N) {
|
||||||
|
_mm_prefetch((const char*)(input), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(input + input_increment), _MM_HINT_T0);
|
||||||
|
}
|
||||||
|
|
||||||
|
vaes_round(k0, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k1, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k2, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k3, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k4, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k5, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k6, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k7, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k8, xout01, xout23, xout45, xout67);
|
||||||
|
vaes_round(k9, xout01, xout23, xout45, xout67);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_mm256_storeu_si256(output + 2, xout01);
|
||||||
|
_mm256_storeu_si256(output + 3, xout23);
|
||||||
|
_mm256_storeu_si256(output + 4, xout45);
|
||||||
|
_mm256_storeu_si256(output + 5, xout67);
|
||||||
|
|
||||||
|
_mm256_zeroupper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
NOINLINE void cn_implode_scratchpad_vaes_double(cryptonight_ctx* ctx1, cryptonight_ctx* ctx2, size_t memory, bool half_mem)
|
||||||
|
{
|
||||||
|
const size_t N = (memory / sizeof(__m128i)) / (half_mem ? 2 : 1);
|
||||||
|
|
||||||
|
__m256i xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7;
|
||||||
|
__m256i k0, k1, k2, k3, k4, k5, k6, k7, k8, k9;
|
||||||
|
|
||||||
|
const __m128i* input1 = reinterpret_cast<const __m128i*>(ctx1->memory);
|
||||||
|
const __m128i* input2 = reinterpret_cast<const __m128i*>(ctx2->memory);
|
||||||
|
|
||||||
|
__m128i* output1 = reinterpret_cast<__m128i*>(ctx1->state);
|
||||||
|
__m128i* output2 = reinterpret_cast<__m128i*>(ctx2->state);
|
||||||
|
|
||||||
|
vaes_genkey_double(output1 + 2, output2 + 2, &k0, &k1, &k2, &k3, &k4, &k5, &k6, &k7, &k8, &k9);
|
||||||
|
|
||||||
|
xout0 = _mm256_loadu2_m128i(output2 + 4, output1 + 4);
|
||||||
|
xout1 = _mm256_loadu2_m128i(output2 + 5, output1 + 5);
|
||||||
|
xout2 = _mm256_loadu2_m128i(output2 + 6, output1 + 6);
|
||||||
|
xout3 = _mm256_loadu2_m128i(output2 + 7, output1 + 7);
|
||||||
|
xout4 = _mm256_loadu2_m128i(output2 + 8, output1 + 8);
|
||||||
|
xout5 = _mm256_loadu2_m128i(output2 + 9, output1 + 9);
|
||||||
|
xout6 = _mm256_loadu2_m128i(output2 + 10, output1 + 10);
|
||||||
|
xout7 = _mm256_loadu2_m128i(output2 + 11, output1 + 11);
|
||||||
|
|
||||||
|
const __m128i* input_begin1 = input1;
|
||||||
|
const __m128i* input_begin2 = input2;
|
||||||
|
for (size_t part = 0; part < (half_mem ? 2 : 1); ++part) {
|
||||||
|
if (half_mem && (part == 1)) {
|
||||||
|
input1 = input_begin1;
|
||||||
|
input2 = input_begin2;
|
||||||
|
ctx1->first_half = false;
|
||||||
|
ctx2->first_half = false;
|
||||||
|
cn_explode_scratchpad_vaes_double(ctx1, ctx2, memory, half_mem);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (size_t i = 0; i < N;) {
|
||||||
|
xout0 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + 0, input1 + 0), xout0);
|
||||||
|
xout1 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + 1, input1 + 1), xout1);
|
||||||
|
xout2 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + 2, input1 + 2), xout2);
|
||||||
|
xout3 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + 3, input1 + 3), xout3);
|
||||||
|
|
||||||
|
constexpr int input_increment = 64 / sizeof(__m128i);
|
||||||
|
|
||||||
|
xout4 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + input_increment + 0, input1 + input_increment + 0), xout4);
|
||||||
|
xout5 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + input_increment + 1, input1 + input_increment + 1), xout5);
|
||||||
|
xout6 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + input_increment + 2, input1 + input_increment + 2), xout6);
|
||||||
|
xout7 = _mm256_xor_si256(_mm256_loadu2_m128i(input2 + input_increment + 3, input1 + input_increment + 3), xout7);
|
||||||
|
|
||||||
|
input1 += input_increment * 2;
|
||||||
|
input2 += input_increment * 2;
|
||||||
|
i += 8;
|
||||||
|
|
||||||
|
if (i < N) {
|
||||||
|
_mm_prefetch((const char*)(input1), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(input1 + input_increment), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(input2), _MM_HINT_T0);
|
||||||
|
_mm_prefetch((const char*)(input2 + input_increment), _MM_HINT_T0);
|
||||||
|
}
|
||||||
|
|
||||||
|
vaes_round(k0, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k1, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k2, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k3, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k4, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k5, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k6, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k7, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k8, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
vaes_round(k9, xout0, xout1, xout2, xout3, xout4, xout5, xout6, xout7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_mm256_storeu2_m128i(output2 + 4, output1 + 4, xout0);
|
||||||
|
_mm256_storeu2_m128i(output2 + 5, output1 + 5, xout1);
|
||||||
|
_mm256_storeu2_m128i(output2 + 6, output1 + 6, xout2);
|
||||||
|
_mm256_storeu2_m128i(output2 + 7, output1 + 7, xout3);
|
||||||
|
_mm256_storeu2_m128i(output2 + 8, output1 + 8, xout4);
|
||||||
|
_mm256_storeu2_m128i(output2 + 9, output1 + 9, xout5);
|
||||||
|
_mm256_storeu2_m128i(output2 + 10, output1 + 10, xout6);
|
||||||
|
_mm256_storeu2_m128i(output2 + 11, output1 + 11, xout7);
|
||||||
|
|
||||||
|
_mm256_zeroupper();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // xmrig
|
||||||
48
src/crypto/cn/CryptoNight_x86_vaes.h
Normal file
48
src/crypto/cn/CryptoNight_x86_vaes.h
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/* XMRig
|
||||||
|
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
|
||||||
|
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
|
||||||
|
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||||
|
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||||
|
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||||
|
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||||
|
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||||
|
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||||
|
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef XMRIG_CRYPTONIGHT_X86_VAES_H
|
||||||
|
#define XMRIG_CRYPTONIGHT_X86_VAES_H
|
||||||
|
|
||||||
|
|
||||||
|
#include "crypto/cn/CnAlgo.h"
|
||||||
|
|
||||||
|
|
||||||
|
struct cryptonight_ctx;
|
||||||
|
|
||||||
|
|
||||||
|
namespace xmrig {
|
||||||
|
|
||||||
|
|
||||||
|
void cn_explode_scratchpad_vaes(cryptonight_ctx* ctx, size_t memory, bool half_mem);
|
||||||
|
void cn_explode_scratchpad_vaes_double(cryptonight_ctx* ctx1, cryptonight_ctx* ctx2, size_t memory, bool half_mem);
|
||||||
|
void cn_implode_scratchpad_vaes(cryptonight_ctx* ctx, size_t memory, bool half_mem);
|
||||||
|
void cn_implode_scratchpad_vaes_double(cryptonight_ctx* ctx1, cryptonight_ctx* ctx2, size_t memory, bool half_mem);
|
||||||
|
|
||||||
|
|
||||||
|
} // xmrig
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* XMRIG_CRYPTONIGHT_X86_VAES_H */
|
||||||
132
src/crypto/cn/asm/cn1/cnv1_double_main_loop.inc
Normal file
132
src/crypto/cn/asm/cn1/cnv1_double_main_loop.inc
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
mov QWORD PTR [rsp+8], rbx
|
||||||
|
mov QWORD PTR [rsp+16], rbp
|
||||||
|
mov QWORD PTR [rsp+24], rsi
|
||||||
|
push rdi
|
||||||
|
push r12
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
sub rsp, 32
|
||||||
|
mov rdx, QWORD PTR [rcx]
|
||||||
|
mov r8, QWORD PTR [rcx+8]
|
||||||
|
mov r12d, 524288
|
||||||
|
movaps XMMWORD PTR [rsp+16], xmm6
|
||||||
|
mov rbx, QWORD PTR [rdx+32]
|
||||||
|
xor rbx, QWORD PTR [rdx]
|
||||||
|
mov rsi, QWORD PTR [rdx+40]
|
||||||
|
mov r10, rbx
|
||||||
|
xor rsi, QWORD PTR [rdx+8]
|
||||||
|
and r10d, 2097136
|
||||||
|
mov rdi, QWORD PTR [r8+32]
|
||||||
|
xor rdi, QWORD PTR [r8]
|
||||||
|
movq xmm3, rbx
|
||||||
|
mov rbp, QWORD PTR [r8+40]
|
||||||
|
mov r9, rdi
|
||||||
|
xor rbp, QWORD PTR [r8+8]
|
||||||
|
movq xmm0, rsi
|
||||||
|
mov rcx, QWORD PTR [rdx+56]
|
||||||
|
and r9d, 2097136
|
||||||
|
xor rcx, QWORD PTR [rdx+24]
|
||||||
|
movq xmm4, rdi
|
||||||
|
mov rax, QWORD PTR [rdx+48]
|
||||||
|
xor rax, QWORD PTR [rdx+16]
|
||||||
|
mov r14, QWORD PTR [rdx+224]
|
||||||
|
mov r13, QWORD PTR [rdx+232]
|
||||||
|
mov r15, QWORD PTR [r8+224]
|
||||||
|
punpcklqdq xmm3, xmm0
|
||||||
|
movq xmm0, rbp
|
||||||
|
movq xmm5, rax
|
||||||
|
punpcklqdq xmm4, xmm0
|
||||||
|
mov rax, QWORD PTR [r8+48]
|
||||||
|
movq xmm0, rcx
|
||||||
|
xor rax, QWORD PTR [r8+16]
|
||||||
|
mov rcx, QWORD PTR [r8+56]
|
||||||
|
xor rcx, QWORD PTR [r8+24]
|
||||||
|
movdqu xmm1, XMMWORD PTR [r14+r10]
|
||||||
|
movq xmm6, rax
|
||||||
|
punpcklqdq xmm5, xmm0
|
||||||
|
mov rax, QWORD PTR [rdx+240]
|
||||||
|
movq xmm0, rcx
|
||||||
|
movdqu xmm2, XMMWORD PTR [r15+r9]
|
||||||
|
mov QWORD PTR [rsp], rax
|
||||||
|
mov rax, QWORD PTR [r8+240]
|
||||||
|
mov QWORD PTR [rsp+8], rax
|
||||||
|
punpcklqdq xmm6, xmm0
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_double:
|
||||||
|
aesenc xmm1, xmm3
|
||||||
|
aesenc xmm2, xmm4
|
||||||
|
movdqa xmm0, xmm1
|
||||||
|
movq r11, xmm2
|
||||||
|
pxor xmm0, xmm5
|
||||||
|
movdqa xmm5, xmm1
|
||||||
|
movq QWORD PTR [r14+r10], xmm0
|
||||||
|
pextrq rcx, xmm0, 1
|
||||||
|
mov eax, ecx
|
||||||
|
movdqa xmm0, xmm2
|
||||||
|
shr rax, 24
|
||||||
|
pxor xmm0, xmm6
|
||||||
|
movdqa xmm6, xmm2
|
||||||
|
mov eax, DWORD PTR [r13+rax*4]
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [r14+r10+8], rax
|
||||||
|
movq QWORD PTR [r15+r9], xmm0
|
||||||
|
pextrq rcx, xmm0, 1
|
||||||
|
mov eax, ecx
|
||||||
|
shr rax, 24
|
||||||
|
mov eax, DWORD PTR [r13+rax*4]
|
||||||
|
xor rax, rcx
|
||||||
|
movq rcx, xmm1
|
||||||
|
mov QWORD PTR [r15+r9+8], rax
|
||||||
|
mov r9, rcx
|
||||||
|
and r9d, 2097136
|
||||||
|
mov r10, QWORD PTR [r14+r9]
|
||||||
|
mov r8, QWORD PTR [r14+r9+8]
|
||||||
|
mov rax, r10
|
||||||
|
mul rcx
|
||||||
|
add rsi, rax
|
||||||
|
add rbx, rdx
|
||||||
|
mov rax, QWORD PTR [rsp]
|
||||||
|
mov QWORD PTR [r14+r9], rbx
|
||||||
|
xor rax, rsi
|
||||||
|
mov QWORD PTR [r14+r9+8], rax
|
||||||
|
xor rsi, r8
|
||||||
|
xor rbx, r10
|
||||||
|
mov r8, r11
|
||||||
|
and r8d, 2097136
|
||||||
|
mov r10, rbx
|
||||||
|
and r10d, 2097136
|
||||||
|
movq xmm3, rbx
|
||||||
|
pinsrq xmm3, rsi, 1
|
||||||
|
mov r9, QWORD PTR [r15+r8]
|
||||||
|
mov rcx, QWORD PTR [r15+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
movdqu xmm1, XMMWORD PTR [r14+r10]
|
||||||
|
mul r11
|
||||||
|
add rbp, rax
|
||||||
|
add rdi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+8]
|
||||||
|
mov QWORD PTR [r15+r8], rdi
|
||||||
|
xor rax, rbp
|
||||||
|
xor rdi, r9
|
||||||
|
mov QWORD PTR [r15+r8+8], rax
|
||||||
|
mov r9, rdi
|
||||||
|
xor rbp, rcx
|
||||||
|
and r9d, 2097136
|
||||||
|
movq xmm4, rdi
|
||||||
|
pinsrq xmm4, rbp, 1
|
||||||
|
movdqu xmm2, XMMWORD PTR [r15+r9]
|
||||||
|
sub r12, 1
|
||||||
|
jne main_loop_cnv1_double
|
||||||
|
|
||||||
|
mov rbx, QWORD PTR [rsp+80]
|
||||||
|
mov rbp, QWORD PTR [rsp+88]
|
||||||
|
mov rsi, QWORD PTR [rsp+96]
|
||||||
|
movaps xmm6, XMMWORD PTR [rsp+16]
|
||||||
|
add rsp, 32
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
pop r12
|
||||||
|
pop rdi
|
||||||
263
src/crypto/cn/asm/cn1/cnv1_quad_main_loop.inc
Normal file
263
src/crypto/cn/asm/cn1/cnv1_quad_main_loop.inc
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
mov rax, rsp
|
||||||
|
mov QWORD PTR [rax+8], rbx
|
||||||
|
mov QWORD PTR [rax+16], rbp
|
||||||
|
mov QWORD PTR [rax+24], rsi
|
||||||
|
push rdi
|
||||||
|
push r12
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
sub rsp, 144
|
||||||
|
mov r8, QWORD PTR [rcx]
|
||||||
|
mov r9, QWORD PTR [rcx+8]
|
||||||
|
mov r10, QWORD PTR [rcx+16]
|
||||||
|
mov r11, QWORD PTR [rcx+24]
|
||||||
|
mov rbp, QWORD PTR [r8+224]
|
||||||
|
mov r13, QWORD PTR [r8+232]
|
||||||
|
mov r14, QWORD PTR [r9+224]
|
||||||
|
mov r15, QWORD PTR [r10+224]
|
||||||
|
mov r12, QWORD PTR [r11+224]
|
||||||
|
mov rcx, QWORD PTR [r8+40]
|
||||||
|
xor rcx, QWORD PTR [r8+8]
|
||||||
|
mov rbx, QWORD PTR [r8+32]
|
||||||
|
xor rbx, QWORD PTR [r8]
|
||||||
|
mov rdi, QWORD PTR [r9+32]
|
||||||
|
xor rdi, QWORD PTR [r9]
|
||||||
|
movq xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r9+40]
|
||||||
|
xor rcx, QWORD PTR [r9+8]
|
||||||
|
movq xmm1, rbx
|
||||||
|
movaps XMMWORD PTR [rax-56], xmm6
|
||||||
|
movaps XMMWORD PTR [rax-72], xmm7
|
||||||
|
movaps XMMWORD PTR [rax-88], xmm8
|
||||||
|
movaps XMMWORD PTR [rax-104], xmm9
|
||||||
|
movaps XMMWORD PTR [rax-120], xmm10
|
||||||
|
movaps XMMWORD PTR [rsp+48], xmm11
|
||||||
|
movaps XMMWORD PTR [rsp+32], xmm12
|
||||||
|
and ebx, 2097136
|
||||||
|
mov rsi, QWORD PTR [r10+32]
|
||||||
|
movq xmm2, rdi
|
||||||
|
mov rax, QWORD PTR [r8+240]
|
||||||
|
and edi, 2097136
|
||||||
|
xor rsi, QWORD PTR [r10]
|
||||||
|
mov rdx, QWORD PTR [r8+56]
|
||||||
|
xor rdx, QWORD PTR [r8+24]
|
||||||
|
mov QWORD PTR [rsp], rax
|
||||||
|
mov rax, QWORD PTR [r9+240]
|
||||||
|
movq xmm3, rsi
|
||||||
|
mov QWORD PTR [rsp+8], rax
|
||||||
|
and esi, 2097136
|
||||||
|
mov rax, QWORD PTR [r10+240]
|
||||||
|
punpcklqdq xmm1, xmm0
|
||||||
|
movq xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r10+40]
|
||||||
|
xor rcx, QWORD PTR [r10+8]
|
||||||
|
mov QWORD PTR [rsp+16], rax
|
||||||
|
mov rax, QWORD PTR [r11+240]
|
||||||
|
punpcklqdq xmm2, xmm0
|
||||||
|
movq xmm0, rcx
|
||||||
|
mov QWORD PTR [rsp+24], rax
|
||||||
|
mov rcx, QWORD PTR [r11+40]
|
||||||
|
xor rcx, QWORD PTR [r11+8]
|
||||||
|
mov rax, QWORD PTR [r11+32]
|
||||||
|
xor rax, QWORD PTR [r11]
|
||||||
|
punpcklqdq xmm3, xmm0
|
||||||
|
movq xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r8+48]
|
||||||
|
xor rcx, QWORD PTR [r8+16]
|
||||||
|
movq xmm4, rax
|
||||||
|
and eax, 2097136
|
||||||
|
punpcklqdq xmm4, xmm0
|
||||||
|
movq xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r9+56]
|
||||||
|
xor rdx, QWORD PTR [r9+24]
|
||||||
|
movq xmm5, rcx
|
||||||
|
mov rcx, QWORD PTR [r9+48]
|
||||||
|
xor rcx, QWORD PTR [r9+16]
|
||||||
|
punpcklqdq xmm5, xmm0
|
||||||
|
movq xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r10+56]
|
||||||
|
xor rdx, QWORD PTR [r10+24]
|
||||||
|
movq xmm6, rcx
|
||||||
|
mov rcx, QWORD PTR [r10+48]
|
||||||
|
xor rcx, QWORD PTR [r10+16]
|
||||||
|
punpcklqdq xmm6, xmm0
|
||||||
|
movq xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r11+56]
|
||||||
|
movq xmm7, rcx
|
||||||
|
punpcklqdq xmm7, xmm0
|
||||||
|
xor rdx, QWORD PTR [r11+24]
|
||||||
|
mov rcx, QWORD PTR [r11+48]
|
||||||
|
xor rcx, QWORD PTR [r11+16]
|
||||||
|
mov r11d, 524288
|
||||||
|
movdqu xmm9, XMMWORD PTR [rbp+rbx]
|
||||||
|
movdqu xmm10, XMMWORD PTR [r14+rdi]
|
||||||
|
movq xmm0, rdx
|
||||||
|
movdqu xmm11, XMMWORD PTR [r15+rsi]
|
||||||
|
movdqu xmm12, XMMWORD PTR [r12+rax]
|
||||||
|
movq xmm8, rcx
|
||||||
|
punpcklqdq xmm8, xmm0
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_quad:
|
||||||
|
aesenc xmm9, xmm1
|
||||||
|
aesenc xmm10, xmm2
|
||||||
|
aesenc xmm11, xmm3
|
||||||
|
aesenc xmm12, xmm4
|
||||||
|
movd ecx, xmm9
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+rbp]
|
||||||
|
movd ecx, xmm10
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r14]
|
||||||
|
movd ecx, xmm11
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r15]
|
||||||
|
movd ecx, xmm12
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r12]
|
||||||
|
movdqa xmm0, xmm9
|
||||||
|
pxor xmm0, xmm5
|
||||||
|
movdqa xmm5, xmm9
|
||||||
|
movq QWORD PTR [rbp+rbx], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm10
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm6
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [rbp+rbx+8], rcx
|
||||||
|
movq rbx, xmm1
|
||||||
|
movq QWORD PTR [r14+rdi], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm11
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm7
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r14+rdi+8], rcx
|
||||||
|
movq rdi, xmm2
|
||||||
|
movq QWORD PTR [r15+rsi], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm12
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm8
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r15+rsi+8], rcx
|
||||||
|
movq QWORD PTR [r12+rax], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
shr rcx, 24
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r12+rax+8], rcx
|
||||||
|
movq rcx, xmm9
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
mov r9, QWORD PTR [rbp+r8]
|
||||||
|
mov r10, QWORD PTR [rbp+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm1, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rbx, rdx
|
||||||
|
mov rax, QWORD PTR [rsp]
|
||||||
|
mov QWORD PTR [rbp+r8], rbx
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [rbp+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
xor rbx, r9
|
||||||
|
movq xmm1, rbx
|
||||||
|
and ebx, 2097136
|
||||||
|
pinsrq xmm1, rcx, 1
|
||||||
|
movq rcx, xmm10
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm9, XMMWORD PTR [rbp+rbx]
|
||||||
|
mov r9, QWORD PTR [r14+r8]
|
||||||
|
mov r10, QWORD PTR [r14+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm2, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rdi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+8]
|
||||||
|
mov QWORD PTR [r14+r8], rdi
|
||||||
|
xor rax, rcx
|
||||||
|
xor rdi, r9
|
||||||
|
mov QWORD PTR [r14+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
movq xmm2, rdi
|
||||||
|
and edi, 2097136
|
||||||
|
pinsrq xmm2, rcx, 1
|
||||||
|
movq rcx, xmm11
|
||||||
|
movq rsi, xmm3
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqa xmm6, xmm10
|
||||||
|
movdqa xmm7, xmm11
|
||||||
|
movdqa xmm8, xmm12
|
||||||
|
movdqu xmm10, XMMWORD PTR [r14+rdi]
|
||||||
|
mov r9, QWORD PTR [r15+r8]
|
||||||
|
mov r10, QWORD PTR [r15+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm3, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rsi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+16]
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [r15+r8], rsi
|
||||||
|
mov QWORD PTR [r15+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
xor rsi, r9
|
||||||
|
movq xmm3, rsi
|
||||||
|
and esi, 2097136
|
||||||
|
pinsrq xmm3, rcx, 1
|
||||||
|
movq rcx, xmm12
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm11, XMMWORD PTR [r15+rsi]
|
||||||
|
mov r9, QWORD PTR [r12+r8]
|
||||||
|
mov r10, QWORD PTR [r12+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
mov rcx, rax
|
||||||
|
movq rax, xmm4
|
||||||
|
add rax, rdx
|
||||||
|
mov QWORD PTR [r12+r8], rax
|
||||||
|
xor rax, r9
|
||||||
|
pextrq rdx, xmm4, 1
|
||||||
|
add rdx, rcx
|
||||||
|
mov rcx, QWORD PTR [rsp+24]
|
||||||
|
xor rcx, rdx
|
||||||
|
xor rdx, r10
|
||||||
|
movq xmm4, rax
|
||||||
|
mov QWORD PTR [r12+r8+8], rcx
|
||||||
|
and eax, 2097136
|
||||||
|
pinsrq xmm4, rdx, 1
|
||||||
|
movdqu xmm12, XMMWORD PTR [r12+rax]
|
||||||
|
sub r11, 1
|
||||||
|
jne main_loop_cnv1_quad
|
||||||
|
|
||||||
|
movaps xmm7, XMMWORD PTR [rsp+112]
|
||||||
|
lea r11, QWORD PTR [rsp+144]
|
||||||
|
mov rbx, QWORD PTR [r11+48]
|
||||||
|
mov rbp, QWORD PTR [r11+56]
|
||||||
|
mov rsi, QWORD PTR [r11+64]
|
||||||
|
movaps xmm6, XMMWORD PTR [r11-16]
|
||||||
|
movaps xmm8, XMMWORD PTR [r11-48]
|
||||||
|
movaps xmm9, XMMWORD PTR [r11-64]
|
||||||
|
movaps xmm10, XMMWORD PTR [r11-80]
|
||||||
|
movaps xmm11, XMMWORD PTR [r11-96]
|
||||||
|
movaps xmm12, XMMWORD PTR [r11-112]
|
||||||
|
mov rsp, r11
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
pop r12
|
||||||
|
pop rdi
|
||||||
66
src/crypto/cn/asm/cn1/cnv1_single_main_loop.inc
Normal file
66
src/crypto/cn/asm/cn1/cnv1_single_main_loop.inc
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
mov QWORD PTR [rsp+8], rbx
|
||||||
|
mov QWORD PTR [rsp+16], rbp
|
||||||
|
mov QWORD PTR [rsp+24], rsi
|
||||||
|
mov QWORD PTR [rsp+32], rdi
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
mov rdx, QWORD PTR [rcx]
|
||||||
|
mov esi, 524288
|
||||||
|
mov r11, QWORD PTR [rdx+32]
|
||||||
|
xor r11, QWORD PTR [rdx]
|
||||||
|
mov rdi, QWORD PTR [rdx+224]
|
||||||
|
mov rbx, QWORD PTR [rdx+40]
|
||||||
|
xor rbx, QWORD PTR [rdx+8]
|
||||||
|
mov rcx, QWORD PTR [rdx+56]
|
||||||
|
xor rcx, QWORD PTR [rdx+24]
|
||||||
|
mov rax, QWORD PTR [rdx+48]
|
||||||
|
xor rax, QWORD PTR [rdx+16]
|
||||||
|
mov rbp, QWORD PTR [rdx+240]
|
||||||
|
mov r14, QWORD PTR [rdx+232]
|
||||||
|
movq xmm2, rax
|
||||||
|
pinsrq xmm2, rcx, 1
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_single:
|
||||||
|
mov r8, r11
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm1, XMMWORD PTR [rdi+r8]
|
||||||
|
movq xmm0, r11
|
||||||
|
pinsrq xmm0, rbx, 1
|
||||||
|
aesenc xmm1, xmm0
|
||||||
|
movq r15, xmm1
|
||||||
|
mov r9, r15
|
||||||
|
and r9d, 2097136
|
||||||
|
movdqa xmm0, xmm1
|
||||||
|
pxor xmm0, xmm2
|
||||||
|
movdqa xmm2, xmm1
|
||||||
|
movq QWORD PTR [rdi+r8], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov eax, edx
|
||||||
|
shr rax, 24
|
||||||
|
mov ecx, DWORD PTR [r14+rax*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [rdi+r8+8], rcx
|
||||||
|
mov r10, QWORD PTR [rdi+r9]
|
||||||
|
mov r8, QWORD PTR [rdi+r9+8]
|
||||||
|
mov rax, r10
|
||||||
|
mul r15
|
||||||
|
add rbx, rax
|
||||||
|
add r11, rdx
|
||||||
|
mov QWORD PTR [rdi+r9], r11
|
||||||
|
mov rax, rbx
|
||||||
|
xor rbx, r8
|
||||||
|
xor r11, r10
|
||||||
|
xor rax, rbp
|
||||||
|
mov QWORD PTR [rdi+r9+8], rax
|
||||||
|
sub rsi, 1
|
||||||
|
jne main_loop_cnv1_single
|
||||||
|
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
mov rbx, QWORD PTR [rsp+8]
|
||||||
|
mov rbp, QWORD PTR [rsp+16]
|
||||||
|
mov rsi, QWORD PTR [rsp+24]
|
||||||
|
mov rdi, QWORD PTR [rsp+32]
|
||||||
@@ -11,6 +11,9 @@
|
|||||||
# define FN_PREFIX(fn) fn
|
# define FN_PREFIX(fn) fn
|
||||||
.section .text
|
.section .text
|
||||||
#endif
|
#endif
|
||||||
|
.global FN_PREFIX(cnv1_single_mainloop_asm)
|
||||||
|
.global FN_PREFIX(cnv1_double_mainloop_asm)
|
||||||
|
.global FN_PREFIX(cnv1_quad_mainloop_asm)
|
||||||
.global FN_PREFIX(cnv2_mainloop_ivybridge_asm)
|
.global FN_PREFIX(cnv2_mainloop_ivybridge_asm)
|
||||||
.global FN_PREFIX(cnv2_mainloop_ryzen_asm)
|
.global FN_PREFIX(cnv2_mainloop_ryzen_asm)
|
||||||
.global FN_PREFIX(cnv2_mainloop_bulldozer_asm)
|
.global FN_PREFIX(cnv2_mainloop_bulldozer_asm)
|
||||||
@@ -19,6 +22,33 @@
|
|||||||
.global FN_PREFIX(cnv2_rwz_double_mainloop_asm)
|
.global FN_PREFIX(cnv2_rwz_double_mainloop_asm)
|
||||||
.global FN_PREFIX(cnv2_upx_double_mainloop_zen3_asm)
|
.global FN_PREFIX(cnv2_upx_double_mainloop_zen3_asm)
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
FN_PREFIX(cnv1_single_mainloop_asm):
|
||||||
|
sub rsp, 48
|
||||||
|
mov rcx, rdi
|
||||||
|
#include "cn1/cnv1_single_main_loop.inc"
|
||||||
|
add rsp, 48
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
FN_PREFIX(cnv1_double_mainloop_asm):
|
||||||
|
sub rsp, 48
|
||||||
|
mov rcx, rdi
|
||||||
|
#include "cn1/cnv1_double_main_loop.inc"
|
||||||
|
add rsp, 48
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
FN_PREFIX(cnv1_quad_mainloop_asm):
|
||||||
|
sub rsp, 48
|
||||||
|
mov rcx, rdi
|
||||||
|
#include "cn1/cnv1_quad_main_loop.inc"
|
||||||
|
add rsp, 48
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
ALIGN(64)
|
ALIGN(64)
|
||||||
FN_PREFIX(cnv2_mainloop_ivybridge_asm):
|
FN_PREFIX(cnv2_mainloop_ivybridge_asm):
|
||||||
sub rsp, 48
|
sub rsp, 48
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
_TEXT_CNV2_MAINLOOP SEGMENT PAGE READ EXECUTE
|
_TEXT_CNV2_MAINLOOP SEGMENT PAGE READ EXECUTE
|
||||||
|
PUBLIC cnv1_single_mainloop_asm
|
||||||
|
PUBLIC cnv1_double_mainloop_asm
|
||||||
|
PUBLIC cnv1_quad_mainloop_asm
|
||||||
PUBLIC cnv2_mainloop_ivybridge_asm
|
PUBLIC cnv2_mainloop_ivybridge_asm
|
||||||
PUBLIC cnv2_mainloop_ryzen_asm
|
PUBLIC cnv2_mainloop_ryzen_asm
|
||||||
PUBLIC cnv2_mainloop_bulldozer_asm
|
PUBLIC cnv2_mainloop_bulldozer_asm
|
||||||
@@ -6,6 +9,27 @@ PUBLIC cnv2_double_mainloop_sandybridge_asm
|
|||||||
PUBLIC cnv2_rwz_mainloop_asm
|
PUBLIC cnv2_rwz_mainloop_asm
|
||||||
PUBLIC cnv2_rwz_double_mainloop_asm
|
PUBLIC cnv2_rwz_double_mainloop_asm
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_single_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_single_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_single_mainloop_asm ENDP
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_double_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_double_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_double_mainloop_asm ENDP
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_quad_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_quad_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_quad_mainloop_asm ENDP
|
||||||
|
|
||||||
ALIGN(64)
|
ALIGN(64)
|
||||||
cnv2_mainloop_ivybridge_asm PROC
|
cnv2_mainloop_ivybridge_asm PROC
|
||||||
INCLUDE cn2/cnv2_main_loop_ivybridge.inc
|
INCLUDE cn2/cnv2_main_loop_ivybridge.inc
|
||||||
|
|||||||
132
src/crypto/cn/asm/win64/cn1/cnv1_double_main_loop.inc
Normal file
132
src/crypto/cn/asm/win64/cn1/cnv1_double_main_loop.inc
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
mov QWORD PTR [rsp+8], rbx
|
||||||
|
mov QWORD PTR [rsp+16], rbp
|
||||||
|
mov QWORD PTR [rsp+24], rsi
|
||||||
|
push rdi
|
||||||
|
push r12
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
sub rsp, 32
|
||||||
|
mov rdx, QWORD PTR [rcx]
|
||||||
|
mov r8, QWORD PTR [rcx+8]
|
||||||
|
mov r12d, 524288
|
||||||
|
movaps XMMWORD PTR [rsp+16], xmm6
|
||||||
|
mov rbx, QWORD PTR [rdx+32]
|
||||||
|
xor rbx, QWORD PTR [rdx]
|
||||||
|
mov rsi, QWORD PTR [rdx+40]
|
||||||
|
mov r10, rbx
|
||||||
|
xor rsi, QWORD PTR [rdx+8]
|
||||||
|
and r10d, 2097136
|
||||||
|
mov rdi, QWORD PTR [r8+32]
|
||||||
|
xor rdi, QWORD PTR [r8]
|
||||||
|
movd xmm3, rbx
|
||||||
|
mov rbp, QWORD PTR [r8+40]
|
||||||
|
mov r9, rdi
|
||||||
|
xor rbp, QWORD PTR [r8+8]
|
||||||
|
movd xmm0, rsi
|
||||||
|
mov rcx, QWORD PTR [rdx+56]
|
||||||
|
and r9d, 2097136
|
||||||
|
xor rcx, QWORD PTR [rdx+24]
|
||||||
|
movd xmm4, rdi
|
||||||
|
mov rax, QWORD PTR [rdx+48]
|
||||||
|
xor rax, QWORD PTR [rdx+16]
|
||||||
|
mov r14, QWORD PTR [rdx+224]
|
||||||
|
mov r13, QWORD PTR [rdx+232]
|
||||||
|
mov r15, QWORD PTR [r8+224]
|
||||||
|
punpcklqdq xmm3, xmm0
|
||||||
|
movd xmm0, rbp
|
||||||
|
movd xmm5, rax
|
||||||
|
punpcklqdq xmm4, xmm0
|
||||||
|
mov rax, QWORD PTR [r8+48]
|
||||||
|
movd xmm0, rcx
|
||||||
|
xor rax, QWORD PTR [r8+16]
|
||||||
|
mov rcx, QWORD PTR [r8+56]
|
||||||
|
xor rcx, QWORD PTR [r8+24]
|
||||||
|
movdqu xmm1, XMMWORD PTR [r14+r10]
|
||||||
|
movd xmm6, rax
|
||||||
|
punpcklqdq xmm5, xmm0
|
||||||
|
mov rax, QWORD PTR [rdx+240]
|
||||||
|
movd xmm0, rcx
|
||||||
|
movdqu xmm2, XMMWORD PTR [r15+r9]
|
||||||
|
mov QWORD PTR [rsp], rax
|
||||||
|
mov rax, QWORD PTR [r8+240]
|
||||||
|
mov QWORD PTR [rsp+8], rax
|
||||||
|
punpcklqdq xmm6, xmm0
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_double:
|
||||||
|
aesenc xmm1, xmm3
|
||||||
|
aesenc xmm2, xmm4
|
||||||
|
movdqa xmm0, xmm1
|
||||||
|
movd r11, xmm2
|
||||||
|
pxor xmm0, xmm5
|
||||||
|
movdqa xmm5, xmm1
|
||||||
|
movd QWORD PTR [r14+r10], xmm0
|
||||||
|
pextrq rcx, xmm0, 1
|
||||||
|
mov eax, ecx
|
||||||
|
movdqa xmm0, xmm2
|
||||||
|
shr rax, 24
|
||||||
|
pxor xmm0, xmm6
|
||||||
|
movdqa xmm6, xmm2
|
||||||
|
mov eax, DWORD PTR [r13+rax*4]
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [r14+r10+8], rax
|
||||||
|
movd QWORD PTR [r15+r9], xmm0
|
||||||
|
pextrq rcx, xmm0, 1
|
||||||
|
mov eax, ecx
|
||||||
|
shr rax, 24
|
||||||
|
mov eax, DWORD PTR [r13+rax*4]
|
||||||
|
xor rax, rcx
|
||||||
|
movd rcx, xmm1
|
||||||
|
mov QWORD PTR [r15+r9+8], rax
|
||||||
|
mov r9, rcx
|
||||||
|
and r9d, 2097136
|
||||||
|
mov r10, QWORD PTR [r14+r9]
|
||||||
|
mov r8, QWORD PTR [r14+r9+8]
|
||||||
|
mov rax, r10
|
||||||
|
mul rcx
|
||||||
|
add rsi, rax
|
||||||
|
add rbx, rdx
|
||||||
|
mov rax, QWORD PTR [rsp]
|
||||||
|
mov QWORD PTR [r14+r9], rbx
|
||||||
|
xor rax, rsi
|
||||||
|
mov QWORD PTR [r14+r9+8], rax
|
||||||
|
xor rsi, r8
|
||||||
|
xor rbx, r10
|
||||||
|
mov r8, r11
|
||||||
|
and r8d, 2097136
|
||||||
|
mov r10, rbx
|
||||||
|
and r10d, 2097136
|
||||||
|
movd xmm3, rbx
|
||||||
|
pinsrq xmm3, rsi, 1
|
||||||
|
mov r9, QWORD PTR [r15+r8]
|
||||||
|
mov rcx, QWORD PTR [r15+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
movdqu xmm1, XMMWORD PTR [r14+r10]
|
||||||
|
mul r11
|
||||||
|
add rbp, rax
|
||||||
|
add rdi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+8]
|
||||||
|
mov QWORD PTR [r15+r8], rdi
|
||||||
|
xor rax, rbp
|
||||||
|
xor rdi, r9
|
||||||
|
mov QWORD PTR [r15+r8+8], rax
|
||||||
|
mov r9, rdi
|
||||||
|
xor rbp, rcx
|
||||||
|
and r9d, 2097136
|
||||||
|
movd xmm4, rdi
|
||||||
|
pinsrq xmm4, rbp, 1
|
||||||
|
movdqu xmm2, XMMWORD PTR [r15+r9]
|
||||||
|
sub r12, 1
|
||||||
|
jne main_loop_cnv1_double
|
||||||
|
|
||||||
|
mov rbx, QWORD PTR [rsp+80]
|
||||||
|
mov rbp, QWORD PTR [rsp+88]
|
||||||
|
mov rsi, QWORD PTR [rsp+96]
|
||||||
|
movaps xmm6, XMMWORD PTR [rsp+16]
|
||||||
|
add rsp, 32
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
pop r12
|
||||||
|
pop rdi
|
||||||
263
src/crypto/cn/asm/win64/cn1/cnv1_quad_main_loop.inc
Normal file
263
src/crypto/cn/asm/win64/cn1/cnv1_quad_main_loop.inc
Normal file
@@ -0,0 +1,263 @@
|
|||||||
|
mov rax, rsp
|
||||||
|
mov QWORD PTR [rax+8], rbx
|
||||||
|
mov QWORD PTR [rax+16], rbp
|
||||||
|
mov QWORD PTR [rax+24], rsi
|
||||||
|
push rdi
|
||||||
|
push r12
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
sub rsp, 144
|
||||||
|
mov r8, QWORD PTR [rcx]
|
||||||
|
mov r9, QWORD PTR [rcx+8]
|
||||||
|
mov r10, QWORD PTR [rcx+16]
|
||||||
|
mov r11, QWORD PTR [rcx+24]
|
||||||
|
mov rbp, QWORD PTR [r8+224]
|
||||||
|
mov r13, QWORD PTR [r8+232]
|
||||||
|
mov r14, QWORD PTR [r9+224]
|
||||||
|
mov r15, QWORD PTR [r10+224]
|
||||||
|
mov r12, QWORD PTR [r11+224]
|
||||||
|
mov rcx, QWORD PTR [r8+40]
|
||||||
|
xor rcx, QWORD PTR [r8+8]
|
||||||
|
mov rbx, QWORD PTR [r8+32]
|
||||||
|
xor rbx, QWORD PTR [r8]
|
||||||
|
mov rdi, QWORD PTR [r9+32]
|
||||||
|
xor rdi, QWORD PTR [r9]
|
||||||
|
movd xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r9+40]
|
||||||
|
xor rcx, QWORD PTR [r9+8]
|
||||||
|
movd xmm1, rbx
|
||||||
|
movaps XMMWORD PTR [rax-56], xmm6
|
||||||
|
movaps XMMWORD PTR [rax-72], xmm7
|
||||||
|
movaps XMMWORD PTR [rax-88], xmm8
|
||||||
|
movaps XMMWORD PTR [rax-104], xmm9
|
||||||
|
movaps XMMWORD PTR [rax-120], xmm10
|
||||||
|
movaps XMMWORD PTR [rsp+48], xmm11
|
||||||
|
movaps XMMWORD PTR [rsp+32], xmm12
|
||||||
|
and ebx, 2097136
|
||||||
|
mov rsi, QWORD PTR [r10+32]
|
||||||
|
movd xmm2, rdi
|
||||||
|
mov rax, QWORD PTR [r8+240]
|
||||||
|
and edi, 2097136
|
||||||
|
xor rsi, QWORD PTR [r10]
|
||||||
|
mov rdx, QWORD PTR [r8+56]
|
||||||
|
xor rdx, QWORD PTR [r8+24]
|
||||||
|
mov QWORD PTR [rsp], rax
|
||||||
|
mov rax, QWORD PTR [r9+240]
|
||||||
|
movd xmm3, rsi
|
||||||
|
mov QWORD PTR [rsp+8], rax
|
||||||
|
and esi, 2097136
|
||||||
|
mov rax, QWORD PTR [r10+240]
|
||||||
|
punpcklqdq xmm1, xmm0
|
||||||
|
movd xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r10+40]
|
||||||
|
xor rcx, QWORD PTR [r10+8]
|
||||||
|
mov QWORD PTR [rsp+16], rax
|
||||||
|
mov rax, QWORD PTR [r11+240]
|
||||||
|
punpcklqdq xmm2, xmm0
|
||||||
|
movd xmm0, rcx
|
||||||
|
mov QWORD PTR [rsp+24], rax
|
||||||
|
mov rcx, QWORD PTR [r11+40]
|
||||||
|
xor rcx, QWORD PTR [r11+8]
|
||||||
|
mov rax, QWORD PTR [r11+32]
|
||||||
|
xor rax, QWORD PTR [r11]
|
||||||
|
punpcklqdq xmm3, xmm0
|
||||||
|
movd xmm0, rcx
|
||||||
|
mov rcx, QWORD PTR [r8+48]
|
||||||
|
xor rcx, QWORD PTR [r8+16]
|
||||||
|
movd xmm4, rax
|
||||||
|
and eax, 2097136
|
||||||
|
punpcklqdq xmm4, xmm0
|
||||||
|
movd xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r9+56]
|
||||||
|
xor rdx, QWORD PTR [r9+24]
|
||||||
|
movd xmm5, rcx
|
||||||
|
mov rcx, QWORD PTR [r9+48]
|
||||||
|
xor rcx, QWORD PTR [r9+16]
|
||||||
|
punpcklqdq xmm5, xmm0
|
||||||
|
movd xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r10+56]
|
||||||
|
xor rdx, QWORD PTR [r10+24]
|
||||||
|
movd xmm6, rcx
|
||||||
|
mov rcx, QWORD PTR [r10+48]
|
||||||
|
xor rcx, QWORD PTR [r10+16]
|
||||||
|
punpcklqdq xmm6, xmm0
|
||||||
|
movd xmm0, rdx
|
||||||
|
mov rdx, QWORD PTR [r11+56]
|
||||||
|
movd xmm7, rcx
|
||||||
|
punpcklqdq xmm7, xmm0
|
||||||
|
xor rdx, QWORD PTR [r11+24]
|
||||||
|
mov rcx, QWORD PTR [r11+48]
|
||||||
|
xor rcx, QWORD PTR [r11+16]
|
||||||
|
mov r11d, 524288
|
||||||
|
movdqu xmm9, XMMWORD PTR [rbp+rbx]
|
||||||
|
movdqu xmm10, XMMWORD PTR [r14+rdi]
|
||||||
|
movd xmm0, rdx
|
||||||
|
movdqu xmm11, XMMWORD PTR [r15+rsi]
|
||||||
|
movdqu xmm12, XMMWORD PTR [r12+rax]
|
||||||
|
movd xmm8, rcx
|
||||||
|
punpcklqdq xmm8, xmm0
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_quad:
|
||||||
|
aesenc xmm9, xmm1
|
||||||
|
aesenc xmm10, xmm2
|
||||||
|
aesenc xmm11, xmm3
|
||||||
|
aesenc xmm12, xmm4
|
||||||
|
movd ecx, xmm9
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+rbp]
|
||||||
|
movd ecx, xmm10
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r14]
|
||||||
|
movd ecx, xmm11
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r15]
|
||||||
|
movd ecx, xmm12
|
||||||
|
and ecx, 2097136
|
||||||
|
prefetcht0 BYTE PTR [rcx+r12]
|
||||||
|
movdqa xmm0, xmm9
|
||||||
|
pxor xmm0, xmm5
|
||||||
|
movdqa xmm5, xmm9
|
||||||
|
movd QWORD PTR [rbp+rbx], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm10
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm6
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [rbp+rbx+8], rcx
|
||||||
|
movd rbx, xmm1
|
||||||
|
movd QWORD PTR [r14+rdi], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm11
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm7
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r14+rdi+8], rcx
|
||||||
|
movd rdi, xmm2
|
||||||
|
movd QWORD PTR [r15+rsi], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
movdqa xmm0, xmm12
|
||||||
|
shr rcx, 24
|
||||||
|
pxor xmm0, xmm8
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r15+rsi+8], rcx
|
||||||
|
movd QWORD PTR [r12+rax], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov ecx, edx
|
||||||
|
shr rcx, 24
|
||||||
|
mov ecx, DWORD PTR [r13+rcx*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [r12+rax+8], rcx
|
||||||
|
movd rcx, xmm9
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
mov r9, QWORD PTR [rbp+r8]
|
||||||
|
mov r10, QWORD PTR [rbp+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm1, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rbx, rdx
|
||||||
|
mov rax, QWORD PTR [rsp]
|
||||||
|
mov QWORD PTR [rbp+r8], rbx
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [rbp+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
xor rbx, r9
|
||||||
|
movd xmm1, rbx
|
||||||
|
and ebx, 2097136
|
||||||
|
pinsrq xmm1, rcx, 1
|
||||||
|
movd rcx, xmm10
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm9, XMMWORD PTR [rbp+rbx]
|
||||||
|
mov r9, QWORD PTR [r14+r8]
|
||||||
|
mov r10, QWORD PTR [r14+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm2, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rdi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+8]
|
||||||
|
mov QWORD PTR [r14+r8], rdi
|
||||||
|
xor rax, rcx
|
||||||
|
xor rdi, r9
|
||||||
|
mov QWORD PTR [r14+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
movd xmm2, rdi
|
||||||
|
and edi, 2097136
|
||||||
|
pinsrq xmm2, rcx, 1
|
||||||
|
movd rcx, xmm11
|
||||||
|
movd rsi, xmm3
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqa xmm6, xmm10
|
||||||
|
movdqa xmm7, xmm11
|
||||||
|
movdqa xmm8, xmm12
|
||||||
|
movdqu xmm10, XMMWORD PTR [r14+rdi]
|
||||||
|
mov r9, QWORD PTR [r15+r8]
|
||||||
|
mov r10, QWORD PTR [r15+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
pextrq rcx, xmm3, 1
|
||||||
|
add rcx, rax
|
||||||
|
add rsi, rdx
|
||||||
|
mov rax, QWORD PTR [rsp+16]
|
||||||
|
xor rax, rcx
|
||||||
|
mov QWORD PTR [r15+r8], rsi
|
||||||
|
mov QWORD PTR [r15+r8+8], rax
|
||||||
|
xor rcx, r10
|
||||||
|
xor rsi, r9
|
||||||
|
movd xmm3, rsi
|
||||||
|
and esi, 2097136
|
||||||
|
pinsrq xmm3, rcx, 1
|
||||||
|
movd rcx, xmm12
|
||||||
|
mov r8, rcx
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm11, XMMWORD PTR [r15+rsi]
|
||||||
|
mov r9, QWORD PTR [r12+r8]
|
||||||
|
mov r10, QWORD PTR [r12+r8+8]
|
||||||
|
mov rax, r9
|
||||||
|
mul rcx
|
||||||
|
mov rcx, rax
|
||||||
|
movd rax, xmm4
|
||||||
|
add rax, rdx
|
||||||
|
mov QWORD PTR [r12+r8], rax
|
||||||
|
xor rax, r9
|
||||||
|
pextrq rdx, xmm4, 1
|
||||||
|
add rdx, rcx
|
||||||
|
mov rcx, QWORD PTR [rsp+24]
|
||||||
|
xor rcx, rdx
|
||||||
|
xor rdx, r10
|
||||||
|
movd xmm4, rax
|
||||||
|
mov QWORD PTR [r12+r8+8], rcx
|
||||||
|
and eax, 2097136
|
||||||
|
pinsrq xmm4, rdx, 1
|
||||||
|
movdqu xmm12, XMMWORD PTR [r12+rax]
|
||||||
|
sub r11, 1
|
||||||
|
jne main_loop_cnv1_quad
|
||||||
|
|
||||||
|
movaps xmm7, XMMWORD PTR [rsp+112]
|
||||||
|
lea r11, QWORD PTR [rsp+144]
|
||||||
|
mov rbx, QWORD PTR [r11+48]
|
||||||
|
mov rbp, QWORD PTR [r11+56]
|
||||||
|
mov rsi, QWORD PTR [r11+64]
|
||||||
|
movaps xmm6, XMMWORD PTR [r11-16]
|
||||||
|
movaps xmm8, XMMWORD PTR [r11-48]
|
||||||
|
movaps xmm9, XMMWORD PTR [r11-64]
|
||||||
|
movaps xmm10, XMMWORD PTR [r11-80]
|
||||||
|
movaps xmm11, XMMWORD PTR [r11-96]
|
||||||
|
movaps xmm12, XMMWORD PTR [r11-112]
|
||||||
|
mov rsp, r11
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
pop r12
|
||||||
|
pop rdi
|
||||||
66
src/crypto/cn/asm/win64/cn1/cnv1_single_main_loop.inc
Normal file
66
src/crypto/cn/asm/win64/cn1/cnv1_single_main_loop.inc
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
mov QWORD PTR [rsp+8], rbx
|
||||||
|
mov QWORD PTR [rsp+16], rbp
|
||||||
|
mov QWORD PTR [rsp+24], rsi
|
||||||
|
mov QWORD PTR [rsp+32], rdi
|
||||||
|
push r13
|
||||||
|
push r14
|
||||||
|
push r15
|
||||||
|
mov rdx, QWORD PTR [rcx]
|
||||||
|
mov esi, 524288
|
||||||
|
mov r11, QWORD PTR [rdx+32]
|
||||||
|
xor r11, QWORD PTR [rdx]
|
||||||
|
mov rdi, QWORD PTR [rdx+224]
|
||||||
|
mov rbx, QWORD PTR [rdx+40]
|
||||||
|
xor rbx, QWORD PTR [rdx+8]
|
||||||
|
mov rcx, QWORD PTR [rdx+56]
|
||||||
|
xor rcx, QWORD PTR [rdx+24]
|
||||||
|
mov rax, QWORD PTR [rdx+48]
|
||||||
|
xor rax, QWORD PTR [rdx+16]
|
||||||
|
mov rbp, QWORD PTR [rdx+240]
|
||||||
|
mov r14, QWORD PTR [rdx+232]
|
||||||
|
movd xmm2, rax
|
||||||
|
pinsrq xmm2, rcx, 1
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
main_loop_cnv1_single:
|
||||||
|
mov r8, r11
|
||||||
|
and r8d, 2097136
|
||||||
|
movdqu xmm1, XMMWORD PTR [rdi+r8]
|
||||||
|
movd xmm0, r11
|
||||||
|
pinsrq xmm0, rbx, 1
|
||||||
|
aesenc xmm1, xmm0
|
||||||
|
movd r15, xmm1
|
||||||
|
mov r9, r15
|
||||||
|
and r9d, 2097136
|
||||||
|
movdqa xmm0, xmm1
|
||||||
|
pxor xmm0, xmm2
|
||||||
|
movdqa xmm2, xmm1
|
||||||
|
movd QWORD PTR [rdi+r8], xmm0
|
||||||
|
pextrq rdx, xmm0, 1
|
||||||
|
mov eax, edx
|
||||||
|
shr rax, 24
|
||||||
|
mov ecx, DWORD PTR [r14+rax*4]
|
||||||
|
xor rcx, rdx
|
||||||
|
mov QWORD PTR [rdi+r8+8], rcx
|
||||||
|
mov r10, QWORD PTR [rdi+r9]
|
||||||
|
mov r8, QWORD PTR [rdi+r9+8]
|
||||||
|
mov rax, r10
|
||||||
|
mul r15
|
||||||
|
add rbx, rax
|
||||||
|
add r11, rdx
|
||||||
|
mov QWORD PTR [rdi+r9], r11
|
||||||
|
mov rax, rbx
|
||||||
|
xor rbx, r8
|
||||||
|
xor r11, r10
|
||||||
|
xor rax, rbp
|
||||||
|
mov QWORD PTR [rdi+r9+8], rax
|
||||||
|
sub rsi, 1
|
||||||
|
jne main_loop_cnv1_single
|
||||||
|
|
||||||
|
pop r15
|
||||||
|
pop r14
|
||||||
|
pop r13
|
||||||
|
mov rbx, QWORD PTR [rsp+8]
|
||||||
|
mov rbp, QWORD PTR [rsp+16]
|
||||||
|
mov rsi, QWORD PTR [rsp+24]
|
||||||
|
mov rdi, QWORD PTR [rsp+32]
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
#define ALIGN(x) .align 64
|
#define ALIGN(x) .align 64
|
||||||
.intel_syntax noprefix
|
.intel_syntax noprefix
|
||||||
.section .text
|
.section .text
|
||||||
|
.global cnv1_single_mainloop_asm
|
||||||
|
.global cnv1_double_mainloop_asm
|
||||||
|
.global cnv1_quad_mainloop_asm
|
||||||
.global cnv2_mainloop_ivybridge_asm
|
.global cnv2_mainloop_ivybridge_asm
|
||||||
.global cnv2_mainloop_ryzen_asm
|
.global cnv2_mainloop_ryzen_asm
|
||||||
.global cnv2_mainloop_bulldozer_asm
|
.global cnv2_mainloop_bulldozer_asm
|
||||||
@@ -9,6 +12,24 @@
|
|||||||
.global cnv2_rwz_double_mainloop_asm
|
.global cnv2_rwz_double_mainloop_asm
|
||||||
.global cnv2_upx_double_mainloop_zen3_asm
|
.global cnv2_upx_double_mainloop_zen3_asm
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_single_mainloop_asm:
|
||||||
|
#include "../cn1/cnv1_single_main_loop.inc"
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_double_mainloop_asm:
|
||||||
|
#include "../cn1/cnv1_double_main_loop.inc"
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_quad_mainloop_asm:
|
||||||
|
#include "../cn1/cnv1_quad_main_loop.inc"
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
|
||||||
ALIGN(64)
|
ALIGN(64)
|
||||||
cnv2_mainloop_ivybridge_asm:
|
cnv2_mainloop_ivybridge_asm:
|
||||||
#include "../cn2/cnv2_main_loop_ivybridge.inc"
|
#include "../cn2/cnv2_main_loop_ivybridge.inc"
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
_TEXT_CNV2_MAINLOOP SEGMENT PAGE READ EXECUTE
|
_TEXT_CNV2_MAINLOOP SEGMENT PAGE READ EXECUTE
|
||||||
|
PUBLIC cnv1_single_mainloop_asm
|
||||||
|
PUBLIC cnv1_double_mainloop_asm
|
||||||
|
PUBLIC cnv1_quad_mainloop_asm
|
||||||
PUBLIC cnv2_mainloop_ivybridge_asm
|
PUBLIC cnv2_mainloop_ivybridge_asm
|
||||||
PUBLIC cnv2_mainloop_ryzen_asm
|
PUBLIC cnv2_mainloop_ryzen_asm
|
||||||
PUBLIC cnv2_mainloop_bulldozer_asm
|
PUBLIC cnv2_mainloop_bulldozer_asm
|
||||||
@@ -6,28 +9,49 @@ PUBLIC cnv2_double_mainloop_sandybridge_asm
|
|||||||
PUBLIC cnv2_rwz_mainloop_asm
|
PUBLIC cnv2_rwz_mainloop_asm
|
||||||
PUBLIC cnv2_rwz_double_mainloop_asm
|
PUBLIC cnv2_rwz_double_mainloop_asm
|
||||||
|
|
||||||
ALIGN 64
|
ALIGN(64)
|
||||||
|
cnv1_single_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_single_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_single_mainloop_asm ENDP
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_double_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_double_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_double_mainloop_asm ENDP
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
|
cnv1_quad_mainloop_asm PROC
|
||||||
|
INCLUDE cn1/cnv1_quad_main_loop.inc
|
||||||
|
ret 0
|
||||||
|
mov eax, 3735929054
|
||||||
|
cnv1_quad_mainloop_asm ENDP
|
||||||
|
|
||||||
|
ALIGN(64)
|
||||||
cnv2_mainloop_ivybridge_asm PROC
|
cnv2_mainloop_ivybridge_asm PROC
|
||||||
INCLUDE cn2/cnv2_main_loop_ivybridge.inc
|
INCLUDE cn2/cnv2_main_loop_ivybridge.inc
|
||||||
ret 0
|
ret 0
|
||||||
mov eax, 3735929054
|
mov eax, 3735929054
|
||||||
cnv2_mainloop_ivybridge_asm ENDP
|
cnv2_mainloop_ivybridge_asm ENDP
|
||||||
|
|
||||||
ALIGN 64
|
ALIGN(64)
|
||||||
cnv2_mainloop_ryzen_asm PROC
|
cnv2_mainloop_ryzen_asm PROC
|
||||||
INCLUDE cn2/cnv2_main_loop_ryzen.inc
|
INCLUDE cn2/cnv2_main_loop_ryzen.inc
|
||||||
ret 0
|
ret 0
|
||||||
mov eax, 3735929054
|
mov eax, 3735929054
|
||||||
cnv2_mainloop_ryzen_asm ENDP
|
cnv2_mainloop_ryzen_asm ENDP
|
||||||
|
|
||||||
ALIGN 64
|
ALIGN(64)
|
||||||
cnv2_mainloop_bulldozer_asm PROC
|
cnv2_mainloop_bulldozer_asm PROC
|
||||||
INCLUDE cn2/cnv2_main_loop_bulldozer.inc
|
INCLUDE cn2/cnv2_main_loop_bulldozer.inc
|
||||||
ret 0
|
ret 0
|
||||||
mov eax, 3735929054
|
mov eax, 3735929054
|
||||||
cnv2_mainloop_bulldozer_asm ENDP
|
cnv2_mainloop_bulldozer_asm ENDP
|
||||||
|
|
||||||
ALIGN 64
|
ALIGN(64)
|
||||||
cnv2_double_mainloop_sandybridge_asm PROC
|
cnv2_double_mainloop_sandybridge_asm PROC
|
||||||
INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc
|
INCLUDE cn2/cnv2_double_main_loop_sandybridge.inc
|
||||||
ret 0
|
ret 0
|
||||||
|
|||||||
@@ -344,7 +344,7 @@ typedef union ALIGN_STRUCT(16) SIMDVec {
|
|||||||
|
|
||||||
// Older gcc does not define vld1q_u8_x4 type
|
// Older gcc does not define vld1q_u8_x4 type
|
||||||
#if defined(__GNUC__) && !defined(__clang__) && \
|
#if defined(__GNUC__) && !defined(__clang__) && \
|
||||||
((__GNUC__ <= 10 && defined(__arm__)) || \
|
((__GNUC__ <= 11 && defined(__arm__)) || \
|
||||||
(__GNUC__ == 10 && __GNUC_MINOR__ < 3 && defined(__aarch64__)) || \
|
(__GNUC__ == 10 && __GNUC_MINOR__ < 3 && defined(__aarch64__)) || \
|
||||||
(__GNUC__ <= 9 && defined(__aarch64__)))
|
(__GNUC__ <= 9 && defined(__aarch64__)))
|
||||||
FORCE_INLINE uint8x16x4_t _sse2neon_vld1q_u8_x4(const uint8_t *p)
|
FORCE_INLINE uint8x16x4_t _sse2neon_vld1q_u8_x4(const uint8_t *p)
|
||||||
|
|||||||
85
src/crypto/ghostrider/CMakeLists.txt
Normal file
85
src/crypto/ghostrider/CMakeLists.txt
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
cmake_minimum_required(VERSION 2.8.12)
|
||||||
|
project(GhostRider)
|
||||||
|
|
||||||
|
set(HEADERS
|
||||||
|
sph_types.h
|
||||||
|
sph_blake.h
|
||||||
|
sph_bmw.h
|
||||||
|
sph_cubehash.h
|
||||||
|
sph_echo.h
|
||||||
|
sph_fugue.h
|
||||||
|
sph_groestl.h
|
||||||
|
sph_hamsi.h
|
||||||
|
sph_jh.h
|
||||||
|
sph_keccak.h
|
||||||
|
sph_luffa.h
|
||||||
|
sph_sha2.h
|
||||||
|
sph_shabal.h
|
||||||
|
sph_shavite.h
|
||||||
|
sph_simd.h
|
||||||
|
sph_skein.h
|
||||||
|
sph_whirlpool.h
|
||||||
|
ghostrider.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(SOURCES
|
||||||
|
sph_blake.c
|
||||||
|
sph_bmw.c
|
||||||
|
sph_cubehash.c
|
||||||
|
sph_echo.c
|
||||||
|
sph_fugue.c
|
||||||
|
sph_groestl.c
|
||||||
|
sph_hamsi.c
|
||||||
|
sph_jh.c
|
||||||
|
sph_keccak.c
|
||||||
|
sph_luffa.c
|
||||||
|
sph_shabal.c
|
||||||
|
sph_shavite.c
|
||||||
|
sph_simd.c
|
||||||
|
sph_sha2.c
|
||||||
|
sph_skein.c
|
||||||
|
sph_whirlpool.c
|
||||||
|
ghostrider.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
if (CMAKE_C_COMPILER_ID MATCHES MSVC)
|
||||||
|
set_source_files_properties(sph_blake.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_bmw.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_cubehash.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_echo.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_fugue.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_groestl.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_hamsi.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_jh.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_keccak.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_luffa.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_shabal.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_shavite.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_simd.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_sha2.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_skein.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
set_source_files_properties(sph_whirlpool.c PROPERTIES COMPILE_FLAGS "/O1 /Oi /Os")
|
||||||
|
elseif (CMAKE_C_COMPILER_ID MATCHES GNU OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
||||||
|
set_source_files_properties(sph_blake.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_bmw.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_cubehash.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_echo.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_fugue.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_groestl.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_hamsi.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_jh.c PROPERTIES COMPILE_FLAGS "-Os -fno-tree-vrp")
|
||||||
|
set_source_files_properties(sph_keccak.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_luffa.c PROPERTIES COMPILE_FLAGS "-Os -Wno-unused-const-variable")
|
||||||
|
set_source_files_properties(sph_shabal.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_shavite.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_simd.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_sha2.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_skein.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
set_source_files_properties(sph_whirlpool.c PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include_directories(.)
|
||||||
|
include_directories(../..)
|
||||||
|
include_directories(${UV_INCLUDE_DIR})
|
||||||
|
|
||||||
|
add_library(ghostrider STATIC ${HEADERS} ${SOURCES})
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user