Skip to main content

Scalar

Struct Scalar 

pub struct Scalar(/* private fields */);
Expand description

Scalars are elements in the finite field modulo n.

§Trait impls

Much of the important functionality of scalars is provided by traits from the ff crate, which is re-exported as k256::elliptic_curve::ff:

  • Field - represents elements of finite fields and provides:
  • PrimeField - represents elements of prime fields and provides:
    • from_repr/to_repr for converting field elements from/to big integers.
    • multiplicative_generator and root_of_unity constants.
  • PrimeFieldBits - operations over field elements represented as bits (requires bits feature)

Please see the documentation for the relevant traits for more information.

§serde support

When the serde feature of this crate is enabled, the Serialize and Deserialize traits are impl’d for this type.

The serialization is a fixed-width big endian encoding. When used with textual formats, the binary data is encoded as hexadecimal.

Implementations§

§

impl Scalar

pub const ZERO: Scalar

Zero scalar.

pub const ONE: Scalar

Multiplicative identity.

pub fn is_zero(&self) -> Choice

Checks if the scalar is zero.

pub fn to_bytes(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

Returns the SEC1 encoding of this scalar.

pub const fn negate(&self) -> Scalar

Negates the scalar.

pub const fn add(&self, rhs: &Scalar) -> Scalar

Returns self + rhs mod n.

pub const fn sub(&self, rhs: &Scalar) -> Scalar

Returns self - rhs mod n.

pub fn mul(&self, rhs: &Scalar) -> Scalar

Modulo multiplies two scalars.

pub fn square(&self) -> Scalar

Modulo squares the scalar.

pub fn shr_vartime(&self, shift: usize) -> Scalar

Right shifts the scalar.

Note: not constant-time with respect to the shift parameter.

pub fn invert(&self) -> CtOption<Scalar>

Inverts the scalar.

pub fn generate_biased(rng: &mut impl CryptoRngCore) -> Scalar

Returns a (nearly) uniformly-random scalar, generated in constant time.

pub fn generate_vartime(rng: &mut impl RngCore) -> Scalar

Returns a uniformly-random scalar, generated using rejection sampling.

Trait Implementations§

§

impl Add<&Scalar> for &Scalar

§

type Output = Scalar

The resulting type after applying the + operator.
§

fn add(self, other: &Scalar) -> Scalar

Performs the + operation. Read more
§

impl Add<&Scalar> for Scalar

§

type Output = Scalar

The resulting type after applying the + operator.
§

fn add(self, other: &Scalar) -> Scalar

Performs the + operation. Read more
§

impl Add<Scalar> for &Scalar

§

type Output = Scalar

The resulting type after applying the + operator.
§

fn add(self, other: Scalar) -> Scalar

Performs the + operation. Read more
§

impl Add for Scalar

§

type Output = Scalar

The resulting type after applying the + operator.
§

fn add(self, other: Scalar) -> Scalar

Performs the + operation. Read more
§

impl AddAssign<&Scalar> for Scalar

§

fn add_assign(&mut self, rhs: &Scalar)

Performs the += operation. Read more
§

impl AddAssign for Scalar

§

fn add_assign(&mut self, rhs: Scalar)

Performs the += operation. Read more
§

impl AsRef<Scalar> for Scalar

§

fn as_ref(&self) -> &Scalar

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Clone for Scalar

§

fn clone(&self) -> Scalar

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl ConditionallySelectable for Scalar

§

fn conditional_select(a: &Scalar, b: &Scalar, choice: Choice) -> Scalar

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
§

impl ConstantTimeEq for Scalar

§

fn ct_eq(&self, other: &Scalar) -> Choice

Determine if two items are equal. Read more
Source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
§

impl Debug for Scalar

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Default for Scalar

§

fn default() -> Scalar

Returns the “default value” for a type. Read more
§

impl Field for Scalar

§

fn sqrt(&self) -> CtOption<Scalar>

Tonelli-Shank’s algorithm for q mod 16 = 1 https://eprint.iacr.org/2012/685.pdf (page 12, algorithm 5)

§

const ZERO: Scalar = Self::ZERO

The zero element of the field, the additive identity.
§

const ONE: Scalar = Self::ONE

The one element of the field, the multiplicative identity.
§

fn random(rng: impl RngCore) -> Scalar

Returns an element chosen uniformly at random using a user-provided RNG.
§

fn square(&self) -> Scalar

Squares this element.
§

fn double(&self) -> Scalar

Doubles this element.
§

fn invert(&self) -> CtOption<Scalar>

Computes the multiplicative inverse of this element, failing if the element is zero.
§

fn sqrt_ratio(num: &Scalar, div: &Scalar) -> (Choice, Scalar)

Computes: Read more
§

fn is_zero(&self) -> Choice

Returns true iff this element is zero.
§

fn is_zero_vartime(&self) -> bool

Returns true iff this element is zero. Read more
§

fn cube(&self) -> Self

Cubes this element.
§

fn sqrt_alt(&self) -> (Choice, Self)

Equivalent to Self::sqrt_ratio(self, one()). Read more
§

fn pow<S>(&self, exp: S) -> Self
where S: AsRef<[u64]>,

Exponentiates self by exp, where exp is a little-endian order integer exponent. Read more
§

fn pow_vartime<S>(&self, exp: S) -> Self
where S: AsRef<[u64]>,

Exponentiates self by exp, where exp is a little-endian order integer exponent. Read more
§

impl From<&Scalar> for GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

§

fn from( scalar: &Scalar, ) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

Converts to this type from the input type.
§

impl From<&Scalar> for ScalarPrimitive<Secp256k1>

§

fn from(scalar: &Scalar) -> ScalarPrimitive<Secp256k1>

Converts to this type from the input type.
§

impl From<&Scalar> for Uint<crypto_bigint::::uint::U256::{constant#0}>

§

fn from(scalar: &Scalar) -> Uint<crypto_bigint::::uint::U256::{constant#0}>

Converts to this type from the input type.
§

impl From<&ScalarPrimitive<Secp256k1>> for Scalar

§

fn from(scalar: &ScalarPrimitive<Secp256k1>) -> Scalar

Converts to this type from the input type.
§

impl From<Scalar> for GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

§

fn from( scalar: Scalar, ) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

Converts to this type from the input type.
§

impl From<Scalar> for ScalarPrimitive<Secp256k1>

§

fn from(scalar: Scalar) -> ScalarPrimitive<Secp256k1>

Converts to this type from the input type.
§

impl From<Scalar> for Uint<crypto_bigint::::uint::U256::{constant#0}>

§

fn from(scalar: Scalar) -> Uint<crypto_bigint::::uint::U256::{constant#0}>

Converts to this type from the input type.
§

impl From<ScalarPrimitive<Secp256k1>> for Scalar

§

fn from(scalar: ScalarPrimitive<Secp256k1>) -> Scalar

Converts to this type from the input type.
§

impl From<u128> for Scalar

§

fn from(k: u128) -> Scalar

Converts to this type from the input type.
§

impl From<u32> for Scalar

§

fn from(k: u32) -> Scalar

Converts to this type from the input type.
§

impl From<u64> for Scalar

§

fn from(k: u64) -> Scalar

Converts to this type from the input type.
§

impl FromUintUnchecked for Scalar

§

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

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

fn from_uint_unchecked(uint: <Scalar as FromUintUnchecked>::Uint) -> Scalar

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

impl Invert for Scalar

§

fn invert_vartime(&self) -> CtOption<Scalar>

Fast variable-time inversion using Stein’s algorithm.

Returns none if the scalar is zero.

https://link.springer.com/article/10.1007/s13389-016-0135-4

⚠️ WARNING!

This method should not be used with (unblinded) secret scalars, as its variable-time operation can potentially leak secrets through sidechannels.

§

type Output = CtOption<Scalar>

Field element type
§

fn invert(&self) -> CtOption<Scalar>

Invert a field element.
§

impl IsHigh for Scalar

§

fn is_high(&self) -> Choice

Is this scalar greater than or equal to n / 2?
§

impl Mul<&Scalar> for &ProjectivePoint

§

type Output = ProjectivePoint

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar) -> ProjectivePoint

Performs the * operation. Read more
§

impl Mul<&Scalar> for &Scalar

§

type Output = Scalar

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar) -> Scalar

Performs the * operation. Read more
§

impl Mul<&Scalar> for AffinePoint

§

type Output = ProjectivePoint

The resulting type after applying the * operator.
§

fn mul(self, scalar: &Scalar) -> ProjectivePoint

Performs the * operation. Read more
§

impl Mul<&Scalar> for ProjectivePoint

§

type Output = ProjectivePoint

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar) -> ProjectivePoint

Performs the * operation. Read more
§

impl Mul<&Scalar> for Scalar

§

type Output = Scalar

The resulting type after applying the * operator.
§

fn mul(self, other: &Scalar) -> Scalar

Performs the * operation. Read more
§

impl Mul<Scalar> for AffinePoint

§

type Output = ProjectivePoint

The resulting type after applying the * operator.
§

fn mul(self, scalar: Scalar) -> ProjectivePoint

Performs the * operation. Read more
§

impl Mul<Scalar> for ProjectivePoint

§

type Output = ProjectivePoint

The resulting type after applying the * operator.
§

fn mul(self, other: Scalar) -> ProjectivePoint

Performs the * operation. Read more
§

impl Mul for Scalar

§

type Output = Scalar

The resulting type after applying the * operator.
§

fn mul(self, other: Scalar) -> Scalar

Performs the * operation. Read more
§

impl MulAssign<&Scalar> for ProjectivePoint

§

fn mul_assign(&mut self, rhs: &Scalar)

Performs the *= operation. Read more
§

impl MulAssign<&Scalar> for Scalar

§

fn mul_assign(&mut self, rhs: &Scalar)

Performs the *= operation. Read more
§

impl MulAssign<Scalar> for ProjectivePoint

§

fn mul_assign(&mut self, rhs: Scalar)

Performs the *= operation. Read more
§

impl MulAssign for Scalar

§

fn mul_assign(&mut self, rhs: Scalar)

Performs the *= operation. Read more
§

impl Neg for &Scalar

§

type Output = Scalar

The resulting type after applying the - operator.
§

fn neg(self) -> Scalar

Performs the unary - operation. Read more
§

impl Neg for Scalar

§

type Output = Scalar

The resulting type after applying the - operator.
§

fn neg(self) -> Scalar

Performs the unary - operation. Read more
§

impl Ord for Scalar

§

fn cmp(&self, other: &Scalar) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Scalar

§

fn eq(&self, other: &Scalar) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Scalar

§

fn partial_cmp(&self, other: &Scalar) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl PrimeField for Scalar

§

fn from_repr( bytes: GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, ) -> CtOption<Scalar>

Attempts to parse the given byte array as an SEC1-encoded scalar.

Returns None if the byte array does not contain a big-endian integer in the range [0, p).

§

const MODULUS: &'static str = ORDER_HEX

Modulus of the field written as a string for debugging purposes. Read more
§

const NUM_BITS: u32 = 256

How many bits are needed to represent an element of this field.
§

const CAPACITY: u32 = 255

How many bits of information can be reliably stored in the field element. Read more
§

const TWO_INV: Scalar

Inverse of $2$ in the field.
§

const MULTIPLICATIVE_GENERATOR: Scalar

A fixed multiplicative generator of modulus - 1 order. This element must also be a quadratic nonresidue. Read more
§

const S: u32 = 6

An integer s satisfying the equation 2^s * t = modulus - 1 with t odd. Read more
§

const ROOT_OF_UNITY: Scalar

The 2^s root of unity. Read more
§

const ROOT_OF_UNITY_INV: Scalar

§

const DELTA: Scalar

Generator of the t-order multiplicative subgroup. Read more
§

type Repr = GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

The prime field can be converted back and forth into this binary representation.
§

fn to_repr(&self) -> GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

Converts an element of the prime field into the standard byte representation for this field. Read more
§

fn is_odd(&self) -> Choice

Returns true iff this element is odd.
§

fn from_str_vartime(s: &str) -> Option<Self>

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string. Read more
§

fn from_u128(v: u128) -> Self

Obtains a field element congruent to the integer v. Read more
§

fn from_repr_vartime(repr: Self::Repr) -> Option<Self>

Attempts to convert a byte representation of a field element into an element of this prime field, failing if the input is not canonical (is not smaller than the field’s modulus). Read more
§

fn is_even(&self) -> Choice

Returns true iff this element is even.
§

impl<'a> Product<&'a Scalar> for Scalar

§

fn product<I>(iter: I) -> Scalar
where I: Iterator<Item = &'a Scalar>,

Takes an iterator and generates Self from the elements by multiplying the items.
§

impl Product for Scalar

§

fn product<I>(iter: I) -> Scalar
where I: Iterator<Item = Scalar>,

Takes an iterator and generates Self from the elements by multiplying the items.
§

impl Reduce<Uint<crypto_bigint::::uint::U256::{constant#0}>> for Scalar

§

type Bytes = GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>

Bytes used as input to Reduce::reduce_bytes.
§

fn reduce(w: Uint<crypto_bigint::::uint::U256::{constant#0}>) -> Scalar

Perform a modular reduction, returning a field element.
§

fn reduce_bytes( bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, ) -> Scalar

Interpret the given bytes as an integer and perform a modular reduction.
§

impl Reduce<Uint<crypto_bigint::::uint::U512::{constant#0}>> for Scalar

§

type Bytes = GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>

Bytes used as input to Reduce::reduce_bytes.
§

fn reduce(w: Uint<crypto_bigint::::uint::U512::{constant#0}>) -> Scalar

Perform a modular reduction, returning a field element.
§

fn reduce_bytes( bytes: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, ) -> Scalar

Interpret the given bytes as an integer and perform a modular reduction.
§

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

§

fn reduce_nonzero(w: Uint<crypto_bigint::::uint::U256::{constant#0}>) -> Scalar

Perform a modular reduction, returning a field element.
§

fn reduce_nonzero_bytes( bytes: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, ) -> Scalar

Interpret the given bytes as an integer and perform a modular reduction to a non-zero output.
§

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

§

fn reduce_nonzero(w: Uint<crypto_bigint::::uint::U512::{constant#0}>) -> Scalar

Perform a modular reduction, returning a field element.
§

fn reduce_nonzero_bytes( bytes: &GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>>, ) -> Scalar

Interpret the given bytes as an integer and perform a modular reduction to a non-zero output.
§

impl Shr<usize> for &Scalar

§

type Output = Scalar

The resulting type after applying the >> operator.
§

fn shr(self, rhs: usize) -> <&Scalar as Shr<usize>>::Output

Performs the >> operation. Read more
§

impl Shr<usize> for Scalar

§

type Output = Scalar

The resulting type after applying the >> operator.
§

fn shr(self, rhs: usize) -> <Scalar as Shr<usize>>::Output

Performs the >> operation. Read more
§

impl ShrAssign<usize> for Scalar

§

fn shr_assign(&mut self, rhs: usize)

Performs the >>= operation. Read more
§

impl SignPrimitive<Secp256k1> for Scalar

Available on crate feature ecdsa only.
§

fn try_sign_prehashed<K>( &self, k: K, z: &GenericArray<u8, <Secp256k1 as Curve>::FieldBytesSize>, ) -> Result<(Signature<Secp256k1>, Option<RecoveryId>), Error>
where K: AsRef<Scalar> + Invert<Output = CtOption<Scalar>>,

Try to sign the prehashed message. Read more
§

fn try_sign_prehashed_rfc6979<D>( &self, z: &GenericArray<u8, <C as Curve>::FieldBytesSize>, ad: &[u8], ) -> Result<(Signature<C>, Option<RecoveryId>), Error>
where Self: From<ScalarPrimitive<C>> + Invert<Output = CtOption<Self>>, D: Digest<OutputSize = <C as Curve>::FieldBytesSize> + BlockSizeUser + FixedOutput + FixedOutputReset,

Try to sign the given message digest deterministically using the method described in RFC6979 for computing ECDSA ephemeral scalar k. Read more
§

impl Sub<&Scalar> for &Scalar

§

type Output = Scalar

The resulting type after applying the - operator.
§

fn sub(self, other: &Scalar) -> Scalar

Performs the - operation. Read more
§

impl Sub<&Scalar> for Scalar

§

type Output = Scalar

The resulting type after applying the - operator.
§

fn sub(self, other: &Scalar) -> Scalar

Performs the - operation. Read more
§

impl Sub for Scalar

§

type Output = Scalar

The resulting type after applying the - operator.
§

fn sub(self, other: Scalar) -> Scalar

Performs the - operation. Read more
§

impl SubAssign<&Scalar> for Scalar

§

fn sub_assign(&mut self, rhs: &Scalar)

Performs the -= operation. Read more
§

impl SubAssign for Scalar

§

fn sub_assign(&mut self, rhs: Scalar)

Performs the -= operation. Read more
§

impl<'a> Sum<&'a Scalar> for Scalar

§

fn sum<I>(iter: I) -> Scalar
where I: Iterator<Item = &'a Scalar>,

Takes an iterator and generates Self from the elements by “summing up” the items.
§

impl Sum for Scalar

§

fn sum<I>(iter: I) -> Scalar
where I: Iterator<Item = Scalar>,

Takes an iterator and generates Self from the elements by “summing up” the items.
§

impl Copy for Scalar

§

impl DefaultIsZeroes for Scalar

§

impl Eq for Scalar

Auto Trait Implementations§

§

impl Freeze for Scalar

§

impl RefUnwindSafe for Scalar

§

impl Send for Scalar

§

impl Sync for Scalar

§

impl Unpin for Scalar

§

impl UnwindSafe for Scalar

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<const N: usize, T> BatchInvert<[T; N]> for T
where T: Invert<Output = CtOption<T>> + Mul<Output = T> + Copy + Default + ConditionallySelectable,

§

type Output = [T; N]

The output of batch inversion. A container of field elements.
§

fn batch_invert(field_elements: &[T; N]) -> CtOption<[T; N]>

Invert a batch of field elements.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ConditionallyNegatable for T
where T: ConditionallySelectable, &'a T: for<'a> Neg<Output = T>,

Source§

fn conditional_negate(&mut self, choice: Choice)

Negate self if choice == Choice(1); otherwise, leave it unchanged. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<Z> Zeroize for Z
where Z: DefaultIsZeroes,

§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
§

impl<T, Rhs, Output> GroupOps<Rhs, Output> for T
where T: Add<Rhs, Output = Output> + Sub<Rhs, Output = Output> + AddAssign<Rhs> + SubAssign<Rhs>,

§

impl<T, Rhs, Output> GroupOpsOwned<Rhs, Output> for T
where T: for<'r> GroupOps<&'r Rhs, Output>,

§

impl<T, Rhs, Output> ScalarMul<Rhs, Output> for T
where T: Mul<Rhs, Output = Output> + MulAssign<Rhs>,

§

impl<T, Rhs, Output> ScalarMulOwned<Rhs, Output> for T
where T: for<'r> ScalarMul<&'r Rhs, Output>,