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

Custom fields validation fix #429

Merged
merged 6 commits into from Mar 14, 2022
Merged

Conversation

ptagl
Copy link
Collaborator

@ptagl ptagl commented Dec 30, 2021

This PR contains a fix for the custom fields management. In particular, the validation function was using the wrong bit endianness to check custom fields against the configuration (bit length) specified during sidechain creation.

The validation is performed by checking that a field element doesn't use more bits than declared during sidechain creation. The function performing such validation was handling bits with wrong endianness.
@ptagl ptagl requested review from alsala and i-Alex December 30, 2021 09:59
src/util.cpp Outdated Show resolved Hide resolved
src/gtest/test_libzendoo.cpp Show resolved Hide resolved
This has been done to increase compatibility and avoid using a built-in function available only on specific architecture.
@ptagl ptagl marked this pull request as ready for review January 10, 2022 13:46
src/gtest/test_libzendoo.cpp Outdated Show resolved Hide resolved
src/gtest/test_libzendoo.cpp Show resolved Hide resolved
src/gtest/test_libzendoo.cpp Show resolved Hide resolved
Also added a comment to explain the reason behind the implementation of the TestRandomCustomFieldGeneration unit test.
Also added a check to TestGetBytesFromBits for negative values.
@cronicc cronicc merged commit 3d540f9 into development Mar 14, 2022
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.

None yet

6 participants