pub struct Scalar52(pub [u64; 5]);
Available on
curve25519_dalek_bits="64"
only.Expand description
The Scalar52
struct represents an element in
\(\mathbb Z / \ell \mathbb Z\) as 5 \(52\)-bit limbs.
Tuple Fields§
§0: [u64; 5]
Implementations§
source§impl Scalar52
impl Scalar52
sourcepub fn from_bytes(bytes: &[u8; 32]) -> Scalar52
pub fn from_bytes(bytes: &[u8; 32]) -> Scalar52
Unpack a 32 byte / 256 bit scalar into 5 52-bit limbs.
sourcepub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar52
pub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar52
Reduce a 64 byte / 512 bit scalar mod l
sourcepub fn montgomery_mul(a: &Scalar52, b: &Scalar52) -> Scalar52
pub fn montgomery_mul(a: &Scalar52, b: &Scalar52) -> Scalar52
Compute (a * b) / R
(mod l), where R is the Montgomery modulus 2^260
sourcepub fn montgomery_square(&self) -> Scalar52
pub fn montgomery_square(&self) -> Scalar52
Compute (a^2) / R
(mod l) in Montgomery form, where R is the Montgomery modulus 2^260
sourcepub fn as_montgomery(&self) -> Scalar52
pub fn as_montgomery(&self) -> Scalar52
Puts a Scalar52 in to Montgomery form, i.e. computes a*R (mod l)
sourcepub fn from_montgomery(&self) -> Scalar52
pub fn from_montgomery(&self) -> Scalar52
Takes a Scalar52 out of Montgomery form, i.e. computes a/R (mod l)
Trait Implementations§
impl Copy for Scalar52
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more