mirror of
https://github.com/wownero/RandomWOW.git
synced 2026-10-17 23:41:36 +02:00
Add a missing function to calculate a batch of hashes
Add a test for batch calculation
This commit is contained in:
@@ -380,4 +380,14 @@ extern "C" {
|
||||
blake2b(machine->tempHash, sizeof(machine->tempHash), nextInput, nextInputSize, nullptr, 0);
|
||||
machine->hashAndFill(output, RANDOMX_HASH_SIZE, machine->tempHash);
|
||||
}
|
||||
|
||||
void randomx_calculate_hash_last(randomx_vm* machine, void* output) {
|
||||
machine->resetRoundingMode();
|
||||
for (int chain = 0; chain < RANDOMX_PROGRAM_COUNT - 1; ++chain) {
|
||||
machine->run(machine->tempHash);
|
||||
blake2b(machine->tempHash, sizeof(machine->tempHash), machine->getRegisterFile(), sizeof(randomx::RegisterFile), nullptr, 0);
|
||||
}
|
||||
machine->run(machine->tempHash);
|
||||
machine->getFinalResult(output, RANDOMX_HASH_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user