From c6fa7eb18e28f19ab932926677fd157dfab1010b Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Mon, 17 May 2021 11:47:33 -0700 Subject: [PATCH] Minor --- src/gates/interpolation_quartic.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gates/interpolation_quartic.rs b/src/gates/interpolation_quartic.rs index 57b271ff..3d1c3f54 100644 --- a/src/gates/interpolation_quartic.rs +++ b/src/gates/interpolation_quartic.rs @@ -107,21 +107,26 @@ impl Gate for QuarticInterpolationGa fn generators( &self, gate_index: usize, - local_constants: &[QFE::BaseField], + _local_constants: &[QFE::BaseField], ) -> Vec>> { - todo!() + let gen = QuarticInterpolationGenerator:: { + gate_index, + num_points: self.num_points, + _phantom: PhantomData, + }; + vec![Box::new(gen)] } fn num_wires(&self) -> usize { - todo!() + self.start_coeffs() + self.num_points * EXT_SIZE } fn num_constants(&self) -> usize { - todo!() + 0 } fn degree(&self) -> usize { - todo!() + self.num_points - 1 } fn num_constraints(&self) -> usize { @@ -130,6 +135,8 @@ impl Gate for QuarticInterpolationGa } struct QuarticInterpolationGenerator { + gate_index: usize, + num_points: usize, _phantom: PhantomData, } @@ -149,8 +156,9 @@ impl SimpleGenerator mod tests { use std::marker::PhantomData; - use crate::gates::interpolation_quartic::QuarticInterpolationGate; use crate::field::extension_field::quartic::QuarticCrandallField; + use crate::gates::gate::Gate; + use crate::gates::interpolation_quartic::QuarticInterpolationGate; #[test] fn wire_indices() { @@ -165,5 +173,6 @@ mod tests { assert_eq!(gate.wires_interpolated_value(), vec![14, 15, 16, 17]); assert_eq!(gate.wires_coeff(0), vec![18, 19, 20, 21]); assert_eq!(gate.wires_coeff(1), vec![22, 23, 24, 25]); + assert_eq!(gate.num_wires(), 26); } }