Trait elliptic_curve::ops::Reduce
source · [−]pub trait Reduce<UInt: Integer + ArrayEncoding>: Sized {
fn from_uint_reduced(n: UInt) -> Self;
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> + BlockInput + Clone + Default + Reset + Update,
{ ... }
fn from_le_digest_reduced<D>(digest: D) -> Self
where
D: FixedOutput<OutputSize = UInt::ByteSize> + BlockInput + Clone + Default + Reset + Update,
{ ... }
}
Expand description
Modular reduction.
Required methods
fn from_uint_reduced(n: UInt) -> Self
fn from_uint_reduced(n: UInt) -> Self
Perform a modular reduction, returning a field element.
Provided methods
fn 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.
fn 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.
fn from_be_digest_reduced<D>(digest: D) -> Self where
D: FixedOutput<OutputSize = UInt::ByteSize> + BlockInput + Clone + Default + Reset + Update,
fn from_be_digest_reduced<D>(digest: D) -> Self where
D: FixedOutput<OutputSize = UInt::ByteSize> + BlockInput + Clone + Default + Reset + Update,
This is supported on crate feature
digest
only.Interpret a digest as a big endian integer and perform a modular reduction.
fn from_le_digest_reduced<D>(digest: D) -> Self where
D: FixedOutput<OutputSize = UInt::ByteSize> + BlockInput + Clone + Default + Reset + Update,
fn from_le_digest_reduced<D>(digest: D) -> Self where
D: FixedOutput<OutputSize = UInt::ByteSize> + BlockInput + Clone + Default + Reset + Update,
This is supported on crate feature
digest
only.Interpret a digest as a little endian integer and perform a modular reduction.
Implementors
impl<C, I> Reduce<I> for NonZeroScalar<C> where
C: Curve + ScalarArithmetic,
I: Integer + ArrayEncoding,
Scalar<C>: ReduceNonZero<I>,
Note: implementation is the same as ReduceNonZero