Trait oberon::inner_types::elliptic_curve::ops::ReduceNonZero
pub trait ReduceNonZero<Uint>: Reduce<Uint> + Sizedwhere
Uint: Integer,{
// 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§
fn reduce_nonzero(n: Uint) -> Self
fn reduce_nonzero(n: Uint) -> Self
Perform a modular reduction, returning a field element.
fn 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.
Implementors§
impl<C, I> ReduceNonZero<I> for NonZeroScalar<C>where NonZeroScalar<C>: Reduce<I>, C: CurveArithmetic, I: Integer + ArrayEncoding, <C as CurveArithmetic>::Scalar: Reduce<I, Bytes = <NonZeroScalar<C> as Reduce<I>>::Bytes> + ReduceNonZero<I>,
Note: forwards to the Reduce
impl.