Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accepts works with entropy source. #105

Closed
AnFunctionArray opened this issue Jan 26, 2022 · 3 comments
Closed

Accepts works with entropy source. #105

AnFunctionArray opened this issue Jan 26, 2022 · 3 comments

Comments

@AnFunctionArray
Copy link

AnFunctionArray commented Jan 26, 2022

So I wanted to implement some randomness into the standard randomx algo and was surprised to find that I was able to skip the whole algo with some incredible hash speeds.

it's something like (in xmrig randomx.cpp):

	void randomx_calculate_hash_next(randomx_vm* machine, uint64_t (&tempHash)[8], const void* nextInput, size_t nextInputSize, void* output) {
		PROFILE_SCOPE(RandomX_hash);

		/*machine->resetRoundingMode();
		for (uint32_t chain = 0; chain < RandomX_CurrentConfig.ProgramCount - 1; ++chain) {
			machine->run(&tempHash);
			rx_blake2b_wrapper::run(tempHash, sizeof(tempHash), machine->getRegisterFile(), sizeof(randomx::RegisterFile));
		}
		machine->run(&tempHash);*/

		getentropy(tempHash, sizeof tempHash);

		// Finish current hash and fill the scratchpad for the next hash at the same time
		// rx_blake2b_wrapper::run(tempHash, sizeof(tempHash), nextInput, nextInputSize);
		machine->hashAndFill(output, tempHash);
	}

But if i connect to minexmr.com it says invalid share straight up.

Don't know if this exploit.

@SChernykh
Copy link
Owner

it says invalid share straight up
Well, of course. It's not an exploit.

@AnFunctionArray
Copy link
Author

AnFunctionArray commented Jan 26, 2022

That would be on minexmr - on p2pool it accepts it. But whatever not my issue - just reporting.

@SChernykh
Copy link
Owner

It accepts it because it uses the exact same code to check this "share". But other p2pool nodes will reject your shares and ban your node.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants