From 504840b30cd12a0eb40f31b1a9e40ef56b3844f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= <4142+huitseeker@users.noreply.github.com> Date: Wed, 10 Jan 2024 17:31:19 -0500 Subject: [PATCH] Fix docs (#249) * Refactor 'CircuitShape' references to 'R1CSWithArity' - Implemented terminology update: all occurrences of `CircuitShape` have been replaced with `R1CSWithArity` - Corrected method return descriptions to reflect changes in terminology - Amended related notes and comments to maintain consistency and clarity in the codebase. Leftover from https://github.com/lurk-lab/arecibo/pull/235 * Fix Supernova module documentation and code comments - Update comments for struct `PublicParams` in `mod.rs` to reflect the correct association with `R1CSWithArity`. - Alter codeblock tag in `Readme.md` from `ignore` to `text`. - Revise mathematical formula in `Readme.md` for the current iteration of $F$ by including brackets around `0` in the base case inputs. --- src/lib.rs | 4 ++-- src/supernova/Readme.md | 4 ++-- src/supernova/mod.rs | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9a0d0f195..6cc1d66d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -71,7 +71,7 @@ pub struct R1CSWithArity { impl SimpleDigestible for R1CSWithArity {} impl R1CSWithArity { - /// Create a new `CircuitShape` + /// Create a new `R1CSWithArity` pub fn new(r1cs_shape: R1CSShape, F_arity: usize) -> Self { Self { F_arity, @@ -79,7 +79,7 @@ impl R1CSWithArity { } } - /// Return the [CircuitShape]' digest. + /// Return the [R1CSWithArity]' digest. pub fn digest(&self) -> E::Scalar { let dc: DigestComputer<'_, ::Scalar, Self> = DigestComputer::new(self); dc.digest().expect("Failure in computing digest") diff --git a/src/supernova/Readme.md b/src/supernova/Readme.md index 6ccf9e056..82c69f101 100644 --- a/src/supernova/Readme.md +++ b/src/supernova/Readme.md @@ -76,7 +76,7 @@ At each step, the prover needs to: In pseudocode, `prove_step` looks something like: -```ignore +```text if i = 0 { U[] = [ΓΈ;l] @@ -189,7 +189,7 @@ The inputs of provided to the augmented step circuit $F'_j$ are: - **Secondary**: Always `None`, and interpreted as $\mathsf{pc}_i \equiv 0$, since there is only a single circuit. - $z_0 \in \mathbb{F}^a$: inputs for the first iteration of $F$ - $z_i \in \mathbb{F}^a$: inputs for the current iteration of $F$ - - **Base case**: Set to `None`, in which case it is allocated as $[0]$, and $z_0$ is used as $z_i$. + - **Base case**: Set to `None`, in which case it is allocated as $\[0\]$, and $z_0$ is used as $z_i$. - $U_i[\ ] \in \mathbb{R}'^\ell$: list of relaxed R1CS instances on the other curve - **Primary**: Since there is only a single circuit on the secondary curve, we have $\ell = 0$ and therefore $U_i[\ ]$ only contains a single `RelaxedR1CSInstance`. - **Secondary**: The list of input relaxed instances $U_i[\ ]$ is initialized by passing a slice `[Option>]`, one for each circuit on the primary curve. diff --git a/src/supernova/mod.rs b/src/supernova/mod.rs index 9a1c10cef..072037355 100644 --- a/src/supernova/mod.rs +++ b/src/supernova/mod.rs @@ -74,7 +74,7 @@ impl CircuitDigests { } } -/// A vector of [CircuitParams] corresponding to a set of [PublicParams] +/// A vector of [R1CSWithArity] adjoined to a set of [PublicParams] #[derive(Clone, Serialize, Deserialize)] #[serde(bound = "")] pub struct PublicParams @@ -299,7 +299,7 @@ where (circuit_shapes, aux_params) } - /// Create a [PublicParams] from a vector of raw [CircuitShape] and auxiliary params. + /// Create a [PublicParams] from a vector of raw [R1CSWithArity] and auxiliary params. pub fn from_parts(circuit_shapes: Vec>, aux_params: AuxParams) -> Self { let pp = Self { circuit_shapes, @@ -323,7 +323,7 @@ where pp } - /// Create a [PublicParams] from a vector of raw [CircuitShape] and auxiliary params. + /// Create a [PublicParams] from a vector of raw [R1CSWithArity] and auxiliary params. /// We don't check that the `aux_params.digest` is a valid digest for the created params. pub fn from_parts_unchecked( circuit_shapes: Vec>, @@ -346,7 +346,7 @@ where } /// Compute primary and secondary commitment keys sized to handle the largest of the circuits in the provided - /// `CircuitShape`. + /// `R1CSWithArity`. fn compute_primary_ck( circuit_params: &[R1CSWithArity], ck_hint1: &CommitmentKeyHint,