Browse Source

Make our randomx input longer with a variable prefix and suffix

pull/151/head
Duke Leto 2 years ago
parent
commit
42f75bd577
  1. 10
      src/miner.cpp
  2. 2
      test_randomx

10
src/miner.cpp

@ -1183,16 +1183,8 @@ void static RandomXMiner()
char randomxKey[65]; // randomx spec says keysize of >60 bytes is implementation-specific
strncpy(randomxKey, SMART_CHAIN_SYMBOL, 65);
crypto_generichash_blake2b_state state;
// Hash = blake2b( key || ac_name)
//crypto_generichash_blake2b_update(&state, (unsigned char*)&randomxKey[0], sizeof(randomxKey));
//crypto_generichash_blake2b_update(&state, (unsigned char*)&randomxKey[0], 4 + strlen(SMART_CHAIN_SYMBOL) + 1);
//crypto_generichash_blake2b_update(&state, (unsigned char*)&SMART_CHAIN_SYMBOL[0], sizeof(SMART_CHAIN_SYMBOL));
//uchar randomxInput[32];
//crypto_generichash_blake2b_final(&state, randomxInput, 32);
//unsigned char randomxInput[] = "RANDOMX";
char randomxInput[80];
sprintf(randomxInput, "%08x", ASSETCHAINS_MAGIC);
sprintf(randomxInput, "%08x Extreme Privacy Hush Smart Chain %08x", ASSETCHAINS_MAGIC, ASSETCHAINS_MAGIC);
fprintf(stderr,"RandomXMiner: created randomxInput=%s\n", randomxInput);

2
test_randomx

@ -1,6 +1,6 @@
#!/bin/bash
./src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX5 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
./src/hushd -ac_randomx_interval=10 -ac_randomx_lag=3 -ac_halving=20 -ac_algo=randomx -ac_name=RANDOMX6 -ac_private=1 -ac_blocktime=20 -ac_reward=500000000 -ac_supply=55555 -gen=1 -genproclimit=1 -testnode=1
# to run via the debugger
# type "run" when gdb prompt appears

Loading…
Cancel
Save