mirror of https://github.com/zcash/halo2.git
Add MSM to PLONK verifier signature
This commit is contained in:
parent
ed8130b7bf
commit
1a52d8f6b8
|
@ -345,6 +345,7 @@ fn test_proving() {
|
||||||
let proof = Proof::create::<DummyHash<Fq>, DummyHash<Fp>, _>(¶ms, &srs, &circuit)
|
let proof = Proof::create::<DummyHash<Fq>, DummyHash<Fp>, _>(¶ms, &srs, &circuit)
|
||||||
.expect("proof generation should not fail");
|
.expect("proof generation should not fail");
|
||||||
|
|
||||||
assert!(proof.verify::<DummyHash<Fq>, DummyHash<Fp>>(¶ms, &srs));
|
let msm_default = params.msm();
|
||||||
|
assert!(proof.verify::<DummyHash<Fq>, DummyHash<Fp>>(¶ms, &srs, msm_default));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue