[][src]Struct curve25519_dalek::backend::serial::u64::scalar::Scalar52

pub struct Scalar52(pub [u64; 5]);

The Scalar52 struct represents an element in \(\mathbb Z / \ell \mathbb Z\) as 5 \(52\)-bit limbs.

Methods

impl Scalar52[src]

fn pack(&self) -> Scalar[src]

Pack the limbs of this UnpackedScalar into a Scalar.

pub fn montgomery_invert(&self) -> Scalar52[src]

Inverts an UnpackedScalar in Montgomery form.

pub fn invert(&self) -> Scalar52[src]

Inverts an UnpackedScalar not in Montgomery form.

impl Scalar52[src]

pub fn zero() -> Scalar52[src]

Return the zero scalar

pub fn from_bytes(bytes: &[u8; 32]) -> Scalar52[src]

Unpack a 32 byte / 256 bit scalar into 5 52-bit limbs.

pub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar52[src]

Reduce a 64 byte / 512 bit scalar mod l

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

Pack the limbs of this Scalar52 into 32 bytes

pub fn add(a: &Scalar52, b: &Scalar52) -> Scalar52[src]

Compute a + b (mod l)

pub fn sub(a: &Scalar52, b: &Scalar52) -> Scalar52[src]

Compute a - b (mod l)

pub(crate) fn mul_internal(a: &Scalar52, b: &Scalar52) -> [u128; 9][src]

Compute a * b

fn square_internal(a: &Scalar52) -> [u128; 9][src]

Compute a^2

pub(crate) fn montgomery_reduce(limbs: &[u128; 9]) -> Scalar52[src]

Compute limbs/R (mod l), where R is the Montgomery modulus 2^260

pub fn mul(a: &Scalar52, b: &Scalar52) -> Scalar52[src]

Compute a * b (mod l)

pub fn square(&self) -> Scalar52[src]

Compute a^2 (mod l)

pub fn montgomery_mul(a: &Scalar52, b: &Scalar52) -> Scalar52[src]

Compute (a * b) / R (mod l), where R is the Montgomery modulus 2^260

pub fn montgomery_square(&self) -> Scalar52[src]

Compute (a^2) / R (mod l) in Montgomery form, where R is the Montgomery modulus 2^260

pub fn to_montgomery(&self) -> Scalar52[src]

Puts a Scalar52 in to Montgomery form, i.e. computes a*R (mod l)

pub fn from_montgomery(&self) -> Scalar52[src]

Takes a Scalar52 out of Montgomery form, i.e. computes a/R (mod l)

Trait Implementations

impl Clone for Scalar52[src]

impl Copy for Scalar52[src]

impl Debug for Scalar52[src]

impl Index<usize> for Scalar52[src]

type Output = u64

The returned type after indexing.

impl IndexMut<usize> for Scalar52[src]

impl Zeroize for Scalar52[src]

Auto Trait Implementations

impl RefUnwindSafe for Scalar52

impl Send for Scalar52

impl Sync for Scalar52

impl Unpin for Scalar52

impl UnwindSafe for Scalar52

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, U> Cast<U> for T where
    U: FromCast<T>, 

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

impl<T> FromBits<T> for T

impl<T> FromCast<T> for T

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

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

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 = !

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]