Skip to content

Commit

Permalink
Merge pull request privacy-scaling-explorations#133 from input-output…
Browse files Browse the repository at this point in the history
…-hk/dev-fix/address-pr-24-issues

Resolve "Address PR #24 issues"
  • Loading branch information
b13decker authored Mar 6, 2024
2 parents 1b01f78 + c524931 commit 9575960
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion halo2_proofs/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl<C: CurveAffine> VerifyingKey<C> {
/// Generalizes various behaviors of how proofs are generated by the PLONK prover and consumed by
/// the PLONK verifier.
pub trait ProofGenerator<C: CurveAffine, E: EncodedChallenge<C>> {
/// How the prover commits tp it's polynomial evualuations
/// How the prover commits to its polynomial evaluations
type EvalComm: EvaluationCommitment<C, E>;
/// How fixed polynomials should be evaluated by the prover
type FixedEval: FixedPolyEvaluator<C, E, Self::EvalComm>;
Expand Down
19 changes: 12 additions & 7 deletions halo2_proofs/src/plonk/permutation/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -219,17 +219,22 @@ impl<C: CurveAffine> super::ProvingKey<C> {
})
}

pub(in crate::plonk) fn evaluate<E: EncodedChallenge<C>, T: TranscriptWrite<C, E>>(
pub(in crate::plonk) fn evaluate<
E: EncodedChallenge<C>,
T: TranscriptWrite<C, E>,
Gen: ProofGenerator<C, E>,
>(
&self,
x: ChallengeX<C>,
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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion halo2_proofs/src/plonk/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<permutation::prover::Evaluated<Scheme::Curve>> = permutations
Expand Down

0 comments on commit 9575960

Please sign in to comment.