Trait elliptic_curve::ops::Reduce
source · pub trait Reduce<Uint: Integer>: Sized {
type Bytes: AsRef<[u8]>;
// Required methods
fn reduce(n: Uint) -> Self;
fn reduce_bytes(bytes: &Self::Bytes) -> Self;
}
Available on crate feature
arithmetic
only.Expand description
Modular reduction.
Required Associated Types§
sourcetype Bytes: AsRef<[u8]>
type Bytes: AsRef<[u8]>
Bytes used as input to Reduce::reduce_bytes
.
Required Methods§
sourcefn reduce_bytes(bytes: &Self::Bytes) -> Self
fn reduce_bytes(bytes: &Self::Bytes) -> Self
Interpret the given bytes as an integer and perform a modular reduction.
Object Safety§
This trait is not object safe.
Implementors§
source§impl<C, I> Reduce<I> for NonZeroScalar<C>where
C: CurveArithmetic,
I: Integer + ArrayEncoding,
Scalar<C>: Reduce<I> + ReduceNonZero<I>,
impl<C, I> Reduce<I> for NonZeroScalar<C>where C: CurveArithmetic, I: Integer + ArrayEncoding, Scalar<C>: Reduce<I> + ReduceNonZero<I>,
Note: this is a non-zero reduction, as it’s impl’d for NonZeroScalar
.