Skip to main content

MontyMultiplier

Trait MontyMultiplier 

Source
pub trait MontyMultiplier<'a>: From<&'a <Self::Monty as MontyForm>::Params> {
    type Monty: MontyForm;

    // Required methods
    fn mul_assign(&mut self, lhs: &mut Self::Monty, rhs: &Self::Monty);
    fn square_assign(&mut self, lhs: &mut Self::Monty);
}
Expand description

Prepared Montgomery multiplier for tight loops.

Allows one to perform inplace multiplication without allocations (important for the BoxedUint case).

NOTE: You will be operating with Montgomery representations directly, make sure they all correspond to the same set of parameters.

Required Associated Types§

Source

type Monty: MontyForm

The associated Montgomery-representation integer.

Required Methods§

Source

fn mul_assign(&mut self, lhs: &mut Self::Monty, rhs: &Self::Monty)

Performs a Montgomery multiplication, assigning a fully reduced result to lhs.

Source

fn square_assign(&mut self, lhs: &mut Self::Monty)

Performs a Montgomery squaring, assigning a fully reduced result to lhs.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§