pub struct BoxedMontyParams(Arc<MontyParams<BoxedUint>>);Expand description
Parameters to efficiently go to/from the Montgomery form for an odd modulus whose size and value are both chosen at runtime.
Tuple Fields§
§0: Arc<MontyParams<BoxedUint>>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.
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.
This version operates in variable-time with respect to the modulus.
TODO(tarcieri): DRY out with MontyParams::new_vartime?
Sourcepub fn bits_precision(&self) -> u32
pub fn bits_precision(&self) -> u32
Bits of precision in the modulus.
pub(crate) fn r2(&self) -> &BoxedUint
pub(crate) fn one(&self) -> &BoxedUint
pub(crate) fn mod_inv(&self) -> U64
pub(crate) fn mod_neg_inv(&self) -> Limb
pub(crate) fn mod_leading_zeros(&self) -> u32
Source§impl BoxedMontyParams
impl BoxedMontyParams
Sourcefn inverter(&self) -> BoxedSafeGcdInverter
fn inverter(&self) -> BoxedSafeGcdInverter
Compute the inverter for these params.
Trait Implementations§
Source§impl AsRef<MontyParams<BoxedUint>> for BoxedMontyParams
impl AsRef<MontyParams<BoxedUint>> for BoxedMontyParams
Source§fn as_ref(&self) -> &MontyParams<BoxedUint>
fn as_ref(&self) -> &MontyParams<BoxedUint>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for BoxedMontyParams
impl Clone for BoxedMontyParams
Source§fn clone(&self) -> BoxedMontyParams
fn clone(&self) -> BoxedMontyParams
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 CtAssign for BoxedMontyParams
impl CtAssign for BoxedMontyParams
Source§impl CtEq for BoxedMontyParams
impl CtEq for BoxedMontyParams
Source§impl CtEqSlice for BoxedMontyParams
impl CtEqSlice for BoxedMontyParams
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 CtSelect for BoxedMontyParams
impl CtSelect for BoxedMontyParams
Source§impl Debug for BoxedMontyParams
impl Debug for BoxedMontyParams
Source§impl<'a> From<&'a BoxedMontyParams> for BoxedMontyMultiplier<'a>
impl<'a> From<&'a BoxedMontyParams> for BoxedMontyMultiplier<'a>
Source§fn from(params: &'a BoxedMontyParams) -> BoxedMontyMultiplier<'a>
fn from(params: &'a BoxedMontyParams) -> BoxedMontyMultiplier<'a>
Converts to this type from the input type.
Source§impl<const LIMBS: usize> From<&MontyParams<Uint<LIMBS>>> for BoxedMontyParams
impl<const LIMBS: usize> From<&MontyParams<Uint<LIMBS>>> for BoxedMontyParams
Source§fn from(params: &FixedMontyParams<LIMBS>) -> Self
fn from(params: &FixedMontyParams<LIMBS>) -> Self
Converts to this type from the input type.
Source§impl From<MontyParams<BoxedUint>> for BoxedMontyParams
impl From<MontyParams<BoxedUint>> for BoxedMontyParams
Source§fn from(params: MontyParams<BoxedUint>) -> Self
fn from(params: MontyParams<BoxedUint>) -> Self
Converts to this type from the input type.
Source§impl<const LIMBS: usize> From<MontyParams<Uint<LIMBS>>> for BoxedMontyParams
impl<const LIMBS: usize> From<MontyParams<Uint<LIMBS>>> for BoxedMontyParams
Source§fn from(params: FixedMontyParams<LIMBS>) -> Self
fn from(params: FixedMontyParams<LIMBS>) -> Self
Converts to this type from the input type.
Source§impl PartialEq for BoxedMontyParams
impl PartialEq for BoxedMontyParams
impl 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 UnsafeUnpin 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