Skip to content

Commit bab6a63

Browse files
committed
Merge branch 'master' into dev
2 parents 2e503f7 + 1bd05d1 commit bab6a63

31 files changed

+388
-194
lines changed

CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
# v2.5.2
2+
- [#448](https://github.com/xmrig/xmrig/issues/478) Fixed broken reconnect.
3+
4+
# v2.5.1
5+
- [#454](https://github.com/xmrig/xmrig/issues/454) Fixed build with libmicrohttpd version below v0.9.35.
6+
- [#456](https://github.com/xmrig/xmrig/issues/459) Verbose errors related to donation pool was not fully silenced.
7+
- [#459](https://github.com/xmrig/xmrig/issues/459) Fixed regression (version 2.5.0 affected) with connection to **xmr.f2pool.com**.
8+
19
# v2.5.0
2-
- [#434](https://github.com/xmrig/xmrig/issues/434) **Added support for Monero v7 PoW, scheduled on March 28.**
10+
- [#434](https://github.com/xmrig/xmrig/issues/434) **Added support for Monero v7 PoW, scheduled on April 6.**
311
- Added full IPv6 support.
412
- Added protocol extension, when use the miner with xmrig-proxy 2.5+ no more need manually specify `nicehash` option.
513
- [#123](https://github.com/xmrig/xmrig-proxy/issues/123) Fixed regression (all versions since 2.4 affected) fragmented responses from pool/proxy was parsed incorrectly.

README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# XMRig
2+
3+
:warning: **You must update miners to version 2.5 before April 6 due [Monero PoW change](https://getmonero.org/2018/02/11/PoW-change-and-key-reuse.html).**
4+
25
[![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/xmrig/xmrig/releases)
36
[![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/xmrig/xmrig/releases)
47
[![GitHub Release Date](https://img.shields.io/github/release-date-pre/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases)
@@ -63,11 +66,13 @@ Use [config.xmrig.com](https://config.xmrig.com/xmrig) to generate, edit or shar
6366
--cpu-priority set process priority (0 idle, 2 normal to 5 highest)
6467
--no-huge-pages disable huge pages support
6568
--no-color disable colored output
69+
--variant algorithm PoW variant
6670
--donate-level=N donate level, default 5% (5 minutes in 100 minutes)
6771
--user-agent set custom user-agent string for pool
6872
-B, --background run the miner in the background
6973
-c, --config=FILE load a JSON-format configuration file
7074
-l, --log-file=FILE log all output to a file
75+
-S, --syslog use system log for output messages
7176
--max-cpu-usage=N maximum CPU usage for automatic threads mode (default 75)
7277
--safe safe adjust threads and av settings for current CPU
7378
--nicehash enable nicehash/xmrig-proxy support
@@ -119,10 +124,10 @@ Please note performance is highly dependent on system load. The numbers above ar
119124
## Release checksums
120125
### SHA-256
121126
```
122-
232ea929f7219c8de81c7e6fcae7437d40d8128cf55b597a6e1fca0cd77f9f5b xmrig-2.5.0-xenial-amd64.tar.gz/xmrig-2.5.0/xmrig
123-
6149ffed21e740cac12aa61b2fdd17248cbd3e51bab2289d2766aad1d29df910 xmrig-2.5.0-gcc-win32.zip/xmrig.exe
124-
9c89f80e21db906439a7a1b333b8215dbe07d8e42f98a63f6c10c954288a7108 xmrig-2.5.0-gcc-win64.zip/xmrig.exe
125-
b50773c5a74ca9921597a1152e2469ec266cc89eb9765038db7e876f0bcece73 xmrig-2.5.0-msvc-win64.zip/xmrig.exe
127+
b070d06a3615f3db67ad3beab43d6d21f3c88026aa2b4726a93df47145cd30ec xmrig-2.5.2-xenial-amd64.tar.gz/xmrig-2.5.2/xmrig
128+
4852135d3f04fd450ba39abce51ca40ff9131d222220c8b30804be05f6679295 xmrig-2.5.2-gcc-win32.zip/xmrig.exe
129+
284309d07f08261af19c937ece6d2031910d9124a7359c207ded65890b2d7c5f xmrig-2.5.2-gcc-win64.zip/xmrig.exe
130+
e1dc46158a578fb030538fb06e5663a6acc5763545fb447a00ce0a6b388c5226 xmrig-2.5.2-msvc-win64.zip/xmrig.exe
126131
```
127132

128133
## Contacts

cmake/flags.cmake

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "")
66
set(CMAKE_BUILD_TYPE Release)
77
endif()
88

9+
if (CMAKE_BUILD_TYPE STREQUAL "Release")
10+
add_definitions(/DNDEBUG)
11+
endif()
12+
913
if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
1014

1115
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-strict-aliasing")

res/app.ico

6.26 KB
Binary file not shown.

src/App_unix.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
55
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
66
* Copyright 2016 Jay D Dee <[email protected]>
7-
* Copyright 2016-2017 XMRig <support@xmrig.com>
8-
*
7+
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
8+
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <[email protected]>
99
*
1010
* This program is free software: you can redistribute it and/or modify
1111
* it under the terms of the GNU General Public License as published by
@@ -36,6 +36,8 @@
3636

3737
void App::background()
3838
{
39+
signal(SIGPIPE, SIG_IGN);
40+
3941
if (m_options->affinity() != -1L) {
4042
Cpu::setAffinity(-1, m_options->affinity());
4143
}

src/api/Httpd.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ bool Httpd::start()
4545
return false;
4646
}
4747

48-
unsigned int flags = 0;
48+
unsigned int flags = MHD_USE_SELECT_INTERNALLY;
49+
50+
# if MHD_VERSION >= 0x00093500
4951
if (MHD_is_feature_supported(MHD_FEATURE_EPOLL)) {
5052
flags = MHD_USE_EPOLL_LINUX_ONLY | MHD_USE_EPOLL_INTERNALLY_LINUX_ONLY;
5153
}
52-
else {
53-
flags = MHD_USE_SELECT_INTERNALLY;
54-
}
5554

5655
if (MHD_is_feature_supported(MHD_FEATURE_IPv6)) {
5756
flags |= MHD_USE_DUAL_STACK;
5857
}
58+
# endif
5959

6060
m_daemon = MHD_start_daemon(flags, m_port, nullptr, nullptr, &Httpd::handler, this, MHD_OPTION_END);
6161
if (!m_daemon) {

src/config.json

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
"threads": null, // number of miner threads
1717
"pools": [
1818
{
19-
"url": "pool.minemonero.pro:5555", // URL of mining server
20-
"user": "", // username for mining server
21-
"pass": "x", // password for mining server
22-
"keepalive": true, // send keepalived for prevent timeout (need pool support)
23-
"nicehash": false // enable nicehash/xmrig-proxy support
19+
"url": "failover.xmrig.com:443", // URL of mining server
20+
"user": "YOUR_WALLET", // username for mining server
21+
"pass": "x", // password for mining server
22+
"keepalive": true, // send keepalived for prevent timeout (need pool support)
23+
"nicehash": false, // enable nicehash/xmrig-proxy support
24+
"variant": -1 // algorithm PoW variant
2425
}
2526
],
2627
"api": {

src/crypto/CryptoNight.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "xmrig.h"
4040

4141

42-
void (*cryptonight_hash_ctx)(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) = nullptr;
42+
void (*cryptonight_hash_ctx)(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) = nullptr;
4343

4444

4545
#define CRYPTONIGHT_HASH(NAME, ITERATIONS, MEM, MASK, SOFT_AES) \
@@ -55,55 +55,55 @@ void (*cryptonight_hash_ctx)(const void *input, size_t size, void *output, crypt
5555
}
5656

5757

58-
static void cryptonight_av1_aesni(const void *input, size_t size, void *output, struct cryptonight_ctx *ctx, int variant) {
58+
static void cryptonight_av1_aesni(const uint8_t *input, size_t size, uint8_t *output, struct cryptonight_ctx *ctx, int variant) {
5959
# if !defined(XMRIG_ARMv7)
6060
CRYPTONIGHT_HASH(single, MONERO_ITER, MONERO_MEMORY, MONERO_MASK, false)
6161
# endif
6262
}
6363

6464

65-
static void cryptonight_av2_aesni_double(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
65+
static void cryptonight_av2_aesni_double(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
6666
# if !defined(XMRIG_ARMv7)
6767
CRYPTONIGHT_HASH(double, MONERO_ITER, MONERO_MEMORY, MONERO_MASK, false)
6868
# endif
6969
}
7070

7171

72-
static void cryptonight_av3_softaes(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
72+
static void cryptonight_av3_softaes(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
7373
CRYPTONIGHT_HASH(single, MONERO_ITER, MONERO_MEMORY, MONERO_MASK, true)
7474
}
7575

7676

77-
static void cryptonight_av4_softaes_double(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
77+
static void cryptonight_av4_softaes_double(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
7878
CRYPTONIGHT_HASH(double, MONERO_ITER, MONERO_MEMORY, MONERO_MASK, true)
7979
}
8080

8181

8282
#ifndef XMRIG_NO_AEON
83-
static void cryptonight_lite_av1_aesni(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
83+
static void cryptonight_lite_av1_aesni(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
8484
# if !defined(XMRIG_ARMv7)
8585
CRYPTONIGHT_HASH(single, AEON_ITER, AEON_MEMORY, AEON_MASK, false)
8686
# endif
8787
}
8888

8989

90-
static void cryptonight_lite_av2_aesni_double(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
90+
static void cryptonight_lite_av2_aesni_double(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
9191
# if !defined(XMRIG_ARMv7)
9292
CRYPTONIGHT_HASH(double, AEON_ITER, AEON_MEMORY, AEON_MASK, false)
9393
# endif
9494
}
9595

9696

97-
static void cryptonight_lite_av3_softaes(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
97+
static void cryptonight_lite_av3_softaes(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
9898
CRYPTONIGHT_HASH(single, AEON_ITER, AEON_MEMORY, AEON_MASK, true)
9999
}
100100

101101

102-
static void cryptonight_lite_av4_softaes_double(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) {
102+
static void cryptonight_lite_av4_softaes_double(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) {
103103
CRYPTONIGHT_HASH(double, AEON_ITER, AEON_MEMORY, AEON_MASK, true)
104104
}
105105

106-
void (*cryptonight_variations[8])(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) = {
106+
void (*cryptonight_variations[8])(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) = {
107107
cryptonight_av1_aesni,
108108
cryptonight_av2_aesni_double,
109109
cryptonight_av3_softaes,
@@ -114,7 +114,7 @@ void (*cryptonight_variations[8])(const void *input, size_t size, void *output,
114114
cryptonight_lite_av4_softaes_double
115115
};
116116
#else
117-
void (*cryptonight_variations[4])(const void *input, size_t size, void *output, cryptonight_ctx *ctx, int variant) = {
117+
void (*cryptonight_variations[4])(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx, int variant) = {
118118
cryptonight_av1_aesni,
119119
cryptonight_av2_aesni_double,
120120
cryptonight_av3_softaes,
@@ -160,7 +160,7 @@ bool CryptoNight::selfTest(int algo) {
160160
return false;
161161
}
162162

163-
char output[64];
163+
uint8_t output[64];
164164

165165
struct cryptonight_ctx *ctx = static_cast<cryptonight_ctx *>(_mm_malloc(sizeof(cryptonight_ctx), 16));
166166
ctx->memory = static_cast<uint8_t *>(_mm_malloc(MONERO_MEMORY * 2, 16));

src/crypto/CryptoNight_arm.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,27 @@ extern "C"
4949
}
5050

5151

52-
static inline void do_blake_hash(const void* input, size_t len, char* output) {
53-
blake256_hash(reinterpret_cast<uint8_t*>(output), static_cast<const uint8_t*>(input), len);
52+
static inline void do_blake_hash(const uint8_t *input, size_t len, uint8_t *output) {
53+
blake256_hash(output, input, len);
5454
}
5555

5656

57-
static inline void do_groestl_hash(const void* input, size_t len, char* output) {
58-
groestl(static_cast<const uint8_t*>(input), len * 8, reinterpret_cast<uint8_t*>(output));
57+
static inline void do_groestl_hash(const uint8_t *input, size_t len, uint8_t *output) {
58+
groestl(input, len * 8, output);
5959
}
6060

6161

62-
static inline void do_jh_hash(const void* input, size_t len, char* output) {
63-
jh_hash(32 * 8, static_cast<const uint8_t*>(input), 8 * len, reinterpret_cast<uint8_t*>(output));
62+
static inline void do_jh_hash(const uint8_t *input, size_t len, uint8_t *output) {
63+
jh_hash(32 * 8, input, 8 * len, output);
6464
}
6565

6666

67-
static inline void do_skein_hash(const void* input, size_t len, char* output) {
68-
xmr_skein(static_cast<const uint8_t*>(input), reinterpret_cast<uint8_t*>(output));
67+
static inline void do_skein_hash(const uint8_t *input, size_t len, uint8_t *output) {
68+
xmr_skein(input, output);
6969
}
7070

7171

72-
void (* const extra_hashes[4])(const void *, size_t, char *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
72+
void (* const extra_hashes[4])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
7373

7474

7575
static inline __attribute__((always_inline)) __m128i _mm_set_epi64x(const uint64_t a, const uint64_t b)
@@ -333,9 +333,9 @@ static inline void cn_implode_scratchpad(const __m128i *input, __m128i *output)
333333

334334

335335
template<size_t ITERATIONS, size_t MEM, size_t MASK, bool SOFT_AES, int VARIANT>
336-
inline void cryptonight_single_hash(const void *__restrict__ input, size_t size, void *__restrict__ output, cryptonight_ctx *__restrict__ ctx)
336+
inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx *__restrict__ ctx)
337337
{
338-
keccak(static_cast<const uint8_t*>(input), (int) size, ctx->state0, 200);
338+
keccak(input, (int) size, ctx->state0, 200);
339339

340340
VARIANT1_INIT(0);
341341

@@ -389,15 +389,15 @@ inline void cryptonight_single_hash(const void *__restrict__ input, size_t size,
389389
cn_implode_scratchpad<MEM, SOFT_AES>((__m128i*) ctx->memory, (__m128i*) ctx->state0);
390390

391391
keccakf(h0, 24);
392-
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, static_cast<char*>(output));
392+
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, output);
393393
}
394394

395395

396396
template<size_t ITERATIONS, size_t MEM, size_t MASK, bool SOFT_AES, int VARIANT>
397-
inline void cryptonight_double_hash(const void *__restrict__ input, size_t size, void *__restrict__ output, struct cryptonight_ctx *__restrict__ ctx)
397+
inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, struct cryptonight_ctx *__restrict__ ctx)
398398
{
399-
keccak((const uint8_t *) input, (int) size, ctx->state0, 200);
400-
keccak((const uint8_t *) input + size, (int) size, ctx->state1, 200);
399+
keccak(input, (int) size, ctx->state0, 200);
400+
keccak(input + size, (int) size, ctx->state1, 200);
401401

402402
VARIANT1_INIT(0);
403403
VARIANT1_INIT(1);
@@ -488,8 +488,8 @@ inline void cryptonight_double_hash(const void *__restrict__ input, size_t size,
488488
keccakf(h0, 24);
489489
keccakf(h1, 24);
490490

491-
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, static_cast<char*>(output));
492-
extra_hashes[ctx->state1[0] & 3](ctx->state1, 200, static_cast<char*>(output) + 32);
491+
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, output);
492+
extra_hashes[ctx->state1[0] & 3](ctx->state1, 200, output + 32);
493493
}
494494

495495
#endif /* __CRYPTONIGHT_ARM_H__ */

src/crypto/CryptoNight_monero.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,22 @@
2727

2828

2929
// VARIANT ALTERATIONS
30-
#define VARIANT1_INIT(part) \
30+
#ifndef XMRIG_ARM
31+
# define VARIANT1_INIT(part) \
3132
uint64_t tweak1_2_##part = 0; \
3233
if (VARIANT > 0) { \
33-
tweak1_2_##part = (*reinterpret_cast<const uint64_t*>(reinterpret_cast<const uint8_t*>(input) + 35 + part * size) ^ \
34+
tweak1_2_##part = (*reinterpret_cast<const uint64_t*>(input + 35 + part * size) ^ \
3435
*(reinterpret_cast<const uint64_t*>(ctx->state##part) + 24)); \
3536
}
37+
#else
38+
# define VARIANT1_INIT(part) \
39+
uint64_t tweak1_2_##part = 0; \
40+
if (VARIANT > 0) { \
41+
volatile const uint64_t a = *reinterpret_cast<const uint64_t*>(input + 35 + part * size); \
42+
volatile const uint64_t b = *(reinterpret_cast<const uint64_t*>(ctx->state##part) + 24); \
43+
tweak1_2_##part = a ^ b; \
44+
}
45+
#endif
3646

3747
#define VARIANT1_1(p) \
3848
if (VARIANT > 0) { \

src/crypto/CryptoNight_x86.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,27 @@ extern "C"
4949
}
5050

5151

52-
static inline void do_blake_hash(const void* input, size_t len, char* output) {
53-
blake256_hash(reinterpret_cast<uint8_t*>(output), static_cast<const uint8_t*>(input), len);
52+
static inline void do_blake_hash(const uint8_t *input, size_t len, uint8_t *output) {
53+
blake256_hash(output, input, len);
5454
}
5555

5656

57-
static inline void do_groestl_hash(const void* input, size_t len, char* output) {
58-
groestl(static_cast<const uint8_t*>(input), len * 8, reinterpret_cast<uint8_t*>(output));
57+
static inline void do_groestl_hash(const uint8_t *input, size_t len, uint8_t *output) {
58+
groestl(input, len * 8, output);
5959
}
6060

6161

62-
static inline void do_jh_hash(const void* input, size_t len, char* output) {
63-
jh_hash(32 * 8, static_cast<const uint8_t*>(input), 8 * len, reinterpret_cast<uint8_t*>(output));
62+
static inline void do_jh_hash(const uint8_t *input, size_t len, uint8_t *output) {
63+
jh_hash(32 * 8, input, 8 * len, output);
6464
}
6565

6666

67-
static inline void do_skein_hash(const void* input, size_t len, char* output) {
68-
xmr_skein(static_cast<const uint8_t*>(input), reinterpret_cast<uint8_t*>(output));
67+
static inline void do_skein_hash(const uint8_t *input, size_t len, uint8_t *output) {
68+
xmr_skein(input, output);
6969
}
7070

7171

72-
void (* const extra_hashes[4])(const void *, size_t, char *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
72+
void (* const extra_hashes[4])(const uint8_t *, size_t, uint8_t *) = {do_blake_hash, do_groestl_hash, do_jh_hash, do_skein_hash};
7373

7474

7575

@@ -310,9 +310,9 @@ static inline void cn_implode_scratchpad(const __m128i *input, __m128i *output)
310310

311311

312312
template<size_t ITERATIONS, size_t MEM, size_t MASK, bool SOFT_AES, int VARIANT>
313-
inline void cryptonight_single_hash(const void *__restrict__ input, size_t size, void *__restrict__ output, cryptonight_ctx *__restrict__ ctx)
313+
inline void cryptonight_single_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, cryptonight_ctx *__restrict__ ctx)
314314
{
315-
keccak(static_cast<const uint8_t*>(input), (int) size, ctx->state0, 200);
315+
keccak(input, (int) size, ctx->state0, 200);
316316

317317
VARIANT1_INIT(0);
318318

@@ -363,15 +363,15 @@ inline void cryptonight_single_hash(const void *__restrict__ input, size_t size,
363363
cn_implode_scratchpad<MEM, SOFT_AES>((__m128i*) ctx->memory, (__m128i*) ctx->state0);
364364

365365
keccakf(h0, 24);
366-
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, static_cast<char*>(output));
366+
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, output);
367367
}
368368

369369

370370
template<size_t ITERATIONS, size_t MEM, size_t MASK, bool SOFT_AES, int VARIANT>
371-
inline void cryptonight_double_hash(const void *__restrict__ input, size_t size, void *__restrict__ output, struct cryptonight_ctx *__restrict__ ctx)
371+
inline void cryptonight_double_hash(const uint8_t *__restrict__ input, size_t size, uint8_t *__restrict__ output, struct cryptonight_ctx *__restrict__ ctx)
372372
{
373-
keccak((const uint8_t *) input, (int) size, ctx->state0, 200);
374-
keccak((const uint8_t *) input + size, (int) size, ctx->state1, 200);
373+
keccak(input, (int) size, ctx->state0, 200);
374+
keccak(input + size, (int) size, ctx->state1, 200);
375375

376376
VARIANT1_INIT(0);
377377
VARIANT1_INIT(1);
@@ -460,8 +460,8 @@ inline void cryptonight_double_hash(const void *__restrict__ input, size_t size,
460460
keccakf(h0, 24);
461461
keccakf(h1, 24);
462462

463-
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, static_cast<char*>(output));
464-
extra_hashes[ctx->state1[0] & 3](ctx->state1, 200, static_cast<char*>(output) + 32);
463+
extra_hashes[ctx->state0[0] & 3](ctx->state0, 200, output);
464+
extra_hashes[ctx->state1[0] & 3](ctx->state1, 200, output + 32);
465465
}
466466

467467
#endif /* __CRYPTONIGHT_X86_H__ */

0 commit comments

Comments
 (0)