-
Notifications
You must be signed in to change notification settings - Fork 213
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
src|cmake: Fix some FromBytes
decoding issues, add more test cases
#253
Conversation
e9f60d1
to
eebf526
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Test all prefix values, not only 0-10.
eebf526
to
896e33c
Compare
FromBytes
for non-infinity zero only buffersFromBytes
decoding issues, add more test cases
FromBytes
decoding issues, add more test casesFromBytes
decoding issues, add more test cases
Okay, turned out that there are more "first byte values" where it should pass because the 5 lower bits of the first byte are also used as data. I adjusted the test and fixed an issue in the zero bytes check.. now it should have the same behavior like before the relic bug-fix which introduced the change of the behavior. But at the end i guess this should also be fixed in relic itself @dfaranha? Another thing i realized is that with this commit relic-toolkit/relic@1620a03 we get more invalid cases, see 1fa53dc which is required after that commit . I miss some background here to judge if all of the values in here
with zeroes appended should be decoded to valid G1 elements. Can either of you @mariano54 or @dfaranha share your thoughts? Also just for the record, this PR now bumps relic to relic-toolkit/relic@b7b2266. If someone has any objections let me know, i can then drop 1fa53dc and 896e33c. |
…0acd68ed9c88d7cd82ec5490ce4
Which is currently the latest `main`
896e33c
to
916e4de
Compare
Currently on holidays, but will catch-up tonight! |
I have not reviewed this yet |
ah i saw gene's review and thought it had gone through |
Sorry - however it did pass Guido's testing and it looked otherwise correct - which is why I approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…hia-Network#253) * test: Expand invalid G1/G2 element test cases Test all prefix values, not only 0-10. * util: Introduce `HasOnlyZeros` to check a `Bytes` object for zero bytes * elements: Don't accept zero only buffer with valid prefix in `FromBytes` * test: Drop cases which become invalid with relic commit 1620a03b388e50acd68ed9c88d7cd82ec5490ce4 * cmake: Pin relic to b7b2266a0e4ee6f628f61d3ab638f524a18b52f1 Which is currently the latest `main`
This is a (i think the proper) fix for #251 which basically has been introduced by a bug-fix in relic, see relic-toolkit/relic@c7177c8 and relic-toolkit/relic#206. Please also have a look here @dfaranha :)
a90d56a expands the test case to cover the issue detected in #251 and e9f60d1 is the actual fix.