mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-11 16:41:28 +01:00
cleanup trivial (#63)
This commit is contained in:
23
src/lib.rs
23
src/lib.rs
@@ -247,29 +247,6 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A SNARK that proves the knowledge of a valid `RecursiveSNARK`
|
|
||||||
pub struct CompressedSNARKTrivial<G: Group> {
|
|
||||||
W: RelaxedR1CSWitness<G>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<G: Group> CompressedSNARKTrivial<G> {
|
|
||||||
/// Produces a proof of a instance given its satisfying witness `W`.
|
|
||||||
pub fn prove(W: &RelaxedR1CSWitness<G>) -> Result<CompressedSNARKTrivial<G>, NovaError> {
|
|
||||||
Ok(Self { W: W.clone() })
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Verifies the proof of a folded instance `U` given its shape `S` public parameters `gens`
|
|
||||||
pub fn verify(
|
|
||||||
&self,
|
|
||||||
gens: &R1CSGens<G>,
|
|
||||||
S: &R1CSShape<G>,
|
|
||||||
U: &RelaxedR1CSInstance<G>,
|
|
||||||
) -> Result<(), NovaError> {
|
|
||||||
// check that the witness is a valid witness to the folded instance `U`
|
|
||||||
S.is_sat_relaxed(gens, U, &self.W)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|||||||
Reference in New Issue
Block a user