[−][src]Struct blstrs::Scalar
Represents an element of the scalar field $\mathbb{F}_q$ of the BLS12-381 elliptic curve construction.
The inner representation is stored in Montgomery form.
Implementations
impl Scalar
[src]
pub fn from_bytes_le(bytes: &[u8; 32]) -> Option<Scalar>
[src]
Attempts to convert a little-endian byte representation of
a scalar into a Scalar
, failing if the input is not canonical.
pub fn from_bytes_be(bytes: &[u8; 32]) -> Option<Scalar>
[src]
Attempts to convert a big-endian byte representation of
a scalar into a Scalar
, failing if the input is not canonical.
pub fn to_bytes_le(&self) -> [u8; 32]
[src]
Converts an element of Scalar
into a byte representation in
little-endian byte order.
pub fn to_bytes_be(&self) -> [u8; 32]
[src]
Converts an element of Scalar
into a byte representation in
big-endian byte order.
pub fn mul(&self, rhs: &Self) -> Self
[src]
Multiplies rhs
by self
, returning the result.
pub fn sub(&self, rhs: &Self) -> Self
[src]
Subtracts rhs
from self
, returning the result.
pub fn add(&self, rhs: &Self) -> Self
[src]
Adds rhs
to self
, returning the result.
pub fn is_zero(&self) -> bool
[src]
Returns true if this element is zero.
pub fn mul3(&self) -> Self
[src]
Multiplies self
with 3
, returning the result.
pub fn shl(&self, count: usize) -> Self
[src]
Left shift self
by count
, returning the result.
pub fn shr(&self, count: usize) -> Self
[src]
Right shift self
by count
, returning the result.
Trait Implementations
impl<'a, 'b> Add<&'b Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'b> Add<&'b Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'a> Add<Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the +
operator.
fn add(self, rhs: Scalar) -> Scalar
[src]
impl Add<Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the +
operator.
fn add(self, rhs: Scalar) -> Scalar
[src]
impl<'b> AddAssign<&'b Scalar> for Scalar
[src]
fn add_assign(&mut self, rhs: &'b Scalar)
[src]
impl AddAssign<Scalar> for Scalar
[src]
fn add_assign(&mut self, rhs: Scalar)
[src]
impl Clone for Scalar
[src]
impl Copy for Scalar
[src]
impl Debug for Scalar
[src]
impl Default for Scalar
[src]
impl Display for Scalar
[src]
impl Eq for Scalar
[src]
impl Field for Scalar
[src]
fn random<R: RngCore>(rng: &mut R) -> Self
[src]
fn zero() -> Self
[src]
fn one() -> Self
[src]
fn is_zero(&self) -> bool
[src]
fn square(&mut self)
[src]
fn double(&mut self)
[src]
fn negate(&mut self)
[src]
fn add_assign(&mut self, other: &Self)
[src]
fn sub_assign(&mut self, other: &Self)
[src]
fn mul_assign(&mut self, other: &Self)
[src]
fn inverse(&self) -> Option<Self>
[src]
fn frobenius_map(&mut self, _: usize)
[src]
fn pow<S>(&self, exp: S) -> Self where
S: AsRef<[u64]>,
[src]
S: AsRef<[u64]>,
impl From<Scalar> for ScalarRepr
[src]
impl From<Scalar> for blst_fr
[src]
impl From<blst_fr> for Scalar
[src]
impl From<u64> for Scalar
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a G1Projective
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, other: &'b Scalar) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a G1Affine
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, other: &'b Scalar) -> Self::Output
[src]
impl<'b> Mul<&'b Scalar> for G1Projective
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> G1Projective
[src]
impl<'b> Mul<&'b Scalar> for G1Affine
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> G1Projective
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a G2Projective
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, other: &'b Scalar) -> Self::Output
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a G2Affine
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, other: &'b Scalar) -> Self::Output
[src]
impl<'b> Mul<&'b Scalar> for G2Projective
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> G2Projective
[src]
impl<'b> Mul<&'b Scalar> for G2Affine
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> G2Projective
[src]
impl<'a, 'b> Mul<&'b Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'b> Mul<&'b Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'a> Mul<Scalar> for &'a G1Projective
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G1Projective
[src]
impl Mul<Scalar> for G1Projective
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G1Projective
[src]
impl<'a> Mul<Scalar> for &'a G1Affine
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G1Projective
[src]
impl Mul<Scalar> for G1Affine
[src]
type Output = G1Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G1Projective
[src]
impl<'a> Mul<Scalar> for &'a G2Projective
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G2Projective
[src]
impl Mul<Scalar> for G2Projective
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G2Projective
[src]
impl<'a> Mul<Scalar> for &'a G2Affine
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G2Projective
[src]
impl Mul<Scalar> for G2Affine
[src]
type Output = G2Projective
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> G2Projective
[src]
impl<'a> Mul<Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> Scalar
[src]
impl Mul<Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the *
operator.
fn mul(self, rhs: Scalar) -> Scalar
[src]
impl<'b> MulAssign<&'b Scalar> for G1Projective
[src]
fn mul_assign(&mut self, rhs: &'b Scalar)
[src]
impl<'b> MulAssign<&'b Scalar> for G2Projective
[src]
fn mul_assign(&mut self, rhs: &'b Scalar)
[src]
impl<'b> MulAssign<&'b Scalar> for Scalar
[src]
fn mul_assign(&mut self, rhs: &'b Scalar)
[src]
impl MulAssign<Scalar> for G1Projective
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
impl MulAssign<Scalar> for G2Projective
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
impl MulAssign<Scalar> for Scalar
[src]
fn mul_assign(&mut self, rhs: Scalar)
[src]
impl<'a> Neg for &'a Scalar
[src]
impl Neg for Scalar
[src]
impl PartialEq<Scalar> for Scalar
[src]
impl PrimeField for Scalar
[src]
type Repr = ScalarRepr
The prime field can be converted back and forth into this biginteger representation. Read more
const NUM_BITS: u32
[src]
const CAPACITY: u32
[src]
const S: u32
[src]
fn from_repr(repr: Self::Repr) -> Result<Self, PrimeFieldDecodingError>
[src]
fn into_repr(&self) -> Self::Repr
[src]
Convert a biginteger representation into a prime field element, if the number is an element of the field.
fn char() -> Self::Repr
[src]
fn multiplicative_generator() -> Self
[src]
fn root_of_unity() -> Self
[src]
fn from_str(s: &str) -> Option<Self>
[src]
impl SqrtField for Scalar
[src]
impl<'a, 'b> Sub<&'b Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'b> Sub<&'b Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Scalar) -> Scalar
[src]
impl<'a> Sub<Scalar> for &'a Scalar
[src]
type Output = Scalar
The resulting type after applying the -
operator.
fn sub(self, rhs: Scalar) -> Scalar
[src]
impl Sub<Scalar> for Scalar
[src]
type Output = Scalar
The resulting type after applying the -
operator.
fn sub(self, rhs: Scalar) -> Scalar
[src]
impl<'b> SubAssign<&'b Scalar> for Scalar
[src]
fn sub_assign(&mut self, rhs: &'b Scalar)
[src]
impl SubAssign<Scalar> for Scalar
[src]
fn sub_assign(&mut self, rhs: Scalar)
[src]
impl TryInto<Scalar> for blst_scalar
[src]
Auto Trait Implementations
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,