-
Notifications
You must be signed in to change notification settings - Fork 133
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
Refactor Nullifier methods to use safer MerkleMapWitness operations #1715
Conversation
e913ae7
to
a7a7e47
Compare
computeRootAndKeyV2
computeRootAndKeyV2
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.
Wouldn't it cause less code duplication to only deprecate the individual methods that use computeRootAndKey?
Many people might not even use those methods so they can just continue to use Nullifier without disruption
So I'm saying, I don't see why we have to add another version of the class in this case |
44c3664
to
1d3c50b
Compare
computeRootAndKeyV2
Yeah, that was my mistake. Changed the PR to this approach instead! |
…thods in favor of V2 versions feat(nullifier): add isUnusedV2, assertUnusedV2, and setUsedV2 methods that use the safer MerkleMapWitness.computeRootAndKeyV2 docs(nullifier): add deprecation notices to isUnused, assertUnused, and setUsed methods, and update examples to use V2 versions The original methods used the deprecated MerkleMapWitness.computeRootAndKey which may be vulnerable to hash collisions in key indices. The new V2 methods utilize the safer MerkleMapWitness.computeRootAndKeyV2 to mitigate this issue and improve the security of the nullifier operations.
The nullifier methods `assertUnused` and `setUsed` have been updated to their V2 counterparts `assertUnusedV2` and `setUsedV2` respectively. This change is made to use the latest versions of these methods which likely include performance improvements, bug fixes, or additional functionality compared to the previous versions.
The new methods `isUnusedV2()`, `assertUnusedV2()`, and `setUsedV2()` have been introduced to provide improved functionality for nullifier operations. BREAKING CHANGE: deprecate Nullifier.isUnused(), Nullifier.assertUnused(), and Nullifier.setUsed() methods The existing `Nullifier.isUnused()`, `Nullifier.assertUnused()`, and `Nullifier.setUsed()` methods have been deprecated in favor of the new V2 methods. These deprecated methods will be removed in a future release. Please update your code to use the new V2 methods instead.
6f532d1
to
fb1e4fb
Compare
No description provided.