Trait generic_ec::traits::Reduce

source ·
pub trait Reduce<const N: usize> {
    // Required methods
    fn from_be_array_mod_order(bytes: &[u8; N]) -> Self;
    fn from_le_array_mod_order(bytes: &[u8; N]) -> Self;
}
Expand description

Reduces an integer represented as array of N bytes modulo curve (prime) order

Required Methods§

source

fn from_be_array_mod_order(bytes: &[u8; N]) -> Self

Interprets bytes as big-endian encoding of an integer, returns this integer modulo curve (prime) order

source

fn from_le_array_mod_order(bytes: &[u8; N]) -> Self

Interprets bytes as little-endian encoding of an integer, returns this integer modulo curve (prime) order

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Reduce<32> for Scalar

source§

impl Reduce<64> for Scalar

source§

impl<E> Reduce<32> for RustCryptoScalar<E>
where E: CurveArithmetic + Curve, <E as CurveArithmetic>::Scalar: Reduce<Uint<crypto_bigint::::uint::U256::{constant#0}>>,

source§

impl<E> Reduce<64> for RustCryptoScalar<E>
where E: CurveArithmetic + Curve, <E as CurveArithmetic>::Scalar: Reduce<Uint<crypto_bigint::::uint::U512::{constant#0}>>,

Implementors§

source§

impl<E: Curve, const N: usize> Reduce<N> for generic_ec::Scalar<E>
where E::Scalar: Reduce<N>,