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.
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).