1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-04-17 21:12:58 -04:00

RandomX v2 + commitments

This commit is contained in:
SChernykh
2026-01-30 00:34:42 +01:00
parent 5a80c65d31
commit 9d71358f46
26 changed files with 6532 additions and 6068 deletions

View File

@@ -50,6 +50,17 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cassert>
#include "crypto/rx/Profiler.h"
#include "base/net/stratum/Job.h"
RandomX_ConfigurationMoneroV2::RandomX_ConfigurationMoneroV2()
{
ProgramSize = 384;
Tweak_V2_CFROUND = 1;
Tweak_V2_AES = 1;
Tweak_V2_PREFETCH = 1;
Tweak_V2_COMMITMENT = 1;
}
RandomX_ConfigurationWownero::RandomX_ConfigurationWownero()
{
@@ -150,6 +161,10 @@ RandomX_ConfigurationBase::RandomX_ConfigurationBase()
, RANDOMX_FREQ_CFROUND(1)
, RANDOMX_FREQ_ISTORE(16)
, RANDOMX_FREQ_NOP(0)
, Tweak_V2_CFROUND(0)
, Tweak_V2_AES(0)
, Tweak_V2_PREFETCH(0)
, Tweak_V2_COMMITMENT(0)
{
fillAes4Rx4_Key[0] = rx_set_int_vec_i128(0x99e5d23f, 0x2f546d2b, 0xd1833ddb, 0x6421aadd);
fillAes4Rx4_Key[1] = rx_set_int_vec_i128(0xa5dfcde5, 0x06f79d53, 0xb6913f55, 0xb20e3450);
@@ -367,6 +382,7 @@ typedef void(randomx::JitCompilerX86::* InstructionGeneratorX86_2)(const randomx
}
RandomX_ConfigurationMonero RandomX_MoneroConfig;
RandomX_ConfigurationMoneroV2 RandomX_MoneroConfigV2;
RandomX_ConfigurationWownero RandomX_WowneroConfig;
RandomX_ConfigurationArqma RandomX_ArqmaConfig;
RandomX_ConfigurationGraft RandomX_GraftConfig;
@@ -614,4 +630,11 @@ extern "C" {
machine->hashAndFill(output, tempHash);
}
void randomx_calculate_commitment(const void* input, size_t inputSize, const void* hash_in, void* com_out) {
uint8_t buf[xmrig::Job::kMaxBlobSize + RANDOMX_HASH_SIZE];
memcpy(buf, input, inputSize);
memcpy(buf + inputSize, hash_in, RANDOMX_HASH_SIZE);
rx_blake2b_wrapper::run(com_out, RANDOMX_HASH_SIZE, buf, inputSize + RANDOMX_HASH_SIZE);
}
}