pub(crate) struct BoxedSafeGcdInverter {
pub(crate) modulus: Odd<BoxedUint>,
inverse: u64,
adjuster: BoxedUint,
}Expand description
Modular multiplicative inverter based on the Bernstein-Yang method.
See super::SafeGcdInverter for more information.
Fields§
§modulus: Odd<BoxedUint>Modulus
inverse: u64Multiplicative inverse of the modulus modulo 2^62
adjuster: BoxedUintAdjusting parameter (see toplevel documentation).
Implementations§
Source§impl BoxedSafeGcdInverter
impl BoxedSafeGcdInverter
Sourcepub(crate) fn new_with_inverse(
modulus: Odd<BoxedUint>,
inverse: U64,
adjuster: BoxedUint,
) -> Self
pub(crate) fn new_with_inverse( modulus: Odd<BoxedUint>, inverse: U64, adjuster: BoxedUint, ) -> Self
Creates the inverter for specified modulus and adjusting parameter.
Modulus must be odd. Returns None if it is not.
Sourcepub(crate) fn invert(&self, value: &BoxedUint) -> CtOption<BoxedUint>
pub(crate) fn invert(&self, value: &BoxedUint) -> CtOption<BoxedUint>
Perform constant-time modular inversion.
Sourcepub(crate) fn invert_vartime(&self, value: &BoxedUint) -> CtOption<BoxedUint>
pub(crate) fn invert_vartime(&self, value: &BoxedUint) -> CtOption<BoxedUint>
Perform variable-time modular inversion.
Trait Implementations§
Source§impl Clone for BoxedSafeGcdInverter
impl Clone for BoxedSafeGcdInverter
Source§fn clone(&self) -> BoxedSafeGcdInverter
fn clone(&self) -> BoxedSafeGcdInverter
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 moreAuto Trait Implementations§
impl Freeze for BoxedSafeGcdInverter
impl RefUnwindSafe for BoxedSafeGcdInverter
impl Send for BoxedSafeGcdInverter
impl Sync for BoxedSafeGcdInverter
impl Unpin for BoxedSafeGcdInverter
impl UnsafeUnpin for BoxedSafeGcdInverter
impl UnwindSafe for BoxedSafeGcdInverter
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