updated for add_gate changes

This commit is contained in:
Nicholas Ward 2021-07-23 20:06:00 -07:00
parent da9017bcbc
commit d7a9274fef
2 changed files with 7 additions and 11 deletions

View File

@ -1,12 +1,10 @@
use std::convert::TryInto;
use std::marker::PhantomData;
use std::ops::Range;
use crate::circuit_builder::CircuitBuilder;
use crate::field::extension_field::target::ExtensionTarget;
use crate::field::extension_field::{Extendable, FieldExtension};
use crate::field::extension_field::Extendable;
use crate::field::field::Field;
use crate::gates::gate::{Gate, GateRef};
use crate::gates::gate::Gate;
use crate::generator::{GeneratedValues, SimpleGenerator, WitnessGenerator};
use crate::plonk_common::reduce_with_powers;
use crate::target::Target;
@ -24,12 +22,11 @@ pub(crate) struct ExponentiationGate<F: Extendable<D>, const D: usize> {
}
impl<F: Extendable<D>, const D: usize> ExponentiationGate<F, D> {
pub fn new(power_bits: usize) -> GateRef<F, D> {
let gate = Self {
pub fn new(power_bits: usize) -> Self {
Self {
num_power_bits: power_bits,
_phantom: PhantomData,
};
GateRef::new(gate)
}
}
pub fn wires_base(&self) -> usize {
@ -202,8 +199,7 @@ mod tests {
#[test]
fn low_degree() {
type F = CrandallField;
test_low_degree(ExponentiationGate::<F, 4>::new(5));
test_low_degree::<CrandallField, _, 4>(ExponentiationGate::new(5));
}
#[test]

View File

@ -6,7 +6,7 @@ use crate::circuit_builder::CircuitBuilder;
use crate::field::extension_field::target::ExtensionTarget;
use crate::field::extension_field::{Extendable, FieldExtension};
use crate::field::field::Field;
use crate::gates::gate::{Gate, GateRef};
use crate::gates::gate::Gate;
use crate::generator::{GeneratedValues, SimpleGenerator, WitnessGenerator};
use crate::target::Target;
use crate::vars::{EvaluationTargets, EvaluationVars, EvaluationVarsBase};