Skip to content

Commit

Permalink
update: Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CPerezz committed Aug 2, 2023
1 parent 6b45d7c commit e2380f7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tests/nimfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,25 @@ fn integration_folding_test<G: Group>() {
b"test_nimfs",
);

let mut nimfs_witness = vec![G::Scalar::from(3u64), G::Scalar::from(35u64)];

// Now, the NIMFS should satisfy correctly as we have inputed valid starting inpuits for the first LCCCS contained instance:
assert!(nimfs.is_sat().is_ok());
assert!(nimfs.is_sat(&nimfs_witness).is_ok());

// Now let's create a valid CCCS instance and fold it:
let valid_cccs = nimfs.new_cccs(vec![
G::Scalar::ONE,
G::Scalar::from(2u64),
G::Scalar::from(15u64),
]);
nimfs.fold(valid_cccs);
let cccs_witness = vec![G::Scalar::from(2u64), G::Scalar::from(15u64)];

let (r_x_prime, rho) = nimfs.prepare_folding();
let (sigmas, thetas) =
nimfs.compute_sigmas_and_thetas(&cccs_witness, &valid_cccs, &nimfs_witness, &r_x_prime);
nimfs.fold(&valid_cccs, sigmas, thetas, r_x_prime, rho);
nimfs.fold_witness(&valid_cccs, &cccs_witness, &mut nimfs_witness, rho);

// Since the instance was correct, the NIMFS should still be satisfied.
assert!(nimfs.is_sat().is_ok());
assert!(nimfs.is_sat(&nimfs_witness).is_ok());
}

0 comments on commit e2380f7

Please sign in to comment.