pub struct BoxedMontyParams { /* private fields */ }
Available on crate feature
alloc
only.Expand description
Parameters to efficiently go to/from the Montgomery form for an odd modulus whose size and value are both chosen at runtime.
Implementations§
Source§impl BoxedMontyParams
impl BoxedMontyParams
Sourcepub fn new(modulus: Odd<BoxedUint>) -> Self
pub fn new(modulus: Odd<BoxedUint>) -> Self
Instantiates a new set of BoxedMontyParams
representing the given modulus
, which
must be odd.
Returns a CtOption
that is None
if the provided modulus is not odd.
TODO(tarcieri): DRY out with MontyParams::new
?
Sourcepub fn new_vartime(modulus: Odd<BoxedUint>) -> Self
pub fn new_vartime(modulus: Odd<BoxedUint>) -> Self
Instantiates a new set of BoxedMontyParams
representing the given modulus
, which
must be odd. This version operates in variable-time with respect to the modulus.
Returns None
if the provided modulus is not odd.
TODO(tarcieri): DRY out with MontyParams::new
?
Sourcepub fn bits_precision(&self) -> u32
pub fn bits_precision(&self) -> u32
Bits of precision in the modulus.
Sourcepub fn from_const_params<const LIMBS: usize, P: ConstMontyParams<LIMBS>>() -> Self
pub fn from_const_params<const LIMBS: usize, P: ConstMontyParams<LIMBS>>() -> Self
Create from a set of ConstMontyParams
.
Trait Implementations§
Source§impl Clone for BoxedMontyParams
impl Clone for BoxedMontyParams
Source§fn clone(&self) -> BoxedMontyParams
fn clone(&self) -> BoxedMontyParams
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 Debug for BoxedMontyParams
impl Debug for BoxedMontyParams
Source§impl PartialEq for BoxedMontyParams
impl PartialEq for BoxedMontyParams
Source§impl PrecomputeInverter for BoxedMontyParams
impl PrecomputeInverter for BoxedMontyParams
Source§type Output = BoxedMontyForm
type Output = BoxedMontyForm
Output produced by the inverter.
Source§fn precompute_inverter(&self) -> BoxedMontyFormInverter
fn precompute_inverter(&self) -> BoxedMontyFormInverter
Obtain a precomputed inverter for
&self
as the modulus, using Self::one()
as an adjusting parameter. Read moreimpl Eq for BoxedMontyParams
impl StructuralPartialEq for BoxedMontyParams
Auto Trait Implementations§
impl Freeze for BoxedMontyParams
impl RefUnwindSafe for BoxedMontyParams
impl Send for BoxedMontyParams
impl Sync for BoxedMontyParams
impl Unpin for BoxedMontyParams
impl UnwindSafe for BoxedMontyParams
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