From fab07689ebdc0ca33eb4890d7c751fc905525861 Mon Sep 17 00:00:00 2001 From: Srinath Setty Date: Fri, 13 May 2022 14:50:42 +0530 Subject: [PATCH] remove unneeded tracking and checks (#55) * remove unneeded tracking and checks * remove unused error type --- src/errors.rs | 2 -- src/r1cs.rs | 19 ------------------- 2 files changed, 21 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 80f3ef9..7038121 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -12,8 +12,6 @@ pub enum NovaError { InvalidInputLength, /// returned if the supplied witness is not of the right length InvalidWitnessLength, - /// returned if the supplied instance input does not match the previous instance output - InputOutputMismatch, /// returned if the supplied witness is not a satisfying witness to a given shape and instance UnSat, /// returned when the supplied compressed commitment cannot be decompressed diff --git a/src/r1cs.rs b/src/r1cs.rs index 7894337..742b613 100644 --- a/src/r1cs.rs +++ b/src/r1cs.rs @@ -60,8 +60,6 @@ pub struct RelaxedR1CSInstance { pub(crate) comm_E: Commitment, pub(crate) X: Vec, pub(crate) u: G::Scalar, - Y_last: Vec, // output of the last instance that was folded - counter: usize, // the number of folds thus far } impl R1CSGens { @@ -470,8 +468,6 @@ impl RelaxedR1CSInstance { comm_E, u: G::Scalar::zero(), X: vec![G::Scalar::zero(); S.num_io], - Y_last: vec![G::Scalar::zero(); S.num_io / 2], - counter: 0, } } @@ -486,19 +482,6 @@ impl RelaxedR1CSInstance { (&self.X, &self.u, &self.comm_W.clone(), &self.comm_E.clone()); let (X2, comm_W_2) = (&U2.X, &U2.comm_W); - // check if the input of the incoming instance matches the output - // of the incremental computation thus far if counter > 0 - if self.counter > 0 { - if self.Y_last.len() != U2.X.len() / 2 { - return Err(NovaError::InvalidInputLength); - } - for i in 0..self.Y_last.len() { - if self.Y_last[i] != U2.X[i] { - return Err(NovaError::InputOutputMismatch); - } - } - } - // weighted sum of X, comm_W, comm_E, and u let X = X1 .par_iter() @@ -514,8 +497,6 @@ impl RelaxedR1CSInstance { comm_E, X, u, - Y_last: U2.X[U2.X.len() / 2..].to_owned(), - counter: self.counter + 1, }) } }