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

unit_tests: use valid key images, pub keys, etc #4186

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

moneromooo-monero
Copy link
Collaborator

No description provided.

@danrmiller
Copy link
Contributor

@moneromooo-monero
Copy link
Collaborator Author

Those are the ones that are dependent on the exact determinism of the PRNG, and master has a patch which changes the generation of 32 byte values to remove a slight bias. The tests are fixed in my patch to change the RNG to use libsodium. If it doesn't go in, I'll split the tests part off and PR it.

@moneromooo-monero
Copy link
Collaborator Author

aka, fixed if you also apply #4159.

@luigi1111 luigi1111 merged commit c8226ad into monero-project:master Aug 15, 2018
luigi1111 added a commit that referenced this pull request Aug 15, 2018
c8226ad unit_tests: use valid key images, pub keys, etc (moneromooo-monero)
crypto::chacha_key chacha_key;
memcpy(&chacha_key, key, CHACHA_KEY_SIZE);
uint64_t password = crypto::rand<uint64_t>();
crypto::generate_chacha_key(std::string((const char*)&password, sizeof(password)), chacha_key);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

appears to be missing the number of KDF rounds which breaks test

@MiWCryptoCurrency
Copy link

Is there something wrong with the test in ringdb.cpp:50?
It appears to be missing the number of kdf rounds, im getting:

monero/tests/unit_tests/ringdb.cpp: In function ‘crypto::chacha_key generate_chacha_key()’:
monero/tests/unit_tests/ringdb.cpp:50:96: error: no matching function for call to ‘generate_chacha_key(std::__cxx11::string, crypto::chacha_key&)’
crypto::generate_chacha_key(std::string((const char*)&password, sizeof(password)), chacha_key);

monero/src/crypto/chacha.h:90:15: note: candidate: ‘void crypto::generate_chacha_key(std::__cxx11::string, crypto::chacha_key&, uint64_t)’
inline void generate_chacha_key(std::string password, chacha_key& key, uint64_t kdf_rounds) {
^~~~~~~~~~~~~~~~~~~
monero/src/crypto/chacha.h:90:15: note: candidate expects 3 arguments, 2 provided

@MiWCryptoCurrency
Copy link

Seem the change to add the KDF param was added in PR #4103
Need to modify the test to add the KDF param -- this comes from wallet2.h, right?

@stoffu
Copy link
Contributor

stoffu commented Aug 16, 2018

Thanks for reporting, #4272

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

Successfully merging this pull request may close these issues.

5 participants