Merge pull request #18 from mir-protocol/no_next_access

Remove access to "next" wire & constant values
This commit is contained in:
Daniel Lubarov 2021-04-24 10:38:37 -07:00 committed by GitHub
commit 03113e85ba
9 changed files with 2 additions and 15 deletions

View File

@ -84,8 +84,7 @@ impl<F: Field> CircuitBuilder<F> {
let index = self.gate_instances.len(); let index = self.gate_instances.len();
// TODO: Not passing next constants for now. Not sure if it's really useful... self.add_generators(gate_type.0.generators(index, &constants));
self.add_generators(gate_type.0.generators(index, &constants, &[]));
self.gate_instances.push(GateInstance { self.gate_instances.push(GateInstance {
gate_type, gate_type,

View File

@ -64,7 +64,6 @@ impl<F: Field> Gate<F> for ArithmeticGate {
&self, &self,
gate_index: usize, gate_index: usize,
local_constants: &[F], local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> { ) -> Vec<Box<dyn WitnessGenerator<F>>> {
let gen = ArithmeticGenerator { let gen = ArithmeticGenerator {
gate_index, gate_index,

View File

@ -45,7 +45,6 @@ impl<F: Field> Gate<F> for ConstantGate {
&self, &self,
gate_index: usize, gate_index: usize,
local_constants: &[F], local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> { ) -> Vec<Box<dyn WitnessGenerator<F>>> {
let gen = ConstantGenerator { let gen = ConstantGenerator {
gate_index, gate_index,

View File

@ -37,7 +37,6 @@ pub trait Gate<F: Field>: 'static + Send + Sync {
&self, &self,
gate_index: usize, gate_index: usize,
local_constants: &[F], local_constants: &[F],
next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>>; ) -> Vec<Box<dyn WitnessGenerator<F>>>;
/// The number of wires used by this gate. /// The number of wires used by this gate.

View File

@ -126,7 +126,6 @@ impl<F: Field, const R: usize> Gate<F> for GMiMCGate<F, R> {
&self, &self,
gate_index: usize, gate_index: usize,
_local_constants: &[F], _local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> { ) -> Vec<Box<dyn WitnessGenerator<F>>> {
let gen = GMiMCGenerator { let gen = GMiMCGenerator {
gate_index, gate_index,
@ -304,7 +303,7 @@ mod tests {
); );
} }
let generators = gate.0.generators(0, &[], &[]); let generators = gate.0.generators(0, &[]);
generate_partial_witness(&mut witness, &generators); generate_partial_witness(&mut witness, &generators);
let expected_outputs: [F; W] = let expected_outputs: [F; W] =

View File

@ -38,7 +38,6 @@ impl<F: Field> Gate<F> for GMiMCEvalGate {
&self, &self,
gate_index: usize, gate_index: usize,
local_constants: &[F], local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> { ) -> Vec<Box<dyn WitnessGenerator<F>>> {
let gen = GMiMCEvalGenerator::<F> { let gen = GMiMCEvalGenerator::<F> {
gate_index, gate_index,

View File

@ -35,7 +35,6 @@ impl<F: Field> Gate<F> for NoopGate {
&self, &self,
_gate_index: usize, _gate_index: usize,
_local_constants: &[F], _local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> { ) -> Vec<Box<dyn WitnessGenerator<F>>> {
Vec::new() Vec::new()
} }

View File

@ -197,9 +197,7 @@ fn compute_vanishing_polys<F: Field>(
let vars = EvaluationVars { let vars = EvaluationVars {
local_constants, local_constants,
next_constants,
local_wires, local_wires,
next_wires,
}; };
compute_vanishing_poly_entry( compute_vanishing_poly_entry(
common_data, common_data,

View File

@ -4,15 +4,11 @@ use crate::target::Target;
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct EvaluationVars<'a, F: Field> { pub struct EvaluationVars<'a, F: Field> {
pub(crate) local_constants: &'a [F], pub(crate) local_constants: &'a [F],
pub(crate) next_constants: &'a [F],
pub(crate) local_wires: &'a [F], pub(crate) local_wires: &'a [F],
pub(crate) next_wires: &'a [F],
} }
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
pub struct EvaluationTargets<'a> { pub struct EvaluationTargets<'a> {
pub(crate) local_constants: &'a [Target], pub(crate) local_constants: &'a [Target],
pub(crate) next_constants: &'a [Target],
pub(crate) local_wires: &'a [Target], pub(crate) local_wires: &'a [Target],
pub(crate) next_wires: &'a [Target],
} }