diff --git a/halo2_proofs/src/plonk.rs b/halo2_proofs/src/plonk.rs index aa33c1a6f..10ed84f85 100644 --- a/halo2_proofs/src/plonk.rs +++ b/halo2_proofs/src/plonk.rs @@ -410,7 +410,7 @@ impl VerifyingKey { /// Generalizes various behaviors of how proofs are generated by the PLONK prover and consumed by /// the PLONK verifier. pub trait ProofGenerator> { - /// How the prover commits tp it's polynomial evualuations + /// How the prover commits to its polynomial evaluations type EvalComm: EvaluationCommitment; /// How fixed polynomials should be evaluated by the prover type FixedEval: FixedPolyEvaluator; diff --git a/halo2_proofs/src/plonk/permutation/prover.rs b/halo2_proofs/src/plonk/permutation/prover.rs index f31c6ed19..51d4b3374 100644 --- a/halo2_proofs/src/plonk/permutation/prover.rs +++ b/halo2_proofs/src/plonk/permutation/prover.rs @@ -10,7 +10,7 @@ use super::super::{circuit::Any, ChallengeBeta, ChallengeGamma, ChallengeX}; use super::{Argument, ProvingKey}; use crate::{ arithmetic::{eval_polynomial, parallelize, CurveAffine}, - plonk::{self, Error}, + plonk::{self, Error, FixedPolyEvaluator, ProofGenerator}, poly::{ self, commitment::{Blind, Params}, @@ -219,17 +219,22 @@ impl super::ProvingKey { }) } - pub(in crate::plonk) fn evaluate, T: TranscriptWrite>( + pub(in crate::plonk) fn evaluate< + E: EncodedChallenge, + T: TranscriptWrite, + Gen: ProofGenerator, + >( &self, x: ChallengeX, transcript: &mut T, ) -> Result<(), Error> { // Hash permutation evals - for eval in self.polys.iter().map(|poly| eval_polynomial(poly, *x)) { - transcript.write_scalar(eval)?; - } - - Ok(()) + Gen::FixedEval::eval_to_transcript( + &self.polys, + std::iter::repeat(*x).take(self.polys.len()), + transcript, + ) + .map_err(Error::from) } } diff --git a/halo2_proofs/src/plonk/prover.rs b/halo2_proofs/src/plonk/prover.rs index c677f4065..1beaabbd5 100644 --- a/halo2_proofs/src/plonk/prover.rs +++ b/halo2_proofs/src/plonk/prover.rs @@ -574,7 +574,7 @@ where let vanishing = vanishing.evaluate(x, xn, domain, transcript)?; // Evaluate common permutation data - pk.permutation.evaluate(x, transcript)?; + pk.permutation.evaluate::<_, _, Gen>(x, transcript)?; // Evaluate the permutations, if any, at omega^i x. let permutations: Vec> = permutations