pub trait Reduce<UInt: Integer + ArrayEncoding>: Sized {
// Required method
fn from_uint_reduced(n: UInt) -> Self;
// Provided methods
fn from_be_bytes_reduced(bytes: ByteArray<UInt>) -> Self { ... }
fn from_le_bytes_reduced(bytes: ByteArray<UInt>) -> Self { ... }
fn from_be_digest_reduced<D>(digest: D) -> Self
where D: FixedOutput<OutputSize = UInt::ByteSize> { ... }
fn from_le_digest_reduced<D>(digest: D) -> Self
where D: FixedOutput<OutputSize = UInt::ByteSize> { ... }
}
Expand description
Modular reduction.
Required Methods§
Sourcefn from_uint_reduced(n: UInt) -> Self
fn from_uint_reduced(n: UInt) -> Self
Perform a modular reduction, returning a field element.
Provided Methods§
Sourcefn from_be_bytes_reduced(bytes: ByteArray<UInt>) -> Self
fn from_be_bytes_reduced(bytes: ByteArray<UInt>) -> Self
Interpret the given byte array as a big endian integer and perform a modular reduction.
Sourcefn from_le_bytes_reduced(bytes: ByteArray<UInt>) -> Self
fn from_le_bytes_reduced(bytes: ByteArray<UInt>) -> Self
Interpret the given byte array as a little endian integer and perform a modular reduction.
Sourcefn from_be_digest_reduced<D>(digest: D) -> Selfwhere
D: FixedOutput<OutputSize = UInt::ByteSize>,
fn from_be_digest_reduced<D>(digest: D) -> Selfwhere
D: FixedOutput<OutputSize = UInt::ByteSize>,
Interpret a digest as a big endian integer and perform a modular reduction.
Sourcefn from_le_digest_reduced<D>(digest: D) -> Selfwhere
D: FixedOutput<OutputSize = UInt::ByteSize>,
fn from_le_digest_reduced<D>(digest: D) -> Selfwhere
D: FixedOutput<OutputSize = UInt::ByteSize>,
Interpret a digest as a little endian 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§
impl<C, I> Reduce<I> for NonZeroScalar<C>
Note: implementation is the same as ReduceNonZero