Skip to content

Commit

Permalink
chore: Ammend review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
CPerezz committed Oct 17, 2024
1 parent 9bcf84c commit 206984c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
39 changes: 21 additions & 18 deletions folding-schemes/src/folding/nova/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,25 +647,28 @@ where
// Nova does not support multi-instances folding
_other_instances: Option<Self::MultiCommittedInstanceWithWitness>,
) -> Result<(), Error> {
// Slice and separate between external inputs and frontend witness.
let (frontend_witness, external_inputs) =
if external_inputs.len() > self.F.external_inputs_len() {
(
// Full circom witness trace
Some(external_inputs[..].to_vec()),
// Extracted external inputs from circom trace
external_inputs[1 + self.F.state_len() * 2
..1 + self.F.state_len() * 2 + self.F.external_inputs_len()]
.to_vec(),
)
} else {
(None, external_inputs)
#[cfg(feature = "browser")]
{
// Slice and separate between external inputs and frontend witness.
let (frontend_witness, external_inputs) =
if external_inputs.len() > self.F.external_inputs_len() {
(
// Full circom witness trace
Some(external_inputs[..].to_vec()),
// Extracted external inputs from circom trace
external_inputs[1 + self.F.state_len() * 2
..1 + self.F.state_len() * 2 + self.F.external_inputs_len()]
.to_vec(),
)
} else {
(None, external_inputs)
};

// If we are in the browser-case (frontend_witness = Some(witness)) then we load the witness into the FCircuit.
if let Some(witness) = frontend_witness {
self.F.load_witness(witness)
};

// If we are in the browser-case (frontend_witness = Some(witness)) then we load the witness into the FCircuit.
if let Some(witness) = frontend_witness {
self.F.load_witness(witness)
};
}

// ensure that commitments are blinding if user has specified so.
if H && self.i >= C1::ScalarField::one() {
Expand Down
2 changes: 0 additions & 2 deletions folding-schemes/src/frontend/circom/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ impl<F: PrimeField> FCircuit<F> for CircomFCircuitBrowser<F> {
cs: ConstraintSystemRef<F>,
_i: usize,
z_i: Vec<FpVar<F>>,
// This in reality contains the `witness` passed from the `prove_step` call from the
// browser.
_external_inputs: Vec<FpVar<F>>,
) -> Result<Vec<FpVar<F>>, SynthesisError> {
// Since public inputs are already allocated variables, we will tell `circom-compat` to not re-allocate those
Expand Down

0 comments on commit 206984c

Please sign in to comment.