crypto_bigint

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.

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 = SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>,

source§

type Output = 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 = SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>,

source§

type Output = Uint<SAT_LIMBS>