pub trait Reduce<Uint: Integer>: Sized {
type Bytes: AsRef<[u8]>;
// Required methods
fn reduce(n: Uint) -> Self;
fn reduce_bytes(bytes: &Self::Bytes) -> Self;
}
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl<C, I> Reduce<I> for NonZeroScalar<C>
impl<C, I> Reduce<I> for NonZeroScalar<C>
Note: this is a non-zero reduction, as it’s impl’d for NonZeroScalar
.