pub struct FixedMontgomery32<const P: u32>;Expand description
A modular reducer based on Montgomery form
for 32-bit operands, with the modulus P known at compile time.
§Example
use num_modular::{FixedMontgomery32, Reducer};
const P: u32 = 17;
let reducer = FixedMontgomery32::<P>::new(&P);
let a = reducer.transform(3);
let b = reducer.transform(5);
assert_eq!(reducer.residue(reducer.mul(&a, &b)), 15);Implementations§
Trait Implementations§
Source§impl<const P: u32> Clone for FixedMontgomery32<P>
impl<const P: u32> Clone for FixedMontgomery32<P>
Source§fn clone(&self) -> FixedMontgomery32<P>
fn clone(&self) -> FixedMontgomery32<P>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<const P: u32> Copy for FixedMontgomery32<P>
Source§impl<const P: u32> Debug for FixedMontgomery32<P>
impl<const P: u32> Debug for FixedMontgomery32<P>
Source§impl<const P: u32> Reducer<u32> for FixedMontgomery32<P>
impl<const P: u32> Reducer<u32> for FixedMontgomery32<P>
Auto Trait Implementations§
impl<const P: u32> Freeze for FixedMontgomery32<P>
impl<const P: u32> RefUnwindSafe for FixedMontgomery32<P>
impl<const P: u32> Send for FixedMontgomery32<P>
impl<const P: u32> Sync for FixedMontgomery32<P>
impl<const P: u32> Unpin for FixedMontgomery32<P>
impl<const P: u32> UnsafeUnpin for FixedMontgomery32<P>
impl<const P: u32> UnwindSafe for FixedMontgomery32<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more