pub trait Inverter {
type Output;
// Required methods
fn invert(&self, value: &Self::Output) -> CtOption<Self::Output>;
fn invert_vartime(&self, value: &Self::Output) -> CtOption<Self::Output>;
}
Expand description
Trait impl’d by precomputed modular inverters obtained via the PrecomputeInverter
trait.
Required Associated Types§
Required Methods§
Sourcefn invert(&self, value: &Self::Output) -> CtOption<Self::Output>
fn invert(&self, value: &Self::Output) -> CtOption<Self::Output>
Compute a modular inversion, returning None
if the result is undefined (i.e. if value
is
zero or isn’t prime relative to the modulus).
Sourcefn invert_vartime(&self, value: &Self::Output) -> CtOption<Self::Output>
fn invert_vartime(&self, value: &Self::Output) -> CtOption<Self::Output>
Compute a modular inversion, returning None
if the result is undefined (i.e. if value
is
zero or isn’t prime relative to the modulus).
This version is variable-time with respect to value
.
Implementors§
Source§impl Inverter for BoxedSafeGcdInverter
Available on crate feature alloc
only.
impl Inverter for BoxedSafeGcdInverter
Available on crate feature
alloc
only.