[−][src]Struct curve25519_dalek::backend::serial::u64::scalar::Scalar52
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]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> Cast<U> for T where
U: FromCast<T>,
U: FromCast<T>,
fn cast(self) -> U
impl<T> From<T> for T
[src]
impl<T> FromBits<T> for T
fn from_bits(t: T) -> T
impl<T> FromCast<T> for T
fn from_cast(t: T) -> T
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> IntoBits<U> for T where
U: FromBits<T>,
U: FromBits<T>,
fn into_bits(self) -> U
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<Z> Zeroize for Z where
Z: DefaultIsZeroes,
[src]
Z: DefaultIsZeroes,