Skip to content

Conversation

sashaodessa
Copy link

Description

This PR fixes a logical error in the squeeze_field_elements_with_sizes method of PoseidonSponge where the native field type case was incorrectly determined by comparing field characteristics instead of exact type matching.

Problem: The method used F::characteristic() == F2::characteristic() to determine if casting between fields was safe, which could lead to incorrect casts when different field types share the same characteristic.

Solution: Changed the logic to use TypeId::of::<F>() == TypeId::of::<F2>() for exact type matching, aligning with the existing squeeze_field_elements method.

@sashaodessa sashaodessa requested a review from a team as a code owner October 10, 2025 13:03
@sashaodessa sashaodessa requested review from Pratyush, mmagician and z-tech and removed request for a team October 10, 2025 13:03
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.

1 participant