pub struct Plan { /* private fields */ }
Expand description
Negacyclic NTT plan for 64bit product of distinct primes.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn try_new(
polynomial_size: usize,
modulus: u64,
factors: impl AsRef<[u64]>,
) -> Option<Self>
pub fn try_new( polynomial_size: usize, modulus: u64, factors: impl AsRef<[u64]>, ) -> Option<Self>
Returns a negacyclic NTT plan for the given polynomial size and modulus (product of the
given distinct primes), or None
if no suitable roots of unity can be found for the
wanted parameters.
pub fn ntt_domain_len(&self) -> usize
pub fn fwd(&self, ntt: &mut [u64], standard: &[u64], mode: FwdMode)
pub fn inv(&self, standard: &mut [u64], ntt: &mut [u64], mode: InvMode)
Sourcepub fn mul_assign_normalize(&self, lhs: &mut [u64], rhs: &[u64])
pub fn mul_assign_normalize(&self, lhs: &mut [u64], rhs: &[u64])
Computes the elementwise product of lhs
and rhs
, multiplied by the inverse of the
polynomial modulo the NTT modulus, and stores the result in lhs
.
Sourcepub fn normalize(&self, values: &mut [u64])
pub fn normalize(&self, values: &mut [u64])
Multiplies the values by the inverse of the polynomial modulo the NTT modulus, and stores
the result in values
.
Sourcepub fn mul_accumulate(&self, acc: &mut [u64], lhs: &[u64], rhs: &[u64])
pub fn mul_accumulate(&self, acc: &mut [u64], lhs: &[u64], rhs: &[u64])
Computes the elementwise product of lhs
and rhs
and accumulates the result to acc
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnwindSafe for Plan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more