-
Notifications
You must be signed in to change notification settings - Fork 251
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
Fix tests for Modulus plus one div four #552
Merged
Pratyush
merged 4 commits into
arkworks-rs:master
from
rubdos:modulus-plus-one-div-four-fix
Dec 21, 2022
Merged
Fix tests for Modulus plus one div four #552
Pratyush
merged 4 commits into
arkworks-rs:master
from
rubdos:modulus-plus-one-div-four-fix
Dec 21, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rubdos
requested review from
Pratyush,
mmagician and
weikengchen
and removed request for
a team
December 20, 2022 18:27
When (modulus + 1) / 4 is a limb shorter than the modulus, the comparison failed because of trailing zeroes.
rubdos
force-pushed
the
modulus-plus-one-div-four-fix
branch
from
December 20, 2022 18:28
8ea9226
to
a453241
Compare
Pratyush
reviewed
Dec 20, 2022
Pratyush
approved these changes
Dec 20, 2022
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.
Great, thanks for the fix!
rubdos
commented
Dec 20, 2022
Pratyush
reviewed
Dec 20, 2022
Pratyush
changed the title
Modulus plus one div four fix
Fix tests for Modulus plus one div four
Dec 21, 2022
andrewmilson
added a commit
to andrewmilson/algebra
that referenced
this pull request
Jan 1, 2023
* upstream/master: (29 commits) Fix some clippy lints (arkworks-rs#570) Correct tag name & complete command suggestion (arkworks-rs#569) Open a "release-PR" against a `releases` branch (arkworks-rs#566) Allow to overwrite default impl of `msm` in TwistedEdwards form (arkworks-rs#567) Remove poly-benches. (arkworks-rs#558) DO NOT MERGE YET. Release 0.4 (arkworks-rs#512) otherwise downstream users that have not migrated will not see warning (arkworks-rs#563) use `into_bigint()` in `Debug` for `Fp<P, N>` (arkworks-rs#562) Add `frobenius_map_in_place` (arkworks-rs#557) Fix test_sw_properties for some cofactor groups (arkworks-rs#555) Move h2c tests to test-templates (arkworks-rs#554) impl `CanonicalSerialize/Deserialize` for `BigUint` (arkworks-rs#551) Fix MontFp issue in fields with 64 * k bits (arkworks-rs#550) Fix tests for Modulus plus one div four (arkworks-rs#552) fix (arkworks-rs#547) Rename all `*Parameters` to `*Config` (arkworks-rs#545) Fix doc-comment on `SWUMap` and CamelCase `(CO)DOMAIN` Small cleanups in hash-to-curve (arkworks-rs#544) Allow to overwrite the default implementation of `msm` (arkworks-rs#528) Move `multi_miller_loop` and `final_exponentiation` into `BW6Config` (arkworks-rs#542) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In the field tests, when (modulus + 1) / 4 is a limb shorter than the modulus, the comparison failed because of trailing zeroes.
This fix is a bit ugly, but works for the curve that I'm implementing. I'm not sure what would be cleaner, suggestions welcome.
BigUint::from()
would've been a lot cleaner, but it takes no&[u64]
; how is that generally resolved in Arkworks?What kind of unit test would you want? I intend to submit the curve I mention above when I'm sure I can show nothing-up-my-sleeves. FWIW, the kind of curves that trigger this condition, are curves that are slightly bigger than a nice round n*64 bits in length; e.g. curves that embed existing 256-bit curves.
Linked to GitHub issue with discussion and accepted design OR havean explanation in the PR that describes this work.Pending
section inCHANGELOG.md
Files changed
in the GitHub PR explorer