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

[BUG] Poseidon sponge is doing an incorrect extra permutation in Absorbing & Squeezing mode #151

Open
pventuzelo opened this issue Sep 26, 2024 · 1 comment

Comments

@pventuzelo
Copy link

While testing if #150 was fixed, we found this new bug last month.

One permutation too many when squeezing 0 elements under certain conditions.

Executive Summary

In the squeeze_native_field_elements function of the implementation of the Poseidon sponge, if num_elements == 0, then we are going to permute once too often if we are in Absorbing mode (whatever next_absorb_index is), or if we are in Squeezing mode, with next_squeeze_index == self.parameters.rate.

This permutation should not arrive. Since we are squeezing 0 element, nothing should happen.

References

Poseidon Paper

@pventuzelo
Copy link
Author

This bug should be fixed in this PR: #148

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

No branches or pull requests

1 participant