pub struct Scalar29(pub [u32; 9]);
Available on
curve25519_dalek_bits="32"
only.Expand description
The Scalar29
struct represents an element in \(\mathbb{Z} / \ell\mathbb{Z}\) as 9 29-bit
limbs
Tuple Fields§
§0: [u32; 9]
Implementations§
source§impl Scalar29
impl Scalar29
sourcepub fn from_bytes(bytes: &[u8; 32]) -> Scalar29
pub fn from_bytes(bytes: &[u8; 32]) -> Scalar29
Unpack a 32 byte / 256 bit scalar into 9 29-bit limbs.
sourcepub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar29
pub fn from_bytes_wide(bytes: &[u8; 64]) -> Scalar29
Reduce a 64 byte / 512 bit scalar mod l.
sourcepub fn montgomery_mul(a: &Scalar29, b: &Scalar29) -> Scalar29
pub fn montgomery_mul(a: &Scalar29, b: &Scalar29) -> Scalar29
Compute (a * b) / R
(mod l), where R is the Montgomery modulus 2^261
sourcepub fn montgomery_square(&self) -> Scalar29
pub fn montgomery_square(&self) -> Scalar29
Compute (a^2) / R
(mod l) in Montgomery form, where R is the Montgomery modulus 2^261
sourcepub fn as_montgomery(&self) -> Scalar29
pub fn as_montgomery(&self) -> Scalar29
Puts a Scalar29 in to Montgomery form, i.e. computes a*R (mod l)
sourcepub fn from_montgomery(&self) -> Scalar29
pub fn from_montgomery(&self) -> Scalar29
Takes a Scalar29 out of Montgomery form, i.e. computes a/R (mod l)
Trait Implementations§
impl Copy for Scalar29
Auto Trait Implementations§
impl RefUnwindSafe for Scalar29
impl Send for Scalar29
impl Sync for Scalar29
impl Unpin for Scalar29
impl UnwindSafe for Scalar29
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