Browse Source

remove unneeded tracking and checks (#55)

* remove unneeded tracking and checks

* remove unused error type
main
Srinath Setty 2 years ago
committed by GitHub
parent
commit
fab07689eb
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 21 deletions
  1. +0
    -2
      src/errors.rs
  2. +0
    -19
      src/r1cs.rs

+ 0
- 2
src/errors.rs

@ -12,8 +12,6 @@ pub enum NovaError {
InvalidInputLength, InvalidInputLength,
/// returned if the supplied witness is not of the right length /// returned if the supplied witness is not of the right length
InvalidWitnessLength, 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 /// returned if the supplied witness is not a satisfying witness to a given shape and instance
UnSat, UnSat,
/// returned when the supplied compressed commitment cannot be decompressed /// returned when the supplied compressed commitment cannot be decompressed

+ 0
- 19
src/r1cs.rs

@ -60,8 +60,6 @@ pub struct RelaxedR1CSInstance {
pub(crate) comm_E: Commitment<G>, pub(crate) comm_E: Commitment<G>,
pub(crate) X: Vec<G::Scalar>, pub(crate) X: Vec<G::Scalar>,
pub(crate) u: G::Scalar, pub(crate) u: G::Scalar,
Y_last: Vec<G::Scalar>, // output of the last instance that was folded
counter: usize, // the number of folds thus far
} }
impl<G: Group> R1CSGens<G> { impl<G: Group> R1CSGens<G> {
@ -470,8 +468,6 @@ impl RelaxedR1CSInstance {
comm_E, comm_E,
u: G::Scalar::zero(), u: G::Scalar::zero(),
X: vec![G::Scalar::zero(); S.num_io], 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()); (&self.X, &self.u, &self.comm_W.clone(), &self.comm_E.clone());
let (X2, comm_W_2) = (&U2.X, &U2.comm_W); 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 // weighted sum of X, comm_W, comm_E, and u
let X = X1 let X = X1
.par_iter() .par_iter()
@ -514,8 +497,6 @@ impl RelaxedR1CSInstance {
comm_E, comm_E,
X, X,
u, u,
Y_last: U2.X[U2.X.len() / 2..].to_owned(),
counter: self.counter + 1,
}) })
} }
} }

Loading…
Cancel
Save