diff --git a/ext/crates/fp/src/vector/fp_wrapper/helpers.rs b/ext/crates/fp/src/vector/fp_wrapper/helpers.rs index 03ebb955a..ab8939a4d 100644 --- a/ext/crates/fp/src/vector/fp_wrapper/helpers.rs +++ b/ext/crates/fp/src/vector/fp_wrapper/helpers.rs @@ -14,7 +14,7 @@ use itertools::Itertools; -use super::{FpSliceMutP, FpSliceP, FqVector, FqVectorIteratorP, FqVectorNonZeroIteratorP}; +use super::{FqSlice, FqSliceMut, FqVector, FqVectorIterator, FqVectorNonZeroIterator}; use crate::field::Field; impl FqVector { @@ -76,18 +76,18 @@ impl FqVector { } } -impl<'a, F: Field> FpSliceP<'a, F> { +impl<'a, F: Field> FqSlice<'a, F> { pub(super) fn entry_helper(&self, index: usize) -> F::ElementContainer { self.entry(index).val() } } -impl<'a, F: Field> FpSliceMutP<'a, F> { +impl<'a, F: Field> FqSliceMut<'a, F> { pub(super) fn scale_helper(&mut self, c: F::ElementContainer) { self.scale(self.fq.el(c)) } - pub(super) fn add_helper(&mut self, other: FpSliceP, c: F::ElementContainer) { + pub(super) fn add_helper(&mut self, other: FqSlice, c: F::ElementContainer) { self.add(other, self.fq.el(c)) } @@ -101,7 +101,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { pub(super) fn add_masked_helper( &mut self, - other: FpSliceP, + other: FqSlice, c: F::ElementContainer, mask: &[usize], ) { @@ -110,7 +110,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { pub(super) fn add_unmasked_helper( &mut self, - other: FpSliceP, + other: FqSlice, c: F::ElementContainer, mask: &[usize], ) { @@ -121,20 +121,20 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { &mut self, offset: usize, coeff: F::ElementContainer, - left: FpSliceP, - right: FpSliceP, + left: FqSlice, + right: FqSlice, ) { self.add_tensor(offset, self.fq.el(coeff), left, right) } } -impl<'a, F: Field> FqVectorIteratorP<'a, F> { +impl<'a, F: Field> FqVectorIterator<'a, F> { pub(super) fn next_helper(&mut self) -> Option { self.next().map(|x| x.val()) } } -impl<'a, F: Field> FqVectorNonZeroIteratorP<'a, F> { +impl<'a, F: Field> FqVectorNonZeroIterator<'a, F> { pub(super) fn next_helper(&mut self) -> Option<(usize, F::ElementContainer)> { self.next().map(|x| (x.0, x.1.val())) } diff --git a/ext/crates/fp/src/vector/fp_wrapper/mod.rs b/ext/crates/fp/src/vector/fp_wrapper/mod.rs index 2ffeb0874..438bee3ad 100644 --- a/ext/crates/fp/src/vector/fp_wrapper/mod.rs +++ b/ext/crates/fp/src/vector/fp_wrapper/mod.rs @@ -21,12 +21,12 @@ use std::{ use itertools::Itertools; use serde::{Deserialize, Deserializer, Serialize, Serializer}; -use super::iter::{FqVectorIteratorP, FqVectorNonZeroIteratorP}; +use super::iter::{FqVectorIterator, FqVectorNonZeroIterator}; use crate::{ field::{field_internal::FieldInternal, Fp}, limb::Limb, prime::Prime, - vector::inner::{FpSliceMutP, FpSliceP, FqVector}, + vector::inner::{FqSlice, FqSliceMut, FqVector}, }; mod helpers; @@ -52,20 +52,20 @@ dispatch_struct! { dispatch_struct! { #[derive(Debug, Copy, Clone)] - pub FpSlice<'a> from FpSliceP + pub FpSlice<'a> from FqSlice } dispatch_struct! { #[derive(Debug)] - pub FpSliceMut<'a> from FpSliceMutP + pub FpSliceMut<'a> from FqSliceMut } dispatch_struct! { - pub FpVectorIterator<'a> from FqVectorIteratorP + pub FpVectorIterator<'a> from FqVectorIterator } dispatch_struct! { - pub FpVectorNonZeroIterator<'a> from FqVectorNonZeroIteratorP + pub FpVectorNonZeroIterator<'a> from FqVectorNonZeroIterator } impl FpVector { diff --git a/ext/crates/fp/src/vector/impl_slicep.rs b/ext/crates/fp/src/vector/impl_fqslice.rs similarity index 90% rename from ext/crates/fp/src/vector/impl_slicep.rs rename to ext/crates/fp/src/vector/impl_fqslice.rs index d9744d9fc..e2259de12 100644 --- a/ext/crates/fp/src/vector/impl_slicep.rs +++ b/ext/crates/fp/src/vector/impl_fqslice.rs @@ -1,8 +1,8 @@ use itertools::Itertools; use super::{ - inner::{FpSliceP, FqVector}, - iter::{FqVectorIteratorP, FqVectorNonZeroIteratorP}, + inner::{FqSlice, FqVector}, + iter::{FqVectorIterator, FqVectorNonZeroIterator}, }; use crate::{ constants, @@ -13,7 +13,7 @@ use crate::{ // Public methods -impl<'a, F: Field> FpSliceP<'a, F> { +impl<'a, F: Field> FqSlice<'a, F> { pub fn prime(&self) -> ValidPrime { self.fq.characteristic().to_dyn() } @@ -42,12 +42,12 @@ impl<'a, F: Field> FpSliceP<'a, F> { } /// TODO: implement prime 2 version - pub fn iter(self) -> FqVectorIteratorP<'a, F> { - FqVectorIteratorP::new(self) + pub fn iter(self) -> FqVectorIterator<'a, F> { + FqVectorIterator::new(self) } - pub fn iter_nonzero(self) -> FqVectorNonZeroIteratorP<'a, F> { - FqVectorNonZeroIteratorP::new(self) + pub fn iter_nonzero(self) -> FqVectorNonZeroIterator<'a, F> { + FqVectorNonZeroIterator::new(self) } pub fn is_zero(&self) -> bool { @@ -74,7 +74,7 @@ impl<'a, F: Field> FpSliceP<'a, F> { pub fn slice(self, start: usize, end: usize) -> Self { assert!(start <= end && end <= self.len()); - FpSliceP { + FqSlice { fq: self.fq, limbs: self.limbs, start: self.start + start, @@ -101,7 +101,7 @@ impl<'a, F: Field> FpSliceP<'a, F> { } // Limb methods -impl<'a, F: Field> FpSliceP<'a, F> { +impl<'a, F: Field> FqSlice<'a, F> { #[inline] pub(super) fn offset(&self) -> usize { let bit_length = self.fq.bit_length(); @@ -150,13 +150,13 @@ impl<'a, F: Field> FpSliceP<'a, F> { } } -impl<'a, F: Field> From<&'a FqVector> for FpSliceP<'a, F> { +impl<'a, F: Field> From<&'a FqVector> for FqSlice<'a, F> { fn from(v: &'a FqVector) -> Self { v.slice(0, v.len) } } -impl<'a, F: Field> std::fmt::Display for FpSliceP<'a, F> { +impl<'a, F: Field> std::fmt::Display for FqSlice<'a, F> { /// # Example /// ``` /// # use fp::field::{Field, SmallFq}; diff --git a/ext/crates/fp/src/vector/impl_slicemutp.rs b/ext/crates/fp/src/vector/impl_fqslicemut.rs similarity index 89% rename from ext/crates/fp/src/vector/impl_slicemutp.rs rename to ext/crates/fp/src/vector/impl_fqslicemut.rs index 208618124..bf9e6bf2d 100644 --- a/ext/crates/fp/src/vector/impl_slicemutp.rs +++ b/ext/crates/fp/src/vector/impl_fqslicemut.rs @@ -2,7 +2,7 @@ use std::cmp::Ordering; use itertools::Itertools; -use super::inner::{FpSliceMutP, FpSliceP, FqVector}; +use super::inner::{FqSlice, FqSliceMut, FqVector}; use crate::{ constants, field::{element::FieldElement, Field}, @@ -10,7 +10,7 @@ use crate::{ prime::{Prime, ValidPrime}, }; -impl<'a, F: Field> FpSliceMutP<'a, F> { +impl<'a, F: Field> FqSliceMut<'a, F> { pub fn prime(&self) -> ValidPrime { self.fq.characteristic().to_dyn() } @@ -93,7 +93,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { self.limbs[limb_range.end - 1] &= !max_mask; } - pub fn add(&mut self, other: FpSliceP<'_, F>, c: FieldElement) { + pub fn add(&mut self, other: FqSlice<'_, F>, c: FieldElement) { if self.as_slice().is_empty() { return; } @@ -115,14 +115,13 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } - /// `coeff` need not be reduced mod p. /// Adds v otimes w to self. pub fn add_tensor( &mut self, offset: usize, coeff: FieldElement, - left: FpSliceP, - right: FpSliceP, + left: FqSlice, + right: FqSlice, ) { let right_dim = right.len(); @@ -134,7 +133,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } /// TODO: improve efficiency - pub fn assign(&mut self, other: FpSliceP<'_, F>) { + pub fn assign(&mut self, other: FqSlice<'_, F>) { if self.as_slice().offset() != other.offset() { self.set_to_zero(); self.add(other, self.fq.one()); @@ -165,7 +164,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } /// Adds `c` * `other` to `self`. `other` must have the same length, offset, and prime as self. - pub fn add_shift_none(&mut self, other: FpSliceP<'_, F>, c: FieldElement) { + pub fn add_shift_none(&mut self, other: FqSlice<'_, F>, c: FieldElement) { let target_range = self.as_slice().limb_range(); let source_range = other.limb_range(); @@ -200,7 +199,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } - fn add_shift_left(&mut self, other: FpSliceP<'_, F>, c: FieldElement) { + fn add_shift_left(&mut self, other: FqSlice<'_, F>, c: FieldElement) { struct AddShiftLeftData { offset_shift: usize, tail_shift: usize, @@ -214,7 +213,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } impl AddShiftLeftData { - fn new(fq: F, target: FpSliceP<'_, F>, source: FpSliceP<'_, F>) -> Self { + fn new(fq: F, target: FqSlice<'_, F>, source: FqSlice<'_, F>) -> Self { debug_assert!(target.prime() == source.prime()); debug_assert!(target.offset() <= source.offset()); debug_assert!( @@ -250,24 +249,24 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } - fn mask_first_limb(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_first_limb(&self, other: FqSlice<'_, F>, i: usize) -> Limb { (other.limbs[i] & self.min_mask) >> self.offset_shift } - fn mask_middle_limb_a(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_middle_limb_a(&self, other: FqSlice<'_, F>, i: usize) -> Limb { other.limbs[i] >> self.offset_shift } - fn mask_middle_limb_b(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_middle_limb_b(&self, other: FqSlice<'_, F>, i: usize) -> Limb { (other.limbs[i] << (self.tail_shift + self.zero_bits)) >> self.zero_bits } - fn mask_last_limb_a(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_last_limb_a(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.max_mask; source_limb_masked << self.tail_shift } - fn mask_last_limb_b(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_last_limb_b(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.max_mask; source_limb_masked >> self.offset_shift } @@ -320,7 +319,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } - fn add_shift_right(&mut self, other: FpSliceP<'_, F>, c: FieldElement) { + fn add_shift_right(&mut self, other: FqSlice<'_, F>, c: FieldElement) { struct AddShiftRightData { offset_shift: usize, tail_shift: usize, @@ -334,7 +333,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } impl AddShiftRightData { - fn new(fq: F, target: FpSliceP<'_, F>, source: FpSliceP<'_, F>) -> Self { + fn new(fq: F, target: FqSlice<'_, F>, source: FqSlice<'_, F>) -> Self { debug_assert!(target.prime() == source.prime()); debug_assert!(target.offset() >= source.offset()); debug_assert!( @@ -369,30 +368,30 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } - fn mask_first_limb_a(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_first_limb_a(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.min_mask; (source_limb_masked << (self.offset_shift + self.zero_bits)) >> self.zero_bits } - fn mask_first_limb_b(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_first_limb_b(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.min_mask; source_limb_masked >> self.tail_shift } - fn mask_middle_limb_a(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_middle_limb_a(&self, other: FqSlice<'_, F>, i: usize) -> Limb { (other.limbs[i] << (self.offset_shift + self.zero_bits)) >> self.zero_bits } - fn mask_middle_limb_b(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_middle_limb_b(&self, other: FqSlice<'_, F>, i: usize) -> Limb { other.limbs[i] >> self.tail_shift } - fn mask_last_limb_a(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_last_limb_a(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.max_mask; source_limb_masked << self.offset_shift } - fn mask_last_limb_b(&self, other: FpSliceP<'_, F>, i: usize) -> Limb { + fn mask_last_limb_b(&self, other: FqSlice<'_, F>, i: usize) -> Limb { let source_limb_masked = other.limbs[i] & self.max_mask; source_limb_masked >> self.tail_shift } @@ -454,7 +453,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } /// Given a mask v, add the `v[i]`th entry of `other` to the `i`th entry of `self`. - pub fn add_masked(&mut self, other: FpSliceP<'_, F>, c: FieldElement, mask: &[usize]) { + pub fn add_masked(&mut self, other: FqSlice<'_, F>, c: FieldElement, mask: &[usize]) { // TODO: If this ends up being a bottleneck, try to use PDEP/PEXT assert_eq!(self.as_slice().len(), mask.len()); for (i, &x) in mask.iter().enumerate() { @@ -466,17 +465,17 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } /// Given a mask v, add the `i`th entry of `other` to the `v[i]`th entry of `self`. - pub fn add_unmasked(&mut self, other: FpSliceP<'_, F>, c: FieldElement, mask: &[usize]) { + pub fn add_unmasked(&mut self, other: FqSlice<'_, F>, c: FieldElement, mask: &[usize]) { assert!(other.len() <= mask.len()); for (i, v) in other.iter_nonzero() { self.add_basis_element(mask[i], v * c.clone()); } } - pub fn slice_mut(&mut self, start: usize, end: usize) -> FpSliceMutP<'_, F> { + pub fn slice_mut(&mut self, start: usize, end: usize) -> FqSliceMut<'_, F> { assert!(start <= end && end <= self.as_slice().len()); - FpSliceMutP { + FqSliceMut { fq: self.fq, limbs: &mut *self.limbs, start: self.start + start, @@ -486,8 +485,8 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { #[inline] #[must_use] - pub fn as_slice(&self) -> FpSliceP<'_, F> { - FpSliceP { + pub fn as_slice(&self) -> FqSlice<'_, F> { + FqSlice { fq: self.fq, limbs: &*self.limbs, start: self.start, @@ -498,8 +497,8 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { /// Generates a version of itself with a shorter lifetime #[inline] #[must_use] - pub fn copy(&mut self) -> FpSliceMutP<'_, F> { - FpSliceMutP { + pub fn copy(&mut self) -> FqSliceMut<'_, F> { + FqSliceMut { fq: self.fq, limbs: self.limbs, start: self.start, @@ -508,7 +507,7 @@ impl<'a, F: Field> FpSliceMutP<'a, F> { } } -impl<'a, F: Field> From<&'a mut FqVector> for FpSliceMutP<'a, F> { +impl<'a, F: Field> From<&'a mut FqVector> for FqSliceMut<'a, F> { fn from(v: &'a mut FqVector) -> Self { v.slice_mut(0, v.len) } diff --git a/ext/crates/fp/src/vector/impl_fqvector.rs b/ext/crates/fp/src/vector/impl_fqvector.rs index b97779686..b48b9eb5c 100644 --- a/ext/crates/fp/src/vector/impl_fqvector.rs +++ b/ext/crates/fp/src/vector/impl_fqvector.rs @@ -1,8 +1,8 @@ use itertools::Itertools; use super::{ - inner::{FpSliceMutP, FpSliceP, FqVector}, - iter::{FqVectorIteratorP, FqVectorNonZeroIteratorP}, + inner::{FqSlice, FqSliceMut, FqVector}, + iter::{FqVectorIterator, FqVectorNonZeroIterator}, }; use crate::{ field::{element::FieldElement, Field}, @@ -55,9 +55,9 @@ impl FqVector { } #[must_use] - pub fn slice(&self, start: usize, end: usize) -> FpSliceP<'_, F> { + pub fn slice(&self, start: usize, end: usize) -> FqSlice<'_, F> { assert!(start <= end && end <= self.len); - FpSliceP { + FqSlice { fq: self.fq, limbs: &self.limbs, start, @@ -66,9 +66,9 @@ impl FqVector { } #[must_use] - pub fn slice_mut(&mut self, start: usize, end: usize) -> FpSliceMutP<'_, F> { + pub fn slice_mut(&mut self, start: usize, end: usize) -> FqSliceMut<'_, F> { assert!(start <= end && end <= self.len); - FpSliceMutP { + FqSliceMut { fq: self.fq, limbs: &mut self.limbs, start, @@ -78,13 +78,13 @@ impl FqVector { #[inline] #[must_use] - pub fn as_slice(&self) -> FpSliceP<'_, F> { + pub fn as_slice(&self) -> FqSlice<'_, F> { self.into() } #[inline] #[must_use] - pub fn as_slice_mut(&mut self) -> FpSliceMutP<'_, F> { + pub fn as_slice_mut(&mut self) -> FqSliceMut<'_, F> { self.into() } @@ -100,11 +100,11 @@ impl FqVector { self.as_slice_mut().set_entry(index, value); } - pub fn iter(&self) -> FqVectorIteratorP<'_, F> { + pub fn iter(&self) -> FqVectorIterator<'_, F> { self.as_slice().iter() } - pub fn iter_nonzero(&self) -> FqVectorNonZeroIteratorP<'_, F> { + pub fn iter_nonzero(&self) -> FqVectorNonZeroIterator<'_, F> { self.as_slice().iter_nonzero() } diff --git a/ext/crates/fp/src/vector/inner.rs b/ext/crates/fp/src/vector/inner.rs index 6a62836b4..7a04910cb 100644 --- a/ext/crates/fp/src/vector/inner.rs +++ b/ext/crates/fp/src/vector/inner.rs @@ -5,8 +5,8 @@ use crate::{field::Field, limb::Limb}; /// An `FqVector` is a vector over a finite field. /// -/// Interally, it packs entries of the vectors into limbs. However, this is an abstraction that -/// must not leave the `fp` library. +/// Interally, it packs entries of the vectors into limbs. However, this is an abstraction that must +/// not leave the `fp` library. #[derive(Debug, Hash, Eq, PartialEq, Clone)] pub struct FqVector { pub(super) fq: F, @@ -14,21 +14,22 @@ pub struct FqVector { pub(super) limbs: Vec, } -/// A `FpSliceP` is a slice of an `FqVector`. This immutably borrows the vector and implements `Copy` +/// An `FqSlice` is a slice of an `FqVector`. This immutably borrows the vector and implements +/// `Copy` #[derive(Debug, Copy, Clone)] -pub struct FpSliceP<'a, F: Field> { +pub struct FqSlice<'a, F: Field> { pub(super) fq: F, pub(super) limbs: &'a [Limb], pub(super) start: usize, pub(super) end: usize, } -/// A `FpSliceMutP` is a mutable slice of an `FqVector`. This mutably borrows the vector. Since it -/// is a mutable borrow, it cannot implement `Copy`. However, it has a [`FpSliceMutP::copy`] function -/// that imitates the reborrowing, that mutably borrows `FpSliceMutP` and returns a `FpSliceMutP` with +/// An `FqSliceMut` is a mutable slice of an `FqVector`. This mutably borrows the vector. Since it +/// is a mutable borrow, it cannot implement `Copy`. However, it has a [`FqSliceMut::copy`] function +/// that imitates the reborrowing, that mutably borrows `FqSliceMut` and returns a `FqSliceMut` with /// a shorter lifetime. #[derive(Debug)] -pub struct FpSliceMutP<'a, F: Field> { +pub struct FqSliceMut<'a, F: Field> { pub(super) fq: F, pub(super) limbs: &'a mut [Limb], pub(super) start: usize, diff --git a/ext/crates/fp/src/vector/iter.rs b/ext/crates/fp/src/vector/iter.rs index 1128dafc6..6b68518e4 100644 --- a/ext/crates/fp/src/vector/iter.rs +++ b/ext/crates/fp/src/vector/iter.rs @@ -1,10 +1,10 @@ -use super::inner::FpSliceP; +use super::inner::FqSlice; use crate::{ field::{element::FieldElement, Field}, limb::Limb, }; -pub struct FqVectorIteratorP<'a, F> { +pub struct FqVectorIterator<'a, F> { fq: F, limbs: &'a [Limb], bit_length: usize, @@ -16,8 +16,8 @@ pub struct FqVectorIteratorP<'a, F> { counter: usize, } -impl<'a, F: Field> FqVectorIteratorP<'a, F> { - pub(super) fn new(vec: FpSliceP<'a, F>) -> Self { +impl<'a, F: Field> FqVectorIterator<'a, F> { + pub(super) fn new(vec: FqSlice<'a, F>) -> Self { let counter = vec.len(); let limbs = vec.limbs; @@ -84,7 +84,7 @@ impl<'a, F: Field> FqVectorIteratorP<'a, F> { } } -impl<'a, F: Field> Iterator for FqVectorIteratorP<'a, F> { +impl<'a, F: Field> Iterator for FqVectorIterator<'a, F> { type Item = FieldElement; fn next(&mut self) -> Option { @@ -106,7 +106,7 @@ impl<'a, F: Field> Iterator for FqVectorIteratorP<'a, F> { } } -impl<'a, F: Field> ExactSizeIterator for FqVectorIteratorP<'a, F> { +impl<'a, F: Field> ExactSizeIterator for FqVectorIterator<'a, F> { fn len(&self) -> usize { self.counter } @@ -114,7 +114,7 @@ impl<'a, F: Field> ExactSizeIterator for FqVectorIteratorP<'a, F> { /// Iterator over non-zero entries of an FpVector. This is monomorphized over the ground field for /// significant performance gains. -pub struct FqVectorNonZeroIteratorP<'a, F> { +pub struct FqVectorNonZeroIterator<'a, F> { fq: F, limbs: &'a [Limb], limb_index: usize, @@ -124,8 +124,8 @@ pub struct FqVectorNonZeroIteratorP<'a, F> { dim: usize, } -impl<'a, F: Field> FqVectorNonZeroIteratorP<'a, F> { - pub(super) fn new(vec: FpSliceP<'a, F>) -> Self { +impl<'a, F: Field> FqVectorNonZeroIterator<'a, F> { + pub(super) fn new(vec: FqSlice<'a, F>) -> Self { let entries_per_limb = vec.fq.entries_per_limb(); let dim = vec.len(); @@ -158,7 +158,7 @@ impl<'a, F: Field> FqVectorNonZeroIteratorP<'a, F> { } } -impl<'a, F: Field> Iterator for FqVectorNonZeroIteratorP<'a, F> { +impl<'a, F: Field> Iterator for FqVectorNonZeroIterator<'a, F> { type Item = (usize, FieldElement); fn next(&mut self) -> Option { diff --git a/ext/crates/fp/src/vector/mod.rs b/ext/crates/fp/src/vector/mod.rs index d1b04fc41..bb36643f6 100644 --- a/ext/crates/fp/src/vector/mod.rs +++ b/ext/crates/fp/src/vector/mod.rs @@ -1,9 +1,9 @@ pub mod inner; mod fp_wrapper; +mod impl_fqslice; +mod impl_fqslicemut; mod impl_fqvector; -mod impl_slicemutp; -mod impl_slicep; mod iter; pub use fp_wrapper::*;