pub struct BoxedMontyParams(/* private fields */);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.
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.
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§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
impl Eq for BoxedMontyParams
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 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