Skip to main content

ReduceNonZero

Trait ReduceNonZero 

pub trait ReduceNonZero<Uint>: Sized + Reduce<Uint>
where 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

Perform a modular reduction, returning a field element.

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.

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 ReduceNonZero<Uint<crypto_bigint::::uint::U256::{constant#0}>> for airbender_crypto::p256::Scalar

§

impl ReduceNonZero<Uint<crypto_bigint::::uint::U256::{constant#0}>> for airbender_crypto::k256::Scalar

§

impl ReduceNonZero<Uint<crypto_bigint::::uint::U512::{constant#0}>> for airbender_crypto::k256::Scalar

§

impl<C, I> ReduceNonZero<I> for NonZeroScalar<C>

Note: forwards to the Reduce impl.