pub struct NttOperator { /* private fields */ }Expand description
Number-Theoretic Transform operator.
Implementations§
Source§impl NttOperator
impl NttOperator
Sourcepub fn new(p: &Modulus, size: usize) -> Option<Self>
pub fn new(p: &Modulus, size: usize) -> Option<Self>
Create an NTT operator given a modulus for a specific size.
Aborts if the size is not a power of 2 that is >= 8 in debug mode. Returns None if the modulus does not support the NTT for this specific size.
Sourcepub fn forward(&self, a: &mut [u64])
pub fn forward(&self, a: &mut [u64])
Compute the forward NTT in place. Aborts if a is not of the size handled by the operator.
Sourcepub fn backward(&self, a: &mut [u64])
pub fn backward(&self, a: &mut [u64])
Compute the backward NTT in place. Aborts if a is not of the size handled by the operator.
Sourcepub unsafe fn forward_vt(&self, a_ptr: *mut u64)
pub unsafe fn forward_vt(&self, a_ptr: *mut u64)
Compute the forward NTT in place in variable time.
§Safety
This function assumes that a_ptr points to at least size elements.
This function is not constant time and its timing may reveal information
about the value being reduced.
Sourcepub unsafe fn backward_vt(&self, a_ptr: *mut u64)
pub unsafe fn backward_vt(&self, a_ptr: *mut u64)
Compute the backward NTT in place in variable time.
§Safety
This function assumes that a_ptr points to at least size elements.
This function is not constant time and its timing may reveal information
about the value being reduced.
Trait Implementations§
Source§impl Clone for NttOperator
impl Clone for NttOperator
Source§fn clone(&self) -> NttOperator
fn clone(&self) -> NttOperator
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NttOperator
impl Debug for NttOperator
Source§impl PartialEq for NttOperator
impl PartialEq for NttOperator
impl Eq for NttOperator
impl StructuralPartialEq for NttOperator
Auto Trait Implementations§
impl Freeze for NttOperator
impl RefUnwindSafe for NttOperator
impl Send for NttOperator
impl Sync for NttOperator
impl Unpin for NttOperator
impl UnwindSafe for NttOperator
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more