Skip to content

Commit

Permalink
chore: adapt to upstream Nova changes
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed Jun 26, 2023
1 parent 73c9d83 commit 9b8f7d1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 20 additions & 12 deletions src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,17 +291,25 @@ impl<'a: 'b, 'b, C: Coprocessor<S1>> Proof<'a, C> {

assert!(cs.is_satisfied());
}

let res = RecursiveSNARK::prove_step(
&pp.pp,
recursive_snark,
circuit_primary.clone(),
circuit_secondary.clone(),
z0_primary.clone(),
z0_secondary.clone(),
);
assert!(res.is_ok());
recursive_snark = Some(res?);
let mut r_snark = recursive_snark.unwrap_or_else(|| {
RecursiveSNARK::new(
&pp.pp,
circuit_primary,
&circuit_secondary,
z0_primary.clone(),
z0_secondary.clone(),
)
});
r_snark
.prove_step(
&pp.pp,
circuit_primary,
&circuit_secondary,
z0_primary.clone(),
z0_secondary.clone(),
)
.expect("failure to prove Nova step");
recursive_snark = Some(r_snark);
}

Ok(Self::Recursive(Box::new(recursive_snark.unwrap())))
Expand Down Expand Up @@ -339,7 +347,7 @@ impl<'a: 'b, 'b, C: Coprocessor<S1>> Proof<'a, C> {
let zi_secondary = z0_secondary.clone();

let (zi_primary_verified, zi_secondary_verified) = match self {
Self::Recursive(p) => p.verify(&pp.pp, num_steps, z0_primary, z0_secondary),
Self::Recursive(p) => p.verify(&pp.pp, num_steps, &z0_primary, &z0_secondary),
Self::Compressed(p) => p.verify(&pp.vk, num_steps, z0_primary, z0_secondary),
}?;

Expand Down

0 comments on commit 9b8f7d1

Please sign in to comment.