diff --git a/crypto-primitives/src/merkle_tree/mod.rs b/crypto-primitives/src/merkle_tree/mod.rs index 14b9671..efd4692 100644 --- a/crypto-primitives/src/merkle_tree/mod.rs +++ b/crypto-primitives/src/merkle_tree/mod.rs @@ -224,13 +224,13 @@ impl Path

{ /// [I]J L M /// ``` /// Suppose we want to prove I and J, then: -/// `leaf_indexes` is: [2,3] (indexes in Merkle Tree leaves vector) -/// `leaf_siblings_hashes`: [J,I] -/// `auth_paths_prefix_lenghts`: [0,2] -/// `auth_paths_suffixes`: [ [C,D], []] +/// `leaf_indexes` is: `[2,3]` (indexes in Merkle Tree leaves vector) +/// `leaf_siblings_hashes`: `[J,I]` +/// `auth_paths_prefix_lenghts`: `[0,2]` +/// `auth_paths_suffixes`: `[ [C,D], []]` /// We can reconstruct the paths incrementally: /// First, we reconstruct the first path. The prefix length is 0, hence we do not have any prefix encoding. -/// The path is thus [C,D]. +/// The path is thus `[C,D]`. /// Once the first path is verified, we can reconstruct the second path. /// The prefix length of 2 means that the path prefix will be `previous_path[:2] -> [C,D]`. /// Since the Merkle Tree branch is the same, the authentication path is the same (which means in this case that there is no suffix). @@ -586,7 +586,9 @@ impl MerkleTree

{ /// instead of /// `num_leaves*(num_leaves.log2()-1)` /// When verifying the proof, leaves hashes should be supplied in order, that is: + /// ```ignore /// let ordered_leaves: Vec<_> = self.leaf_indexes.into_iter().map(|i| leaves[i]).collect(); + /// ``` pub fn generate_multi_proof( &self, indexes: impl IntoIterator, diff --git a/crypto-primitives/src/snark/constraints.rs b/crypto-primitives/src/snark/constraints.rs index 92e16b9..fca144d 100644 --- a/crypto-primitives/src/snark/constraints.rs +++ b/crypto-primitives/src/snark/constraints.rs @@ -30,9 +30,9 @@ pub trait SNARKGadget> { /// Information about the R1CS constraints required to check proofs relative /// a given verification key. In the context of a LPCP-based pairing-based SNARK - /// like that of [[Groth16]](https://eprint.iacr.org/2016/260), + /// like that of [Groth16](https://eprint.iacr.org/2016/260), /// this is independent of the R1CS matrices, - /// whereas for more "complex" SNARKs like [[Marlin]](https://eprint.iacr.org/2019/1047), + /// whereas for more "complex" SNARKs like [Marlin](https://eprint.iacr.org/2019/1047), /// this can encode information about the highest degree of polynomials /// required to verify proofs. type VerifierSize: PartialOrd + Clone + fmt::Debug; diff --git a/crypto-primitives/src/sponge/constraints/absorb.rs b/crypto-primitives/src/sponge/constraints/absorb.rs index bb3abb4..3abd7a2 100644 --- a/crypto-primitives/src/sponge/constraints/absorb.rs +++ b/crypto-primitives/src/sponge/constraints/absorb.rs @@ -213,9 +213,9 @@ impl> AbsorbGadget for &A { } } -/// Individually absorbs each element in a comma-separated list of [`Absorbable`]s into a sponge. +/// Individually absorbs each element in a comma-separated list of [`AbsorbGadget`]s into a sponge. /// Format is `absorb!(s, a_0, a_1, ..., a_n)`, where `s` is a mutable reference to a sponge -/// and each `a_i` implements `AbsorbableVar`. +/// and each `a_i` implements [`AbsorbGadget`]. #[macro_export] macro_rules! absorb_gadget { ($sponge:expr, $($absorbable:expr),+ ) => { @@ -225,7 +225,7 @@ macro_rules! absorb_gadget { }; } -/// Quickly convert a list of different [`Absorbable`]s into sponge field elements. +/// Quickly convert a list of different [`AbsorbGadget`]s into sponge field elements. #[macro_export] macro_rules! collect_sponge_field_elements_gadget { ($head:expr $(, $tail:expr)* ) => {