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

Incremental Merkle Tree Implementation #1

Merged
merged 8 commits into from
Aug 23, 2021
Merged

Conversation

stechu
Copy link
Owner

@stechu stechu commented Aug 20, 2021

This PR implements an Incremental Merkle Tree:

  • IMT implementation
  • Test with pedersen, poseidon, etc
  • Test in constraint system

/// Return true iff the given index on its current level represents a left child
#[inline]
fn is_left_child(index_on_level: usize) -> bool {
index_on_level % 2 == 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiler will optimize this to index_on_level & 1 == 0 right ?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

@stechu stechu merged commit 5994e66 into main Aug 23, 2021
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