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

Fix missing subgroup check #62

Merged
merged 4 commits into from
Mar 4, 2024
Merged

Fix missing subgroup check #62

merged 4 commits into from
Mar 4, 2024

Conversation

nulltea
Copy link
Member

@nulltea nulltea commented Feb 23, 2024

Fixes:

  • missing subgroup checks for public keys and signature
  • missing y sign check

Details of y sign check implementation

  • In rotation circuit: y sign is deferred from pubkey compressed bytes
  • Signs are packed in 3 253bits integers and committed along with x coordinates using Poseidon hash
  • In Step circuit: y sign is calculated as y*2 > p and used to open Poseidon commitment, which finishes cross-circuit y sign check

Notes:

  • Not committing to y together with x is deliberate, as by doing so, one can introduce a possible DoS vector when the prover is permissionless (ref: V-SUC-VUL-004).

@nulltea nulltea requested a review from ec2 February 26, 2024 11:41
lightclient-circuits/src/sync_step_circuit.rs Outdated Show resolved Hide resolved
lightclient-circuits/src/sync_step_circuit.rs Show resolved Hide resolved
@nulltea nulltea merged commit e2a495e into main Mar 4, 2024
1 of 2 checks passed
@nulltea nulltea deleted the nulltea/missing_subgroup_check branch March 4, 2024 20:16
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.

2 participants