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

feat: upgrade manta-crypto abstractions for new circuits #176

Merged
merged 8 commits into from
Jul 28, 2022

Conversation

bhgomes
Copy link
Contributor

@bhgomes bhgomes commented Jul 18, 2022

  • Upgrade Derived allocation mode to arbitrary type flags
  • Split out the accumulator model trait into a Types trait
  • Add ItemHashFunction for explicit "leaf hash" constructions for general accumulators (with ItemHashAccumulatorModel and ItemHashAccumulator wrappers)
  • Move allocation of MembershipProof to Derived mode
  • Add assert_equal to PartialEq to lift efficient assertion implementations to the AssertEq trait
  • Add NonNative marker trait to allow distinguishing () from non-native compilers (this allows (): Has<T>)
  • Add Zero and One traits
  • Add more variable allocation and PartialEq implementations for compound types
  • Add helper alias types for encryption
  • Add CheckedAdd and CheckedSub traits to numeric utilities
  • Add all_unequal utility function

Before we can merge this PR, please make sure that all the following items have been checked off:

  • Linked to an issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Added one line describing your change in CHANGELOG.md and added the appropriate changelog label to the PR.
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Checked that changes and commits conform to the standards outlined in CONTRIBUTING.md.

@bhgomes bhgomes marked this pull request as ready for review July 19, 2022 14:48
@bhgomes bhgomes added this to the v0.6.0 milestone Jul 19, 2022
@bhgomes bhgomes added changelog:added Changelog: add these changes to the `added` section of the changelog A-cryptography Area: Issues and PRs related to Cryptography A-design Area: Design of Libraries and APIs labels Jul 19, 2022
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
@bhgomes bhgomes requested a review from SupremoUGH July 26, 2022 14:48
SupremoUGH
SupremoUGH previously approved these changes Jul 26, 2022
Copy link
Contributor

@BoyuanFeng BoyuanFeng left a comment

Choose a reason for hiding this comment

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

Thanks for this great PR! Two minor comments:

manta-crypto/src/eclair/alloc.rs Outdated Show resolved Hide resolved
manta-util/src/num.rs Outdated Show resolved Hide resolved
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Signed-off-by: Brandon H. Gomes <bhgomes@pm.me>
Copy link
Contributor

@SupremoUGH SupremoUGH left a comment

Choose a reason for hiding this comment

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

Everything seems alright since the last review. Just one question to see if I understand correctly what's going on in the last commit. Is it that you are now required to explicitly mention the generic lifetime (even if you don't actually use it, hence the underscore) because of the new nightly released, and no actual change to the code happened?

@bhgomes
Copy link
Contributor Author

bhgomes commented Jul 28, 2022

@SupremoUGH Everything seems alright since the last review. Just one question to see if I understand correctly what's going on in the last commit. Is it that you are now required to explicitly mention the generic lifetime (even if you don't actually use it, hence the underscore) because of the new nightly released, and no actual change to the code happened?

Yeah, it seems the current version of nightly Rust requires explicit lifetimes in some places where it used to be implicit. Not sure why this change has been introduced though, but we had to patch it here.

@bhgomes bhgomes merged commit 849a9bd into main Jul 28, 2022
@bhgomes bhgomes deleted the feat/upgrade-crypto branch July 28, 2022 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cryptography Area: Issues and PRs related to Cryptography A-design Area: Design of Libraries and APIs changelog:added Changelog: add these changes to the `added` section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants