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

what is the use of cn_slow_hash_prehashed here? #4537

Closed
calidion opened this issue Oct 9, 2018 · 6 comments
Closed

what is the use of cn_slow_hash_prehashed here? #4537

calidion opened this issue Oct 9, 2018 · 6 comments
Labels

Comments

@calidion
Copy link

calidion commented Oct 9, 2018

by searching cn_slow_hash_prehashed to know that it is only a definition.

eric@eric-laptop:~/Monero/monero$ grep cn_slow_hash_prehashed . -Rn
./src/crypto/hash.h:78:  inline void cn_slow_hash_prehashed(const void *data, std::size_t length, hash &hash, int variant = 0) {
@moneromooo-monero
Copy link
Collaborator

Is there a bug here ?

@calidion
Copy link
Author

calidion commented Oct 10, 2018

@moneromooo-monero

I am determining which function is compatible with the old cryptonight algorithm.
it seems cn_slow_hash doesn't compatible with the old cryptonight algorithm.

I have changed my code base from the original cryptonote to monero.
and tested cn_slow_hash with the following (variant, prehashed) pair:

0, 0,
0, 1,
1, 0,
1, 1

none of them worked for the old network.

@moneromooo-monero
Copy link
Collaborator

Ignore prehashed, always set it to 0. variant 0 is the original CN. 1 is what monero is using now. 2 is what monero will be using from v8.

See #4218

@calidion
Copy link
Author

@moneromooo-monero

Thanks.

I set the last two parameter to 0, 0 for cn_slow_hash,
but it still not work with the old network.

you can checkout code from https://github.com/vigcoin/coin

where master can not update while old branch can.

the only difference is the cn_slow_hash.

@calidion
Copy link
Author

@moneromooo-monero

by make clean and make again.
the new compiled works with the old network now.

Thank you very much.

@moneromooo-monero
Copy link
Collaborator

+invalid

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

No branches or pull requests

3 participants