Skip to content

Commit

Permalink
fix: use "ArgumentMid" in "permutation" module
Browse files Browse the repository at this point in the history
  • Loading branch information
guorong009 committed Oct 16, 2024
1 parent 39c6f63 commit 2d0029b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions halo2_backend/src/plonk/permutation/keygen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use group::Curve;
use halo2_middleware::ff::{Field, PrimeField};
use halo2_middleware::zal::impls::H2cEngine;

use super::{Argument, ProvingKey, VerifyingKey};
use super::{ProvingKey, VerifyingKey};
use crate::{
arithmetic::{parallelize, CurveAffine},
plonk::Error,
Expand Down Expand Up @@ -40,7 +40,7 @@ impl Assembly {
Ok(assembly)
}

pub(crate) fn new(n: usize, p: &Argument) -> Self {
pub(crate) fn new(n: usize, p: &ArgumentMid) -> Self {
// Initialize the copy vector to keep track of copy constraints in all
// the permutation arguments.
let mut columns = vec![];
Expand Down Expand Up @@ -121,7 +121,7 @@ impl Assembly {
self,
params: &P,
domain: &EvaluationDomain<C::Scalar>,
p: &Argument,
p: &ArgumentMid,
) -> VerifyingKey<C> {
build_vk(params, domain, p, |i, j| self.mapping[i][j])
}
Expand All @@ -130,7 +130,7 @@ impl Assembly {
self,
params: &P,
domain: &EvaluationDomain<C::Scalar>,
p: &Argument,
p: &ArgumentMid,
) -> ProvingKey<C> {
build_pk(params, domain, p, |i, j| self.mapping[i][j])
}
Expand All @@ -139,7 +139,7 @@ impl Assembly {
pub(crate) fn build_pk<C: CurveAffine, P: Params<C>>(
params: &P,
domain: &EvaluationDomain<C::Scalar>,
p: &Argument,
p: &ArgumentMid,
mapping: impl Fn(usize, usize) -> (usize, usize) + Sync,
) -> ProvingKey<C> {
// Compute [omega^0, omega^1, ..., omega^{params.n - 1}]
Expand Down Expand Up @@ -215,7 +215,7 @@ pub(crate) fn build_pk<C: CurveAffine, P: Params<C>>(
pub(crate) fn build_vk<C: CurveAffine, P: Params<C>>(
params: &P,
domain: &EvaluationDomain<C::Scalar>,
p: &Argument,
p: &ArgumentMid,
mapping: impl Fn(usize, usize) -> (usize, usize) + Sync,
) -> VerifyingKey<C> {
// Compute [omega^0, omega^1, ..., omega^{params.n - 1}]
Expand Down
5 changes: 2 additions & 3 deletions halo2_backend/src/plonk/permutation/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ use group::{
ff::{BatchInvert, Field},
Curve,
};
use halo2_middleware::zal::traits::MsmAccel;
use halo2_middleware::{ff::PrimeField, zal::impls::PlonkEngine};
use halo2_middleware::{permutation::ArgumentMid, zal::traits::MsmAccel};
use rand_core::RngCore;
use std::iter::{self, ExactSizeIterator};

use super::Argument;
use crate::{
arithmetic::{eval_polynomial, parallelize, CurveAffine},
plonk::{self, permutation::ProvingKey, ChallengeBeta, ChallengeGamma, ChallengeX, Error},
Expand Down Expand Up @@ -62,7 +61,7 @@ pub(in crate::plonk) fn permutation_commit<
M: MsmAccel<C>,
>(
engine: &PlonkEngine<C, M>,
arg: &Argument,
arg: &ArgumentMid,
params: &P,
pk: &plonk::ProvingKey<C>,
pkey: &ProvingKey<C>,
Expand Down
11 changes: 7 additions & 4 deletions halo2_backend/src/plonk/permutation/verifier.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
use halo2_middleware::ff::{Field, PrimeField};
use halo2_middleware::{
ff::{Field, PrimeField},
permutation::ArgumentMid,
};
use std::iter;

use super::{Argument, VerifyingKey};
use super::VerifyingKey;
use crate::{
arithmetic::CurveAffine,
plonk::{self, ChallengeBeta, ChallengeGamma, ChallengeX, Error},
Expand Down Expand Up @@ -35,7 +38,7 @@ pub(crate) fn permutation_read_product_commitments<
E: EncodedChallenge<C>,
T: TranscriptRead<C, E>,
>(
arg: &Argument,
arg: &ArgumentMid,
vk: &plonk::VerifyingKey<C>,
transcript: &mut T,
) -> Result<Committed<C>, Error> {
Expand Down Expand Up @@ -102,7 +105,7 @@ impl<C: CurveAffine> Evaluated<C> {
pub(in crate::plonk) fn expressions<'a>(
&'a self,
vk: &'a plonk::VerifyingKey<C>,
p: &'a Argument,
p: &'a ArgumentMid,
common: &'a CommonEvaluated<C>,
advice_evals: &'a [C::Scalar],
fixed_evals: &'a [C::Scalar],
Expand Down

0 comments on commit 2d0029b

Please sign in to comment.