Struct ed448_goldilocks::Scalar
source · pub struct Scalar(_);
Expand description
This is the scalar field size = 4q = 2^446 - 0x8335dc163bb124b65129c96fde933d8d723a70aadc873d6d54a7bb0d We can therefore use 14 saturated 32-bit limbs
Implementations§
source§impl Scalar
impl Scalar
pub const fn one() -> Scalar
pub const fn zero() -> Scalar
pub fn bits(&self) -> Vec<bool>
pub fn from_bytes(bytes: [u8; 56]) -> Scalar
pub fn to_bytes(&self) -> [u8; 56]
pub fn invert(&self) -> Self
sourcepub fn from_canonical_bytes(bytes: [u8; 57]) -> Option<Scalar>
pub fn from_canonical_bytes(bytes: [u8; 57]) -> Option<Scalar>
Attempt to construct a Scalar
from a canonical byte representation.
Return
Some(s)
, wheres
is theScalar
corresponding tobytes
, ifbytes
is a canonical byte representation;None
ifbytes
is not a canonical byte representation.
sourcepub fn to_bytes_rfc_8032(&self) -> [u8; 57]
pub fn to_bytes_rfc_8032(&self) -> [u8; 57]
Serialize the scalar into 57 bytes, per RFC 8032. Byte 56 will always be zero.
sourcepub fn from_bytes_mod_order_wide(input: &[u8; 114]) -> Scalar
pub fn from_bytes_mod_order_wide(input: &[u8; 114]) -> Scalar
Construct a Scalar
by reducing a 912-bit little-endian integer
modulo the group order ℓ.
Trait Implementations§
source§impl ConstantTimeEq for Scalar
impl ConstantTimeEq for Scalar
source§impl<'a, 'b> Mul<&'b ExtendedPoint> for &'a Scalar
impl<'a, 'b> Mul<&'b ExtendedPoint> for &'a Scalar
source§fn mul(self, point: &'b ExtendedPoint) -> ExtendedPoint
fn mul(self, point: &'b ExtendedPoint) -> ExtendedPoint
Scalar multiplication: compute scalar * self
.
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§impl<'b> Mul<&'b ExtendedPoint> for Scalar
impl<'b> Mul<&'b ExtendedPoint> for Scalar
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§fn mul(self, rhs: &'b ExtendedPoint) -> ExtendedPoint
fn mul(self, rhs: &'b ExtendedPoint) -> ExtendedPoint
Performs the
*
operation. Read moresource§impl<'a, 'b> Mul<&'b Scalar> for &'a ExtendedPoint
impl<'a, 'b> Mul<&'b Scalar> for &'a ExtendedPoint
source§fn mul(self, scalar: &'b Scalar) -> ExtendedPoint
fn mul(self, scalar: &'b Scalar) -> ExtendedPoint
Scalar multiplication: compute scalar * self
.
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§impl<'b> Mul<&'b Scalar> for ExtendedPoint
impl<'b> Mul<&'b Scalar> for ExtendedPoint
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§impl<'p, 's> Mul<&'p DecafPoint> for &'s Scalar
impl<'p, 's> Mul<&'p DecafPoint> for &'s Scalar
§type Output = DecafPoint
type Output = DecafPoint
The resulting type after applying the
*
operator.source§fn mul(self, point: &'p DecafPoint) -> DecafPoint
fn mul(self, point: &'p DecafPoint) -> DecafPoint
Performs the
*
operation. Read moresource§impl<'s, 'p> Mul<&'s Scalar> for &'p DecafPoint
impl<'s, 'p> Mul<&'s Scalar> for &'p DecafPoint
Scalar Mul Operations
§type Output = DecafPoint
type Output = DecafPoint
The resulting type after applying the
*
operator.source§impl Mul<&MontgomeryPoint> for &Scalar
impl Mul<&MontgomeryPoint> for &Scalar
§type Output = MontgomeryPoint
type Output = MontgomeryPoint
The resulting type after applying the
*
operator.source§fn mul(self, point: &MontgomeryPoint) -> MontgomeryPoint
fn mul(self, point: &MontgomeryPoint) -> MontgomeryPoint
Performs the
*
operation. Read moresource§impl Mul<&Scalar> for &MontgomeryPoint
impl Mul<&Scalar> for &MontgomeryPoint
§type Output = MontgomeryPoint
type Output = MontgomeryPoint
The resulting type after applying the
*
operator.source§impl Mul<DecafPoint> for Scalar
impl Mul<DecafPoint> for Scalar
§type Output = DecafPoint
type Output = DecafPoint
The resulting type after applying the
*
operator.source§fn mul(self, point: DecafPoint) -> DecafPoint
fn mul(self, point: DecafPoint) -> DecafPoint
Performs the
*
operation. Read moresource§impl<'a> Mul<ExtendedPoint> for &'a Scalar
impl<'a> Mul<ExtendedPoint> for &'a Scalar
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§fn mul(self, rhs: ExtendedPoint) -> ExtendedPoint
fn mul(self, rhs: ExtendedPoint) -> ExtendedPoint
Performs the
*
operation. Read moresource§impl Mul<ExtendedPoint> for Scalar
impl Mul<ExtendedPoint> for Scalar
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§fn mul(self, rhs: ExtendedPoint) -> ExtendedPoint
fn mul(self, rhs: ExtendedPoint) -> ExtendedPoint
Performs the
*
operation. Read moresource§impl<'a> Mul<Scalar> for &'a ExtendedPoint
impl<'a> Mul<Scalar> for &'a ExtendedPoint
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§impl Mul<Scalar> for DecafPoint
impl Mul<Scalar> for DecafPoint
§type Output = DecafPoint
type Output = DecafPoint
The resulting type after applying the
*
operator.source§impl Mul<Scalar> for ExtendedPoint
impl Mul<Scalar> for ExtendedPoint
§type Output = ExtendedPoint
type Output = ExtendedPoint
The resulting type after applying the
*
operator.source§impl<'b> MulAssign<&'b Scalar> for ExtendedPoint
impl<'b> MulAssign<&'b Scalar> for ExtendedPoint
source§fn mul_assign(&mut self, scalar: &'b Scalar)
fn mul_assign(&mut self, scalar: &'b Scalar)
Performs the
*=
operation. Read moresource§impl MulAssign<Scalar> for ExtendedPoint
impl MulAssign<Scalar> for ExtendedPoint
source§fn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the
*=
operation. Read more