-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: Poseidon2 implementation and availabe as Merkle Hash #708
Conversation
@@ -52,6 +54,36 @@ pub type RescueLightWeightMerkleTree<F> = LightWeightMerkleTree<F, RescueHash<F> | |||
/// Example instantiation of a SparseMerkleTree indexed by I | |||
pub type RescueSparseMerkleTree<I, F> = UniversalMerkleTree<F, RescueHash<F>, I, 3, F>; | |||
|
|||
// TODO: (alex) move this compression to CRHF and wrap with better API? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree that we should have a CRHF impl (and maybe sponge as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, let's add in a separate PR. This is already getting big
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM with some comments.
- Should we also have a native benchmark?
- Circuit impl could be in a separate PR.
Benchmark
Across all 3 instances, |
closes: #704
When we merge, I'd like to merge with commits (leave intermediate steps in the git history) if possible, as I try to make each commit self-contained in scope.
This PR:
struct Poseidon2
and its permutation::permute()
andpermute_mut()
trait Poseidon2Params
whose generic parameter is much cleaner than plonky3, while sufficient for our purposesposeidon2/constants/
and add test vectors (generated by reference impl byzkhash
)HasherAlgorithm
forPoseidon2
so that it can be used in Merkle tree as the hash function candidateBefore we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
CHANGELOG.md
of touched crates.Files changed
in the GitHub PR explorer