diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index 1d9de2706e..28ca17a082 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -1443,7 +1443,7 @@ impl<'a, F: FieldExt> MockProver<'a, F> { self.permutation .as_ref() .expect("root cs permutation must be Some") - .mapping + .mapping() .iter() .enumerate() .flat_map(move |(column, values)| { @@ -1817,7 +1817,7 @@ impl<'a, F: FieldExt> MockProver<'a, F> { self.permutation .as_ref() .expect("root cs permutation must be Some") - .mapping + .mapping() .iter() .enumerate() .flat_map(move |(column, values)| { diff --git a/halo2_proofs/src/plonk.rs b/halo2_proofs/src/plonk.rs index d1aecca38e..f2e2ce7df8 100644 --- a/halo2_proofs/src/plonk.rs +++ b/halo2_proofs/src/plonk.rs @@ -28,7 +28,7 @@ mod error; mod evaluation; mod keygen; mod lookup; -pub(crate) mod permutation; +pub mod permutation; mod vanishing; mod prover; diff --git a/halo2_proofs/src/plonk/permutation.rs b/halo2_proofs/src/plonk/permutation.rs index b353493c57..8a731416ee 100644 --- a/halo2_proofs/src/plonk/permutation.rs +++ b/halo2_proofs/src/plonk/permutation.rs @@ -1,3 +1,5 @@ +//! Implementation of permutation argument. + use super::circuit::{Any, Column}; use crate::{ arithmetic::CurveAffine, @@ -14,6 +16,8 @@ pub(crate) mod keygen; pub(crate) mod prover; pub(crate) mod verifier; +pub use keygen::Assembly; + use std::io; /// A permutation argument. @@ -72,6 +76,7 @@ impl Argument { } } + /// Returns columns that participate on the permutation argument. pub fn get_columns(&self) -> Vec> { self.columns.clone() } diff --git a/halo2_proofs/src/plonk/permutation/keygen.rs b/halo2_proofs/src/plonk/permutation/keygen.rs index 58ba4878cc..cc2dc09bb0 100644 --- a/halo2_proofs/src/plonk/permutation/keygen.rs +++ b/halo2_proofs/src/plonk/permutation/keygen.rs @@ -12,16 +12,16 @@ use crate::{ }; /// Struct that accumulates all the necessary data in order to construct the permutation argument. -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Assembly { /// Columns that participate on the copy permutation argument. - pub columns: Vec>, + columns: Vec>, /// Mapping of the actual copies done. - pub mapping: Vec>, + mapping: Vec>, /// Some aux data used to swap positions directly when sorting. - pub aux: Vec>, + aux: Vec>, /// More aux data - pub sizes: Vec>, + sizes: Vec>, } impl Assembly { @@ -238,4 +238,14 @@ impl Assembly { polys, } } + + /// Returns columns that participate on the permutation argument. + pub fn columns(&self) -> &[Column] { + &self.columns + } + + /// Returns mappings of the copies. + pub fn mapping(&self) -> &[Vec<(usize, usize)>] { + &self.mapping + } } diff --git a/rust-toolchain b/rust-toolchain index af92bdd9f5..9405730420 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.63.0 +1.64.0