[][src]Struct elliptic_curve::scalar::NonZeroScalar

pub struct NonZeroScalar<C: Curve + Arithmetic> { /* fields omitted */ }

Non-zero scalar type.

This type ensures that its value is not zero, ala core::num::NonZero*. To do this, the generic S type must impl both Default and ConstantTimeEq, with the requirement that S::default() returns 0.

In the context of ECC, it's useful for ensuring that scalar multiplication cannot result in the point at infinity.

Implementations

impl<C> NonZeroScalar<C> where
    C: Curve + Arithmetic
[src]

pub fn new(scalar: C::Scalar) -> CtOption<Self>[src]

Create a NonZeroScalar from a scalar, performing a constant-time check that it's non-zero.

Trait Implementations

impl<C> AsRef<<C as Arithmetic>::Scalar> for NonZeroScalar<C> where
    C: Curve + Arithmetic
[src]

impl<C: Clone + Curve + Arithmetic> Clone for NonZeroScalar<C> where
    C::Scalar: Clone
[src]

impl<C> Generate for NonZeroScalar<C> where
    C: Curve + Arithmetic,
    C::Scalar: Generate
[src]

impl<C> Zeroize for NonZeroScalar<C> where
    C: Curve + Arithmetic,
    C::Scalar: Zeroize
[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for NonZeroScalar<C> where
    <C as Arithmetic>::Scalar: RefUnwindSafe

impl<C> Send for NonZeroScalar<C> where
    <C as Arithmetic>::Scalar: Send

impl<C> Sync for NonZeroScalar<C> where
    <C as Arithmetic>::Scalar: Sync

impl<C> Unpin for NonZeroScalar<C> where
    <C as Arithmetic>::Scalar: Unpin

impl<C> UnwindSafe for NonZeroScalar<C> where
    <C as Arithmetic>::Scalar: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<Z> Zeroize for Z where
    Z: DefaultIsZeroes
[src]