Skip to main content

AmmMultiplier

Trait AmmMultiplier 

Source
pub(crate) trait AmmMultiplier<'a>: MontyMultiplier<'a> {
    // Required methods
    fn mul_amm_assign(
        &mut self,
        a: &mut <Self::Monty as MontyForm>::Integer,
        b: &<Self::Monty as MontyForm>::Integer,
    );
    fn square_amm_assign(&mut self, a: &mut <Self::Monty as MontyForm>::Integer);
}
Expand description

Prepared Montgomery multiplier for tight loops, performing “Almost Montgomery Multiplication”.

NOTE: the resulting output of any of these functions will be reduced to the bit length of the modulus, but not fully reduced and may exceed the modulus. A final reduction is required to ensure AMM results are fully reduced, and should not be exposed outside the internals of this crate.

Required Methods§

Source

fn mul_amm_assign( &mut self, a: &mut <Self::Monty as MontyForm>::Integer, b: &<Self::Monty as MontyForm>::Integer, )

Perform an “Almost Montgomery Multiplication”, assigning the product to a.

Source

fn square_amm_assign(&mut self, a: &mut <Self::Monty as MontyForm>::Integer)

Perform a squaring using “Almost Montgomery Multiplication”, assigning the result to a.

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<'a> AmmMultiplier<'a> for BoxedMontyMultiplier<'a>

Source§

impl<'a, const LIMBS: usize> AmmMultiplier<'a> for FixedMontyMultiplier<'a, LIMBS>