pub struct PrimeParams<const LIMBS: usize> { /* private fields */ }Expand description
Parameters for supporting efficient computations on integers in Montgomery form with a prime modulus.
Implementations§
Source§impl<const LIMBS: usize> PrimeParams<LIMBS>
impl<const LIMBS: usize> PrimeParams<LIMBS>
Sourcepub const fn new_vartime(
params: &FixedMontyParams<LIMBS>,
generator: u32,
) -> Self
pub const fn new_vartime( params: &FixedMontyParams<LIMBS>, generator: u32, ) -> Self
Instantiates a new set of PrimeParams given FixedMontyParams for a prime modulus.
The value generator must be a multiplicative generator (ie. primitive element) of the
finite field, having order modulus-1. Its powers generate all nonzero elements of the
field: generator^0, generator^1, ..., generator^(modulus-2) enumerate [1, modulus-1].
Sourcepub const fn generator(&self) -> NonZeroU32
pub const fn generator(&self) -> NonZeroU32
Get the constant ‘generator’ used in modular square root calculation.
Sourcepub const fn s(&self) -> NonZeroU32
pub const fn s(&self) -> NonZeroU32
Get the constant ‘s’ used in modular square root calculation.
Trait Implementations§
Source§impl<const LIMBS: usize> Clone for PrimeParams<LIMBS>
impl<const LIMBS: usize> Clone for PrimeParams<LIMBS>
Source§fn clone(&self) -> PrimeParams<LIMBS>
fn clone(&self) -> PrimeParams<LIMBS>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const LIMBS: usize> ConditionallySelectable for PrimeParams<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConditionallySelectable for PrimeParams<LIMBS>
Available on crate feature
subtle only.Source§fn conditional_assign(&mut self, src: &Self, choice: Choice)
fn conditional_assign(&mut self, src: &Self, choice: Choice)
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
Conditionally swap
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<const LIMBS: usize> ConstantTimeEq for PrimeParams<LIMBS>
Available on crate feature subtle only.
impl<const LIMBS: usize> ConstantTimeEq for PrimeParams<LIMBS>
Available on crate feature
subtle only.Source§impl<const LIMBS: usize> CtAssign for PrimeParams<LIMBS>
impl<const LIMBS: usize> CtAssign for PrimeParams<LIMBS>
Source§impl<const LIMBS: usize> CtAssignSlice for PrimeParams<LIMBS>
impl<const LIMBS: usize> CtAssignSlice for PrimeParams<LIMBS>
Source§fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
fn ct_assign_slice(dst: &mut [Self], src: &[Self], choice: Choice)
Source§impl<const LIMBS: usize> CtEq for PrimeParams<LIMBS>
impl<const LIMBS: usize> CtEq for PrimeParams<LIMBS>
Source§impl<const LIMBS: usize> CtEqSlice for PrimeParams<LIMBS>
impl<const LIMBS: usize> CtEqSlice for PrimeParams<LIMBS>
Source§fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_eq_slice(a: &[Self], b: &[Self]) -> Choice
Determine if
a is equal to b in constant-time.Source§fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
fn ct_ne_slice(a: &[Self], b: &[Self]) -> Choice
Determine if
a is NOT equal to b in constant-time.Source§impl<const LIMBS: usize> Debug for PrimeParams<LIMBS>
impl<const LIMBS: usize> Debug for PrimeParams<LIMBS>
impl<const LIMBS: usize> Copy for PrimeParams<LIMBS>
impl<const LIMBS: usize> CtSelectUsingCtAssign for PrimeParams<LIMBS>
Auto Trait Implementations§
impl<const LIMBS: usize> Freeze for PrimeParams<LIMBS>
impl<const LIMBS: usize> RefUnwindSafe for PrimeParams<LIMBS>
impl<const LIMBS: usize> Send for PrimeParams<LIMBS>
impl<const LIMBS: usize> Sync for PrimeParams<LIMBS>
impl<const LIMBS: usize> Unpin for PrimeParams<LIMBS>
impl<const LIMBS: usize> UnsafeUnpin for PrimeParams<LIMBS>
impl<const LIMBS: usize> UnwindSafe for PrimeParams<LIMBS>
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