-
Notifications
You must be signed in to change notification settings - Fork 204
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
test: clean up templates and add interop for poseidon2 babybear against plonky3 impl #661
Conversation
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.
Pull Request Overview
This PR cleans up template code and updates test parameters while adding interop support for the Poseidon2 babybear implementation against Plonky3. Key changes include:
- Adding a new interop test (plonky3_interop_test.go) that reads CSV test vectors.
- Updating permutation parameters and test loops (using range iteration) in babybear, koalabear, and goldilocks test files.
- Refining generator template logic by introducing a new DiagInternal field and adjusting parameter assignments.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
File | Description |
---|---|
field/babybear/poseidon2/plonky3_interop_test.go | Adds interop test for Poseidon2 babybear with CSV-based test vectors. |
field/babybear/poseidon2/poseidon2_test.go | Updates permutation parameters, error messages, and loop iterations. |
field/goldilocks/poseidon2/poseidon2_test.go | Adjusts test parameters and uses range-based loops for improved readability. |
field/generator/generator_poseidon2.go | Refactors parameter setup using a switch and new Params field. |
field/koalabear/poseidon2/poseidon2_test.go | Updates test parameters and loop constructions. |
field/babybear/poseidon2/hash.go | Updates parameter values and refines comments for clarity. |
field/goldilocks/poseidon2/hash.go | Reworks diag arrays as slices and updates related comments. |
field/koalabear/poseidon2/hash.go | Updates diag arrays and comments to reflect the new parameter values. |
field/generator/asm/amd64/build.go | Introduces DiagInternal in the Poseidon2Parameters struct. |
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.
looks good to me! it matches plonky3/horizen and code generation is cleaner :)
I ran the sage script from Hoizen and and it output the same constants you have in this PR. So we can also cross check koala bear. Here is the corresponding rust file: https://gist.github.com/yelhousni/4ebb017ed55425357c188be3a11b5a64
No description provided.