pub enum NPrimeMethod {
TrialSearch,
ExtendedEuclidean,
HenselsLifting,
Newton,
}Expand description
Methods for computing N’ in Montgomery parameter computation
Variants§
TrialSearch
Trial search - O(R) complexity, simple but slow for large R. Only works when R fits in the type (R > N, smallest power of 2).
ExtendedEuclidean
Extended Euclidean Algorithm - O(log R) complexity. Only works when R fits in the type (R > N, smallest power of 2).
HenselsLifting
Hensel’s lifting - O(log R) complexity, optimized for R = 2^k. Only works when R fits in the type (R > N, smallest power of 2).
Newton
Newton’s method - O(log W) complexity, works with R = 2^W (full type width). Uses wrapping arithmetic so R never needs to be represented explicitly. This is the method used internally by the wide-REDC path; other methods are accepted for API compatibility but all use Newton internally.
Trait Implementations§
Source§impl Clone for NPrimeMethod
impl Clone for NPrimeMethod
Source§fn clone(&self) -> NPrimeMethod
fn clone(&self) -> NPrimeMethod
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NPrimeMethod
impl Debug for NPrimeMethod
Source§impl Default for NPrimeMethod
impl Default for NPrimeMethod
Source§fn default() -> NPrimeMethod
fn default() -> NPrimeMethod
Returns the “default value” for a type. Read more
Source§impl PartialEq for NPrimeMethod
impl PartialEq for NPrimeMethod
impl Copy for NPrimeMethod
impl Eq for NPrimeMethod
impl StructuralPartialEq for NPrimeMethod
Auto Trait Implementations§
impl Freeze for NPrimeMethod
impl RefUnwindSafe for NPrimeMethod
impl Send for NPrimeMethod
impl Sync for NPrimeMethod
impl Unpin for NPrimeMethod
impl UnsafeUnpin for NPrimeMethod
impl UnwindSafe for NPrimeMethod
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