Struct blstrs::Fp [−][src]
Fp
values are always in
Montgomery form; i.e., Scalar(a) = aR mod p, with R = 2^384.
Implementations
impl Fp
[src]
pub fn from_bytes_le(bytes: &[u8; 48]) -> Option<Fp>
[src]
Attempts to convert a little-endian byte representation of
a scalar into an Fp
, failing if the input is not canonical.
pub fn from_bytes_be(bytes: &[u8; 48]) -> Option<Fp>
[src]
Attempts to convert a big-endian byte representation of
a scalar into an Fp
, failing if the input is not canonical.
pub fn to_bytes_le(&self) -> [u8; 48]
[src]
Converts an element of Fp
into a byte representation in
little-endian byte order.
pub fn to_bytes_be(&self) -> [u8; 48]
[src]
Converts an element of Fp
into a byte representation in
big-endian byte order.
pub fn from_raw_unchecked(v: [u64; 6]) -> Fp
[src]
Constructs an element of Fp
without checking that it is canonical.
pub fn add(&self, rhs: &Fp) -> Fp
[src]
pub fn neg(&self) -> Fp
[src]
pub fn sub(&self, rhs: &Fp) -> Fp
[src]
pub fn mul(&self, rhs: &Fp) -> Fp
[src]
pub fn mul3(&self) -> Self
[src]
Multiplies self
with 3
, returning the result.
pub fn mul8(&self) -> Self
[src]
Multiplies self
with 8
, returning the result.
pub fn shl(&self, count: usize) -> Self
[src]
Left shift self
by count
, returning the result.
Trait Implementations
impl<'a, 'b> Add<&'b Fp> for &'a Fp
[src]
type Output = Fp
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Fp) -> Fp
[src]
impl<'b> Add<&'b Fp> for Fp
[src]
type Output = Fp
The resulting type after applying the +
operator.
fn add(self, rhs: &'b Fp) -> Fp
[src]
impl<'a> Add<Fp> for &'a Fp
[src]
impl Add<Fp> for Fp
[src]
impl<'b> AddAssign<&'b Fp> for Fp
[src]
fn add_assign(&mut self, rhs: &'b Fp)
[src]
impl AddAssign<Fp> for Fp
[src]
fn add_assign(&mut self, rhs: Fp)
[src]
impl Clone for Fp
[src]
impl Copy for Fp
[src]
impl Debug for Fp
[src]
impl Default for Fp
[src]
impl Display for Fp
[src]
impl Eq for Fp
[src]
impl Field for Fp
[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]
pub fn pow<S>(&self, exp: S) -> Self where
S: AsRef<[u64]>,
[src]
S: AsRef<[u64]>,
impl From<Fp> for FpRepr
[src]
impl From<Fp> for Fp12
[src]
impl From<Fp> for Fp2
[src]
impl From<Fp> for Fp6
[src]
impl From<blst_fp> for Fp
[src]
impl From<u64> for Fp
[src]
impl<'a, 'b> Mul<&'b Fp> for &'a Fp
[src]
type Output = Fp
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Fp) -> Fp
[src]
impl<'b> Mul<&'b Fp> for Fp
[src]
type Output = Fp
The resulting type after applying the *
operator.
fn mul(self, rhs: &'b Fp) -> Fp
[src]
impl<'a> Mul<Fp> for &'a Fp
[src]
impl Mul<Fp> for Fp
[src]
impl<'b> MulAssign<&'b Fp> for Fp
[src]
fn mul_assign(&mut self, rhs: &'b Fp)
[src]
impl MulAssign<Fp> for Fp
[src]
fn mul_assign(&mut self, rhs: Fp)
[src]
impl<'a> Neg for &'a Fp
[src]
impl Neg for Fp
[src]
impl Ord for Fp
[src]
Elements are ordered lexicographically.
fn cmp(&self, other: &Fp) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Fp> for Fp
[src]
impl PartialOrd<Fp> for Fp
[src]
fn partial_cmp(&self, other: &Fp) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PrimeField for Fp
[src]
type Repr = FpRepr
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]
pub fn from_str(s: &str) -> Option<Self>
[src]
impl SqrtField for Fp
[src]
impl<'a, 'b> Sub<&'b Fp> for &'a Fp
[src]
type Output = Fp
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Fp) -> Fp
[src]
impl<'b> Sub<&'b Fp> for Fp
[src]
type Output = Fp
The resulting type after applying the -
operator.
fn sub(self, rhs: &'b Fp) -> Fp
[src]
impl<'a> Sub<Fp> for &'a Fp
[src]
impl Sub<Fp> for Fp
[src]
impl<'b> SubAssign<&'b Fp> for Fp
[src]
fn sub_assign(&mut self, rhs: &'b Fp)
[src]
impl SubAssign<Fp> for Fp
[src]
fn sub_assign(&mut self, rhs: Fp)
[src]
Auto Trait Implementations
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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.
pub 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>,