fix: correct Poseidon2 KoalaBear partial rounds to 20 (security parameter) - #525
Open
mhmdrizzzki wants to merge 1 commit into
Open
fix: correct Poseidon2 KoalaBear partial rounds to 20 (security parameter)#525mhmdrizzzki wants to merge 1 commit into
mhmdrizzzki wants to merge 1 commit into
Conversation
…eter) Changes ROUNDS_P/NUM_INTERNAL_ROUNDS from 13 to 20 across all 4 layers: - crates/primitives/src/lib.rs: poseidon2_init() — ROUNDS_P 13->20 - crates/core/machine/.../poseidon2/mod.rs: kernel prover — 13->20 - crates/recursion/.../poseidon2_skinny/mod.rs: recursion skinny — 13->20 - crates/recursion/.../poseidon2_wide/mod.rs: recursion wide — 13->20 - crates/stark/src/kb31_poseidon2.rs: test reference ROUNDS_P — 13->20 Fixes ProjectZKM#524 Reference: Plonky3 poseidon2/src/round_numbers.rs line 40: (16, 3) => (8, 20) # KoalaBear 31-bit, width=16, alpha=3
Member
|
Thanks, we have this discussed internally for a while, we have the plan to do this upgrade in some branch. previously documented in 43185de |
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
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.
Summary
Changes
ROUNDS_P/NUM_INTERNAL_ROUNDSfrom 13 → 20 across all 4 Poseidon2 layers.Why
Per both upstream Plonky3 and the project's own fork (ProjectZKM/Plonky3), the correct partial rounds for KoalaBear (31-bit, width 16, alpha=3) is 20, not 13.
Reference:
poseidon2/src/round_numbers.rs:40:The project already provides 30 round constants (
RC_16_30) which implies the config was always intended for 8+20=28 rounds (plus 2 buffer).Files changed
crates/primitives/src/lib.rs—ROUNDS_Pinposeidon2_init()crates/core/machine/src/operations/poseidon2/mod.rs— kernel provercrates/recursion/core/src/chips/poseidon2_skinny/mod.rs— recursion skinnycrates/recursion/core/src/chips/poseidon2_wide/mod.rs— recursion widecrates/stark/src/kb31_poseidon2.rs— test reference (was self-referentially wrong)Fixes #524