Trait crypto_bigint::Gcd

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

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

Compute 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 greatest common divisor of self and rhs.

Returns none unless self is odd (rhs may be even or odd)`.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Gcd for BoxedUint

Available on crate feature alloc only.
source§

impl Gcd<BoxedUint> for Odd<BoxedUint>

Available on crate feature alloc only.
source§

impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> Gcd for Uint<SAT_LIMBS>
where Odd<Self>: PrecomputeInverter<Inverter = BernsteinYangInverter<SAT_LIMBS, UNSAT_LIMBS>>,

§

type Output = CtOption<Uint<SAT_LIMBS>>

source§

impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> Gcd<Uint<SAT_LIMBS>> for Odd<Uint<SAT_LIMBS>>
where Odd<Self>: PrecomputeInverter<Inverter = BernsteinYangInverter<SAT_LIMBS, UNSAT_LIMBS>>,

§

type Output = Uint<SAT_LIMBS>