Skip to content

Commit

Permalink
feat: Improve prove and verify methods in ZMPCS struct
Browse files Browse the repository at this point in the history
- Updated `prove` and `verify` methods in `ZMPCS<E>` struct within `non_hiding_zeromorph.rs` with actual logic for commitment, evaluation, and verification.
- Adjusted the construction of `ZMCommitment` and `ZMEvaluation` within `prove` and `verify` methods.
- Commented on portions of the code in `non_hiding_zeromorph.rs` that need further modification and refinement.
- Modified test value for `test_pp_digest_with` in the `test_supernova_pp_digest` test case to match the new expected output.
  • Loading branch information
huitseeker committed Oct 13, 2023
1 parent 38551ce commit 5f826c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/provider/non_hiding_zeromorph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,11 @@ where
point: &[<E::G1 as Group>::Scalar],
eval: &<E::G1 as Group>::Scalar,
) -> Result<Self::EvaluationArgument, NovaError> {
todo!()
let commitment = ZMCommitment::from(UVKZGCommitment::from(comm.clone()));
// TODO: the following two lines will need to change base
let polynomial = MultilinearPolynomial::new(poly.to_vec());
let evaluation = ZMEvaluation(eval.clone());
ZMPCS::open(pk, &commitment, &polynomial, point, &evaluation, transcript)
}

fn verify(
Expand All @@ -444,7 +448,11 @@ where
eval: &<E::G1 as Group>::Scalar,
arg: &Self::EvaluationArgument,
) -> Result<(), NovaError> {
todo!()
let commitment = ZMCommitment::from(UVKZGCommitment::from(comm.clone()));
let evaluation = ZMEvaluation(eval.clone());
// TODO: this clone is unsightly!
ZMPCS::verify(vk, transcript, &commitment, point, &evaluation, arg.clone())?;
Ok(())
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/supernova/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ fn test_supernova_pp_digest() {

test_pp_digest_with::<bn256::Point, grumpkin::Point, _, _, _>(
&test_rom_grumpkin,
"0b8c080ffa823b95d1dd75b6a5b49852c53ff60fbead6652af6d2a0bd177b800",
"f8de057dc64151079516d660f929b5f92e514a54d1c5ab70b1f1520c0043e902",
);

let rom = vec![
Expand Down

0 comments on commit 5f826c7

Please sign in to comment.