diff --git a/src/gadgets/sorting.rs b/src/gadgets/sorting.rs index 5f074f94..f202620c 100644 --- a/src/gadgets/sorting.rs +++ b/src/gadgets/sorting.rs @@ -1,3 +1,5 @@ +use std::marker::PhantomData; + use itertools::izip; use crate::field::extension_field::Extendable; @@ -8,7 +10,6 @@ use crate::iop::target::{BoolTarget, Target}; use crate::iop::witness::{PartitionWitness, Witness}; use crate::plonk::circuit_builder::CircuitBuilder; use crate::util::ceil_div_usize; -use std::marker::PhantomData; pub struct MemoryOp { is_write: bool, @@ -39,15 +40,8 @@ impl, const D: usize> CircuitBuilder { self.assert_permutation(a_chunks, b_chunks); } - /// Add a ComparisonGate to - /// Returns the gate and its index - pub fn assert_le( - &mut self, - lhs: Target, - rhs: Target, - bits: usize, - num_chunks: usize, - ) { + /// Add a ComparisonGate to assert that `lhs` is less than `rhs`, where their values are at most `bits` bits. + pub fn assert_le(&mut self, lhs: Target, rhs: Target, bits: usize, num_chunks: usize) { let gate = ComparisonGate::new(bits, num_chunks); let gate_index = self.add_gate(gate.clone(), vec![]); @@ -125,7 +119,7 @@ impl, const D: usize> CircuitBuilder { struct MemoryOpSortGenerator, const D: usize> { input_ops: Vec, output_ops: Vec, - _phantom: PhantomData, + _phantom: PhantomData, } impl, const D: usize> SimpleGenerator