-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Update EIP-2537: Rephrased subgroup check part #8456
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
678c808
Create fast_subgroup_checks.md
asanso aba2686
Update eip-2537.md
asanso 356eb84
eip2537: clarify subgroup errors
mratsim 5832c53
Update assets/eip-2537/fast_subgroup_checks.md
asanso c5ee2ef
Merge pull request #1 from mratsim/eip-2537-subgroup-clarify
asanso File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # Fast subgroup checks used by EIP-2537 | ||
|
|
||
| ### Fields and Groups | ||
|
|
||
| Field Fp is defined as the finite field of size `p` with elements represented as integers between 0 and p-1 (both inclusive). | ||
|
|
||
| Field Fp2 is defined as `Fp[X]/(X^2-nr2)` with elements `el = c0 + c1 * v`, where `v` is the formal square root of `nr2` represented as integer pairs `(c0,c1)`. | ||
|
|
||
| Group G1 is defined as a set of Fp pairs (points) `(x,y)` such that either `(x,y)` is `(0,0)` or `x,y` satisfy the curve Fp equation. | ||
|
|
||
| Group G2 is defined as a set of Fp2 pairs (points) `(x',y')` such that either `(x,y)` is `(0,0)` or `(x',y')` satisfy the curve Fp2 equation. | ||
|
|
||
| ## Curve parameters | ||
|
|
||
| The set of parameters used by fast subgroup checks: | ||
|
|
||
| ``` | ||
| |x| (seed) = 15132376222941642752 | ||
| x is negative = true | ||
| Cube root of unity modulo p - Beta = 793479390729215512621379701633421447060886740281060493010456487427281649075476305620758731620350 | ||
| r = 4002409555221667392624310435006688643935503118305586438271171395842971157480381377015405980053539358417135540939437 * v | ||
| s = 2973677408986561043442465346520108879172042883009249989176415018091420807192182638567116318576472649347015917690530 + 1028732146235106349975324479215795277384839936929757896155643118032610843298655225875571310552543014690878354869257 * v | ||
| ``` | ||
|
|
||
| ## Helper function to compute the conjugate over Fp2 - `conjugate` | ||
|
|
||
| `conjugate(c0 + c1 * v) := c0 - c1 * v` | ||
|
|
||
| ## G1 endomorphism - `phi` | ||
|
|
||
| The endomorphism `phi` transform the point from `(x,y)` to `(Beta*x,y)` where `Beta` is a precomputed cube root of unity modulo `p` given above in parameters sections: | ||
|
|
||
| `phi((x,y)) := (Beta*x,y)` | ||
|
|
||
| ## G2 endomorphism - `psi` | ||
|
|
||
| `psi((x,y)) := (conjugate(x)*r,conjugate(y)*s)` | ||
|
|
||
| # The G1 case | ||
|
|
||
| Before accepting a point `P` as input that purports to be a member of G1 subject the input to the following endomorphism test: `phi(P) + x^2*P = 0` | ||
|
|
||
|
|
||
| # The G2 case | ||
|
|
||
| Before accepting a point `P` as input that purports to be a member of G2 subject the input to the following endomorphism test: `psi(P) + x*P = 0` | ||
|
|
||
| # Resources | ||
|
|
||
| * https://eprint.iacr.org/2021/1130.pdf, sec.4 | ||
| * https://eprint.iacr.org/2022/352.pdf, sec. 4.2 |
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.
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.
@asanso this link won't work in the EIP. I suggest either removing or uploading the full PDF as an asset in the repo.