From d494f79a43f37b7a947de934703382aa963cb4e6 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 3df983341..5e0f9f0f9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,7 +63,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, @@ -71,7 +71,7 @@ impl R1CSWithArity { } } - /// Return the [CircuitShape]' digest. + /// Return the [R1CSWithArity]' digest. pub fn digest(&self) -> E::Scalar { let dc: DigestComputer<'_, ::Scalar, R1CSWithArity> = DigestComputer::new(self); dc.digest().expect("Failure in computing digest") diff --git a/src/supernova/Readme.md b/src/supernova/Readme.md index deb738326..11b43d6e1 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 5dbcf36e2..8c3313fb6 100644 --- a/src/supernova/mod.rs +++ b/src/supernova/mod.rs @@ -71,7 +71,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 @@ -288,7 +288,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 = PublicParams { circuit_shapes, @@ -312,7 +312,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>, @@ -335,7 +335,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,