diff --git a/src/gates/interpolation_quartic.rs b/src/gates/interpolation.rs similarity index 91% rename from src/gates/interpolation_quartic.rs rename to src/gates/interpolation.rs index 68ad0fd2..04e149e3 100644 --- a/src/gates/interpolation_quartic.rs +++ b/src/gates/interpolation.rs @@ -17,18 +17,18 @@ use crate::witness::PartialWitness; /// The size of the field extension, in terms of number of base elements per extension element. const EXT_SIZE: usize = 4; -/// Evaluates the interpolant of some given elements from a quartic field extension. +/// Evaluates the interpolant of some given elements from a field extension. /// /// In particular, this gate takes as inputs `num_points` points, `num_points` values, and the point /// to evaluate the interpolant at. It computes the interpolant and outputs its evaluation at the /// given point. #[derive(Clone, Debug)] -pub(crate) struct QuarticInterpolationGate, const D: usize> { +pub(crate) struct InterpolationGate, const D: usize> { num_points: usize, _phantom: PhantomData, } -impl, const D: usize> QuarticInterpolationGate { +impl, const D: usize> InterpolationGate { pub fn new(num_points: usize) -> GateRef { let gate = Self { num_points, @@ -94,7 +94,7 @@ impl, const D: usize> QuarticInterpolationGate { } } -impl, const D: usize> Gate for QuarticInterpolationGate { +impl, const D: usize> Gate for InterpolationGate { fn id(&self) -> String { format!("{:?}", self, D) } @@ -135,7 +135,7 @@ impl, const D: usize> Gate for QuarticInterpolationG gate_index: usize, _local_constants: &[F], ) -> Vec>> { - let gen = QuarticInterpolationGenerator:: { + let gen = InterpolationGenerator:: { gate_index, gate: self.clone(), _phantom: PhantomData, @@ -164,14 +164,14 @@ impl, const D: usize> Gate for QuarticInterpolationG } } -struct QuarticInterpolationGenerator, const D: usize> { +struct InterpolationGenerator, const D: usize> { gate_index: usize, - gate: QuarticInterpolationGate, + gate: InterpolationGate, _phantom: PhantomData, } impl, const D: usize> SimpleGenerator - for QuarticInterpolationGenerator + for InterpolationGenerator { fn dependencies(&self) -> Vec { let local_target = |input| { @@ -244,11 +244,11 @@ mod tests { use crate::field::crandall_field::CrandallField; use crate::gates::gate::Gate; use crate::gates::gate_testing::test_low_degree; - use crate::gates::interpolation_quartic::QuarticInterpolationGate; + use crate::gates::interpolation::InterpolationGate; #[test] fn wire_indices() { - let gate = QuarticInterpolationGate:: { + let gate = InterpolationGate:: { num_points: 2, _phantom: PhantomData, }; @@ -269,7 +269,7 @@ mod tests { #[test] fn low_degree() { type F = CrandallField; - let gate = QuarticInterpolationGate:: { + let gate = InterpolationGate:: { num_points: 4, _phantom: PhantomData, }; diff --git a/src/gates/mod.rs b/src/gates/mod.rs index e0d990b9..0c8b04b8 100644 --- a/src/gates/mod.rs +++ b/src/gates/mod.rs @@ -4,7 +4,7 @@ pub(crate) mod fri_consistency_gate; pub(crate) mod gate; pub mod gmimc; pub(crate) mod gmimc_eval; -mod interpolation_quartic; +mod interpolation; pub(crate) mod noop; #[cfg(test)]