pub(super) trait Limbs:
Sized
+ Clone
+ AsRef<[Limb]>
+ AsMut<[Limb]> {
// Required methods
fn widening_square(&self) -> (Self, Self);
fn wrapping_div(num: (Self, Self), denom: &Self) -> Self;
fn rem(num: Self, denom: &Self) -> Self;
}Expand description
The required view over a collection of limbs to calculate the c coefficient.
Implementations MUST implement all functions in time constant to the value of the inputs, except for the amount of limbs, unless otherwise stated. Implementations MUST NOT panic for any input which the caller MAY pass.
Required Methods§
Sourcefn widening_square(&self) -> (Self, Self)
fn widening_square(&self) -> (Self, Self)
Square the value, returning the (lo, hi) terms.
Implementations MUST ensure each part of the result has an amount of limbs equal to how many limbs the input has.
Sourcefn wrapping_div(num: (Self, Self), denom: &Self) -> Self
fn wrapping_div(num: (Self, Self), denom: &Self) -> Self
Divide num by denom, returning the low bits.
Callers MUST ensure both parts of the numerator have an equivalent amount of limbs. Callers
MUST NOT request a division by 0.
Implementations MUST ensure the result has an amount of limbs equal to how many limbs each part of the input has.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Limbs for BoxedUint
Available on crate feature alloc only.
impl Limbs for BoxedUint
alloc only.