Skip to content

Commit

Permalink
Fix docs (#249)
Browse files Browse the repository at this point in the history
* 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 argumentcomputer/arecibo#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.
  • Loading branch information
huitseeker committed Jan 11, 2024
1 parent 8a0cd72 commit 7d58b45
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ pub struct R1CSWithArity<E: Engine> {
impl<E: Engine> SimpleDigestible for R1CSWithArity<E> {}

impl<E: Engine> R1CSWithArity<E> {
/// Create a new `CircuitShape`
/// Create a new `R1CSWithArity`
pub fn new(r1cs_shape: R1CSShape<E>, F_arity: usize) -> Self {
Self {
F_arity,
r1cs_shape,
}
}

/// Return the [CircuitShape]' digest.
/// Return the [R1CSWithArity]' digest.
pub fn digest(&self) -> E::Scalar {
let dc: DigestComputer<'_, <E as Engine>::Scalar, R1CSWithArity<E>> = DigestComputer::new(self);
dc.digest().expect("Failure in computing digest")
Expand Down
4 changes: 2 additions & 2 deletions src/supernova/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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<RelaxedR1CSInstance<G>>]`, one for each circuit on the primary curve.
Expand Down
8 changes: 4 additions & 4 deletions src/supernova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<E: Engine> CircuitDigests<E> {
}
}

/// 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<E1, E2, C1, C2>
Expand Down Expand Up @@ -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<R1CSWithArity<E1>>, aux_params: AuxParams<E1, E2>) -> Self {
let pp = PublicParams {
circuit_shapes,
Expand All @@ -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<R1CSWithArity<E1>>,
Expand All @@ -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<E1>],
ck_hint1: &CommitmentKeyHint<E1>,
Expand Down

0 comments on commit 7d58b45

Please sign in to comment.