diff --git a/src/plonk/circuit.rs b/src/plonk/circuit.rs index 17ecd6a9..327c8e94 100644 --- a/src/plonk/circuit.rs +++ b/src/plonk/circuit.rs @@ -284,7 +284,7 @@ pub struct ConstraintSystem { // Mapping from a witness vector rotation to the index in the point vector. pub(crate) rotations: BTreeMap, - // Vector of permutation arguments, where each corresponds to a set of columns + // Vector of permutation arguments, where each corresponds to a sequence of columns // that are involved in a permutation argument. pub(crate) permutations: Vec>>, } @@ -399,7 +399,11 @@ impl ConstraintSystem { index } - /// Query an Any column at a relative position + /// Query an auxiliary column at a relative position + pub fn query_aux(&mut self, column: Column, at: i32) -> Expression { + Expression::Aux(self.query_aux_index(column, at)) + } + fn query_any_index(&mut self, column: Column, at: i32) -> usize { let index = match column.column_type { Any::Advice => self.query_advice_index(Column::::from(column), at), @@ -410,9 +414,17 @@ impl ConstraintSystem { index } - /// Query an auxiliary column at a relative position - pub fn query_aux(&mut self, column: Column, at: i32) -> Expression { - Expression::Aux(self.query_aux_index(column, at)) + /// Query an Any column at a relative position + pub fn query_any(&mut self, column: Column, at: i32) -> Expression { + match column.column_type { + Any::Advice => { + Expression::Advice(self.query_advice_index(Column::::from(column), at)) + } + Any::Fixed => { + Expression::Fixed(self.query_fixed_index(Column::::from(column), at)) + } + Any::Aux => Expression::Aux(self.query_aux_index(Column::::from(column), at)), + } } pub(crate) fn get_advice_query_index(&self, column: Column, at: i32) -> usize {