Skip to main content

XgcdOutput

Struct XgcdOutput 

Source
pub struct XgcdOutput<const LIMBS: usize, GCD: Copy> {
    pub gcd: GCD,
    pub x: Int<LIMBS>,
    pub y: Int<LIMBS>,
    pub lhs_on_gcd: Uint<LIMBS>,
    pub rhs_on_gcd: Uint<LIMBS>,
}
Expand description

Container for the processed output of the Binary XGCD algorithm.

Fields§

§gcd: GCD

Greatest common divisor

§x: Int<LIMBS>

x;

§y: Int<LIMBS>

y;

§lhs_on_gcd: Uint<LIMBS>

lhs / gcd

§rhs_on_gcd: Uint<LIMBS>

rhs / gcd

Implementations§

Source§

impl<const LIMBS: usize, GCD: Copy> XgcdOutput<LIMBS, GCD>

Source

pub const fn gcd(&self) -> GCD

The greatest common divisor stored in this object.

Source

pub const fn bezout_coefficients(&self) -> (Int<LIMBS>, Int<LIMBS>)

Obtain a copy of the Bézout coefficients.

Source

pub const fn quotients(&self) -> (Uint<LIMBS>, Uint<LIMBS>)

Obtain a copy of the quotients lhs/gcd and rhs/gcd.

Source§

impl<const LIMBS: usize> XgcdOutput<LIMBS, OddUint<LIMBS>>

Source

pub(crate) const fn from_pattern_output( output: RawXgcdOutput<LIMBS, PatternMatrix<LIMBS>>, ) -> Self

Source

pub(crate) const fn to_nz_output( self, k: u32, swap: Choice, ) -> XgcdOutput<LIMBS, NonZeroUint<LIMBS>>

Trait Implementations§

Source§

impl<const LIMBS: usize, GCD: Clone + Copy> Clone for XgcdOutput<LIMBS, GCD>

Source§

fn clone(&self) -> XgcdOutput<LIMBS, GCD>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const LIMBS: usize, GCD: Debug + Copy> Debug for XgcdOutput<LIMBS, GCD>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const LIMBS: usize, GCD: Copy + Copy> Copy for XgcdOutput<LIMBS, GCD>

Auto Trait Implementations§

§

impl<const LIMBS: usize, GCD> Freeze for XgcdOutput<LIMBS, GCD>
where GCD: Freeze,

§

impl<const LIMBS: usize, GCD> RefUnwindSafe for XgcdOutput<LIMBS, GCD>
where GCD: RefUnwindSafe,

§

impl<const LIMBS: usize, GCD> Send for XgcdOutput<LIMBS, GCD>
where GCD: Send,

§

impl<const LIMBS: usize, GCD> Sync for XgcdOutput<LIMBS, GCD>
where GCD: Sync,

§

impl<const LIMBS: usize, GCD> Unpin for XgcdOutput<LIMBS, GCD>
where GCD: Unpin,

§

impl<const LIMBS: usize, GCD> UnsafeUnpin for XgcdOutput<LIMBS, GCD>
where GCD: UnsafeUnpin,

§

impl<const LIMBS: usize, GCD> UnwindSafe for XgcdOutput<LIMBS, GCD>
where GCD: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.