mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-11 00:21:29 +01:00
remove unneeded tracking and checks (#55)
* remove unneeded tracking and checks * remove unused error type
This commit is contained in:
@@ -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
|
||||||
|
|||||||
19
src/r1cs.rs
19
src/r1cs.rs
@@ -60,8 +60,6 @@ pub struct RelaxedR1CSInstance<G: Group> {
|
|||||||
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<G: Group> RelaxedR1CSInstance<G> {
|
|||||||
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<G: Group> RelaxedR1CSInstance<G> {
|
|||||||
(&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<G: Group> RelaxedR1CSInstance<G> {
|
|||||||
comm_E,
|
comm_E,
|
||||||
X,
|
X,
|
||||||
u,
|
u,
|
||||||
Y_last: U2.X[U2.X.len() / 2..].to_owned(),
|
|
||||||
counter: self.counter + 1,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user