Trait elliptic_curve::ops::ReduceNonZero
source · pub trait ReduceNonZero<Uint: Integer>: Reduce<Uint> + Sized {
// Required methods
fn reduce_nonzero(n: Uint) -> Self;
fn reduce_nonzero_bytes(bytes: &Self::Bytes) -> Self;
}
Expand description
Modular reduction to a non-zero output.
This trait is primarily intended for use by curve implementations such
as the k256
and p256
crates.
End users should use the Reduce
impl on
NonZeroScalar
instead.
Required Methods§
sourcefn reduce_nonzero(n: Uint) -> Self
fn reduce_nonzero(n: Uint) -> Self
Perform a modular reduction, returning a field element.
sourcefn reduce_nonzero_bytes(bytes: &Self::Bytes) -> Self
fn reduce_nonzero_bytes(bytes: &Self::Bytes) -> Self
Interpret the given bytes as an integer and perform a modular reduction to a non-zero output.
Object Safety§
This trait is not object safe.
Implementors§
impl<C, I> ReduceNonZero<I> for NonZeroScalar<C>where
Self: Reduce<I>,
C: CurveArithmetic,
I: Integer + ArrayEncoding,
Scalar<C>: Reduce<I, Bytes = Self::Bytes> + ReduceNonZero<I>,
Note: forwards to the Reduce
impl.