pub struct MontyParams<const LIMBS: usize> { /* private fields */ }
Expand description
Parameters to efficiently go to/from the Montgomery form for an odd modulus provided at runtime.
Implementations§
Source§impl<const LIMBS: usize, const WIDE_LIMBS: usize> MontyParams<LIMBS>
impl<const LIMBS: usize, const WIDE_LIMBS: usize> MontyParams<LIMBS>
Source§impl<const LIMBS: usize> MontyParams<LIMBS>
impl<const LIMBS: usize> MontyParams<LIMBS>
Sourcepub fn new_vartime(modulus: Odd<Uint<LIMBS>>) -> Self
pub fn new_vartime(modulus: Odd<Uint<LIMBS>>) -> Self
Instantiates a new set of MontyParams
representing the given odd modulus
.
Sourcepub const fn modulus(&self) -> &Odd<Uint<LIMBS>>
pub const fn modulus(&self) -> &Odd<Uint<LIMBS>>
Returns the modulus which was used to initialize these parameters.
Sourcepub const fn from_const_params<P>() -> Selfwhere
P: ConstMontyParams<LIMBS>,
pub const fn from_const_params<P>() -> Selfwhere
P: ConstMontyParams<LIMBS>,
Create MontyParams
corresponding to a ConstMontyParams
.
Trait Implementations§
Source§impl<const LIMBS: usize> Clone for MontyParams<LIMBS>
impl<const LIMBS: usize> Clone for MontyParams<LIMBS>
Source§fn clone(&self) -> MontyParams<LIMBS>
fn clone(&self) -> MontyParams<LIMBS>
Returns a copy 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 MontyParams<LIMBS>
impl<const LIMBS: usize> ConditionallySelectable for MontyParams<LIMBS>
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
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 MontyParams<LIMBS>
impl<const LIMBS: usize> ConstantTimeEq for MontyParams<LIMBS>
Source§impl<const LIMBS: usize> Debug for MontyParams<LIMBS>
impl<const LIMBS: usize> Debug for MontyParams<LIMBS>
Source§impl<const LIMBS: usize> PartialEq for MontyParams<LIMBS>
impl<const LIMBS: usize> PartialEq for MontyParams<LIMBS>
Source§impl<const LIMBS: usize> PrecomputeInverter for MontyParams<LIMBS>where
Odd<Uint<LIMBS>>: PrecomputeInverter<Output = Uint<LIMBS>> + PrecomputeInverterWithAdjuster<Uint<LIMBS>>,
impl<const LIMBS: usize> PrecomputeInverter for MontyParams<LIMBS>where
Odd<Uint<LIMBS>>: PrecomputeInverter<Output = Uint<LIMBS>> + PrecomputeInverterWithAdjuster<Uint<LIMBS>>,
Source§type Inverter = MontyFormInverter<LIMBS>
type Inverter = MontyFormInverter<LIMBS>
Inverter type for integers of this size.
Source§fn precompute_inverter(&self) -> MontyFormInverter<LIMBS>
fn precompute_inverter(&self) -> MontyFormInverter<LIMBS>
Obtain a precomputed inverter for
&self
as the modulus, using Self::one()
as an adjusting parameter. Read moreSource§impl<const LIMBS: usize> Zeroize for MontyParams<LIMBS>
Available on crate feature zeroize
only.
impl<const LIMBS: usize> Zeroize for MontyParams<LIMBS>
Available on crate feature
zeroize
only.impl<const LIMBS: usize> Copy for MontyParams<LIMBS>
impl<const LIMBS: usize> Eq for MontyParams<LIMBS>
impl<const LIMBS: usize> StructuralPartialEq for MontyParams<LIMBS>
Auto Trait Implementations§
impl<const LIMBS: usize> Freeze for MontyParams<LIMBS>
impl<const LIMBS: usize> RefUnwindSafe for MontyParams<LIMBS>
impl<const LIMBS: usize> Send for MontyParams<LIMBS>
impl<const LIMBS: usize> Sync for MontyParams<LIMBS>
impl<const LIMBS: usize> Unpin for MontyParams<LIMBS>
impl<const LIMBS: usize> UnwindSafe for MontyParams<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