Skip to main content

Gcd

Trait Gcd 

Source
pub trait Gcd<Rhs = Self>: Sized {
    type Output;

    // Required methods
    fn gcd(&self, rhs: &Rhs) -> Self::Output;
    fn gcd_vartime(&self, rhs: &Rhs) -> Self::Output;
}
Expand description

Compute the greatest common divisor of two integers.

Required Associated Types§

Source

type Output

Output type.

Required Methods§

Source

fn gcd(&self, rhs: &Rhs) -> Self::Output

Compute the greatest common divisor of self and rhs.

Source

fn gcd_vartime(&self, rhs: &Rhs) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Gcd for BoxedUint

Source§

impl Gcd for Limb

Source§

impl Gcd<BoxedUint> for NonZero<BoxedUint>

Source§

impl Gcd<BoxedUint> for Odd<BoxedUint>

Source§

impl Gcd<Limb> for NonZero<Limb>

Source§

impl Gcd<Limb> for Odd<Limb>

Source§

impl<const LIMBS: usize> Gcd for Int<LIMBS>

Source§

type Output = Uint<LIMBS>

Source§

impl<const LIMBS: usize> Gcd for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Source§

impl<const LIMBS: usize> Gcd for NonZeroInt<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd for NonZeroUint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd for OddInt<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd for OddUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Int<LIMBS>> for Uint<LIMBS>

Source§

type Output = Uint<LIMBS>

Source§

impl<const LIMBS: usize> Gcd<Int<LIMBS>> for NonZeroInt<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Int<LIMBS>> for OddInt<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<NonZero<Int<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Int<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for Uint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<NonZero<Uint<LIMBS>>> for OddUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Odd<Int<LIMBS>>> for Uint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Odd<Uint<LIMBS>>> for Int<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Odd<Uint<LIMBS>>> for NonZeroUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for Int<LIMBS>

Source§

type Output = Uint<LIMBS>

Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for NonZeroInt<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for NonZeroUint<LIMBS>

Source§

type Output = NonZero<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for OddInt<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>

Source§

impl<const LIMBS: usize> Gcd<Uint<LIMBS>> for OddUint<LIMBS>

Source§

type Output = Odd<Uint<LIMBS>>