Skip to main content

FromUintUnchecked

Trait FromUintUnchecked 

pub trait FromUintUnchecked {
    type Uint: Integer;

    // Required method
    fn from_uint_unchecked(uint: Self::Uint) -> Self;
}
Expand description

Instantiate a scalar from an unsigned integer without checking for overflow.

Required Associated Types§

type Uint: Integer

Unsigned integer type (i.e. Curve::Uint)

Required Methods§

fn from_uint_unchecked(uint: Self::Uint) -> Self

Instantiate scalar from an unsigned integer without checking whether the value overflows the field modulus.

⚠️ WARNING!

Incorrectly used this can lead to mathematically invalid results, which can lead to potential security vulnerabilities.

Use with care!

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 FromUintUnchecked for airbender_crypto::k256::Scalar

§

type Uint = Uint<crypto_bigint::::uint::U256::{constant#0}>

§

impl FromUintUnchecked for airbender_crypto::p256::Scalar

§

type Uint = Uint<crypto_bigint::::uint::U256::{constant#0}>

§

impl<C> FromUintUnchecked for ScalarPrimitive<C>
where C: Curve,

§

type Uint = <C as Curve>::Uint