# [−][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 Index<usize> for Scalar52[src]

#### type Output = u64

The returned type after indexing.

## Blanket Implementations

### 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.