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

Perf: Poseidon2 GKR circuit #628

Merged
merged 29 commits into from
Feb 13, 2025
Merged

Perf: Poseidon2 GKR circuit #628

merged 29 commits into from
Feb 13, 2025

Conversation

Tabaie
Copy link
Contributor

@Tabaie Tabaie commented Feb 4, 2025

Poseidon2 has an SBox of degree 17. Just like how it is more efficient to compute x^17 as (x^4)^4 x, with 7 multiplications instead of 16, it is more efficient (in terms of verifier constraints) to construct the circuit using three gates of degrees 1, 4, and 5, instead of one gate of degree 17.
Doing x^2^2^2^2 x got a worse experimental result.

@Tabaie Tabaie marked this pull request as ready for review February 5, 2025 23:10
Copy link
Collaborator

@ivokub ivokub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I added a few comments, but they are mostly about style etc. Implementation seems correct.

See if the comments make sense

ecc/bls12-377/fr/gkr/gkr.go Show resolved Hide resolved
ecc/bls12-377/fr/gkr/gkr.go Show resolved Hide resolved
ecc/bls12-377/fr/gkr/gkr.go Show resolved Hide resolved
ecc/bls12-377/fr/gkr/gkr.go Show resolved Hide resolved
ecc/bls12-377/fr/poseidon2/poseidon2.go Show resolved Hide resolved
ecc/bls12-377/fr/poseidon2/hash.go Outdated Show resolved Hide resolved
ecc/bls12-377/fr/poseidon2/poseidon2.go Outdated Show resolved Hide resolved
ecc/bls12-377/fr/poseidon2/gkrgates/gkrgates.go Outdated Show resolved Hide resolved
@Tabaie Tabaie merged commit 7c56ee0 into master Feb 13, 2025
5 checks passed
@Tabaie Tabaie deleted the perf/gkr-poseidon2-breakup-sbox branch February 13, 2025 05:46
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.

3 participants