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

Optimize poseidon implementation #10

Merged
merged 9 commits into from
May 23, 2023
Merged

Optimize poseidon implementation #10

merged 9 commits into from
May 23, 2023

Conversation

AllFi
Copy link

@AllFi AllFi commented Feb 27, 2023

An efficient implementation of the poseidon is presented in Supplementary Material B of https://eprint.iacr.org/2019/458.pdf.
This optimization can't be applied to circuit and works only for native implementation.

Implementation of matrix operations has been copied from https://github.com/filecoin-project/neptune/blob/master/src/matrix.rs. Neptune's implementation of poseidon requires mds to be a symmetric matrix that doesn't hold in our case. So the rest of poseidon algorithm has been implemented based on reference implementation from the original paper: https://extgit.iaik.tugraz.at/krypto/hadeshash/-/blob/master/code/poseidonperm_x3_64_24_optimized.sage.

New PoseidonParams can be deserialized from the current format. Additional fields will be precomputed during deserialization.

These updates don't change the crate interface so it is not necessary to modify other repositories (except for version updating).

@AllFi AllFi marked this pull request as ready for review March 7, 2023 08:03
@r0wdy1 r0wdy1 merged commit 17ba249 into master May 23, 2023
@EvgenKor EvgenKor deleted the feature/fast_poseidon branch February 2, 2024 06:42
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.

2 participants