Add MSM to PLONK verifier signature

This commit is contained in:
therealyingtong 2020-09-13 11:39:35 +08:00
parent ed8130b7bf
commit 1a52d8f6b8
No known key found for this signature in database
GPG Key ID: 179F32A1503D607E
2 changed files with 6 additions and 5 deletions

View File

@ -345,6 +345,7 @@ fn test_proving() {
let proof = Proof::create::<DummyHash<Fq>, DummyHash<Fp>, _>(&params, &srs, &circuit) let proof = Proof::create::<DummyHash<Fq>, DummyHash<Fp>, _>(&params, &srs, &circuit)
.expect("proof generation should not fail"); .expect("proof generation should not fail");
assert!(proof.verify::<DummyHash<Fq>, DummyHash<Fp>>(&params, &srs)); let msm_default = params.msm();
assert!(proof.verify::<DummyHash<Fq>, DummyHash<Fp>>(&params, &srs, msm_default));
} }
} }

View File

@ -12,6 +12,7 @@ impl<C: CurveAffine> Proof<C> {
&self, &self,
params: &Params<C>, params: &Params<C>,
srs: &SRS<C>, srs: &SRS<C>,
msm: MSM<C>,
) -> bool { ) -> bool {
// Create a transcript for obtaining Fiat-Shamir challenges. // Create a transcript for obtaining Fiat-Shamir challenges.
let mut transcript = HBase::init(C::Base::one()); let mut transcript = HBase::init(C::Base::one());
@ -264,12 +265,11 @@ impl<C: CurveAffine> Proof<C> {
} }
// Verify the opening proof // Verify the opening proof
let default_msm = params.msm();
let guard = self let guard = self
.opening .opening
.verify( .verify(
params, params,
default_msm, msm,
&mut transcript, &mut transcript,
x_6, x_6,
&f_commitment.to_affine(), &f_commitment.to_affine(),
@ -277,8 +277,8 @@ impl<C: CurveAffine> Proof<C> {
) )
.unwrap(); .unwrap();
let msm: &MSM<C> = &guard.use_challenges(); let msm_challenges = guard.use_challenges();
msm.is_zero() msm_challenges.is_zero()
} }
} }