[][src]Struct k256::arithmetic::Scalar

pub struct Scalar(_);
This is supported on feature="arithmetic" only.

An element in the finite field modulo n.

Methods

impl Scalar[src]

pub const fn zero() -> Scalar[src]

This is supported on feature="arithmetic" only.

Returns the zero scalar.

pub const fn one() -> Scalar[src]

This is supported on feature="arithmetic" only.

Returns the multiplicative identity.

pub fn from_bytes(bytes: [u8; 32]) -> CtOption<Self>[src]

This is supported on feature="arithmetic" only.

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

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

pub fn to_bytes(&self) -> [u8; 32][src]

This is supported on feature="arithmetic" only.

Returns the SEC-1 encoding of this scalar.

Trait Implementations

impl Clone for Scalar[src]

impl Copy for Scalar[src]

impl Debug for Scalar[src]

impl From<u64> for Scalar[src]

impl<'_, '_> Mul<&'_ Scalar> for &'_ ProjectivePoint[src]

type Output = ProjectivePoint

The resulting type after applying the * operator.

impl<'_> Mul<&'_ Scalar> for ProjectivePoint[src]

type Output = ProjectivePoint

The resulting type after applying the * operator.

impl<'_> MulAssign<&'_ Scalar> for ProjectivePoint[src]

impl MulAssign<Scalar> for ProjectivePoint[src]

Auto Trait Implementations

impl RefUnwindSafe for Scalar

impl Send for Scalar

impl Sync for Scalar

impl Unpin for Scalar

impl UnwindSafe for Scalar

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.