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();
// 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 {
gate_type,

View File

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

View File

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

View File

@ -37,7 +37,6 @@ pub trait Gate<F: Field>: 'static + Send + Sync {
&self,
gate_index: usize,
local_constants: &[F],
next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>>;
/// 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,
gate_index: usize,
_local_constants: &[F],
_next_constants: &[F],
) -> Vec<Box<dyn WitnessGenerator<F>>> {
let gen = GMiMCGenerator {
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);
let expected_outputs: [F; W] =

View File

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

View File

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

View File

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

View File

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