Skip to content

Commit

Permalink
chore: Update nova, adapt to upstream changes (#499)
Browse files Browse the repository at this point in the history
Updates to version 0.22

See
- microsoft/Nova#163
  • Loading branch information
huitseeker authored Jul 7, 2023
1 parent bb335de commit 0bb4f26
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 36 deletions.
66 changes: 43 additions & 23 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ blstrs = "0.7.0"
ff = "0.13"
log = "0.4.17"
neptune = { version = "10.0.0" }
nova = { package = "nova-snark", version = "0.21", default-features = false }
nova = { package = "nova-snark", version = "0.22", default-features = false }
once_cell = "1.17.1"
pairing_lib = { version = "0.23", package = "pairing" }
pasta_curves = { version = "0.5.1" }
Expand Down
32 changes: 20 additions & 12 deletions src/proof/nova.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,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 @@ -340,7 +348,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 0bb4f26

Please sign in to comment.