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

Cleanup docs #153

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions crypto-primitives/src/merkle_tree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@
/// [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).
Expand Down Expand Up @@ -586,7 +586,9 @@
/// instead of
/// `num_leaves*(num_leaves.log2()-1)`
/// When verifying the proof, leaves hashes should be supplied in order, that is:
/// ```no_run
/// let ordered_leaves: Vec<_> = self.leaf_indexes.into_iter().map(|i| leaves[i]).collect();

Check failure on line 590 in crypto-primitives/src/merkle_tree/mod.rs

View workflow job for this annotation

GitHub Actions / Test (stable)

expected value, found module `self`

Check failure on line 590 in crypto-primitives/src/merkle_tree/mod.rs

View workflow job for this annotation

GitHub Actions / Test (stable)

cannot find value `leaves` in this scope
/// ```
pub fn generate_multi_proof(
&self,
indexes: impl IntoIterator<Item = usize>,
Expand Down
4 changes: 2 additions & 2 deletions crypto-primitives/src/snark/constraints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ pub trait SNARKGadget<F: PrimeField, ConstraintF: PrimeField, S: SNARK<F>> {

/// 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;
Expand Down
6 changes: 3 additions & 3 deletions crypto-primitives/src/sponge/constraints/absorb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ impl<F: PrimeField, A: AbsorbGadget<F>> AbsorbGadget<F> 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),+ ) => {
Expand All @@ -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)* ) => {
Expand Down
Loading