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§
Required Methods§
Sourcefn mul_assign(&mut self, lhs: &mut Self::Monty, rhs: &Self::Monty)
fn mul_assign(&mut self, lhs: &mut Self::Monty, rhs: &Self::Monty)
Performs a Montgomery multiplication, assigning a fully reduced result to lhs.
Sourcefn square_assign(&mut self, lhs: &mut Self::Monty)
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".