-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Expose index and leaf element of Merkle proof. Since MerkleNode is a private type, users cannot pattern match to extract a MerkleNode::Leaf, so this is the only way to get the leaf elemenet of a Merkle proof. This is also, therefore, the only way to verify that a Merkle proof proves inclusion of the desired element, since `verify` doesn't check this. (Technically you can also use `remember`, but that includes side-effects that may be undesirable.) * Make serde usable for MerkleTree types The Merkle trees are ususally instantiated with cryptographic types, e.g. field elements, which do not implement serde traits. This commit changes the bound on the derived serde impls for Merkle tree types to require ark_serialize impls on the element types and uses #[serde(with)] to serialize these elements using ark_serialize. We also add an instantiation of the Rescue hash scheme for field elements as the _index_ type, since the BigUint instantiation just coverts to field elements anyways, but BigUint does not implement serde _or_ ark_serialize, while field elements do. * Rename 'field_elem' serializer to 'canonical', since it's more general
- Loading branch information
Showing
8 changed files
with
124 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters