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)