Skip to main content

Reduce

Trait Reduce 

Source
pub trait Reduce<T>: Sized {
    // Required method
    fn reduce(value: &T) -> Self;
}
Expand description

Modular reduction from a larger value T.

This can be seen as fixed modular reduction, where the modulus is fixed at compile time by Self.

For modular reduction with a variable modulus, use Rem.

Required Methods§

Source

fn reduce(value: &T) -> Self

Reduces self modulo Modulus.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const LIMBS: usize, MOD> Reduce<Uint<LIMBS>> for ConstMontyForm<MOD, LIMBS>
where MOD: ConstMontyParams<LIMBS>,