[][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]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Scalar52[src]

impl Copy for Scalar52[src]

impl Index<usize> for Scalar52[src]

type Output = u64

The returned type after indexing.

impl IndexMut<usize> for Scalar52[src]

impl ZeroSafe for Scalar52[src]

Auto Trait Implementations

impl Send for Scalar52

impl Sync for Scalar52

Blanket Implementations

impl<T> From for T[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

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

type Owned = T

impl<T> FromCast for T

impl<T, U> Cast for T where
    U: FromCast<T>, 

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

impl<T> FromBits for T

impl<T> Same for T

type Output = T

Should always be Self