Struct pairing_ce::bls12_381::Fr[][src]

pub struct Fr(_);

Trait Implementations

impl Clone for Fr[src]

fn clone(&self) -> Fr[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Fr[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Fr[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl Display for Fr[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Field for Fr[src]

fn zero() -> Self[src]

Returns the zero element of the field, the additive identity.

fn one() -> Self[src]

Returns the one element of the field, the multiplicative identity.

fn is_zero(&self) -> bool[src]

Returns true iff this element is zero.

fn add_assign(&mut self, other: &Fr)[src]

Adds another element to this element.

fn double(&mut self)[src]

Doubles this element.

fn sub_assign(&mut self, other: &Fr)[src]

Subtracts another element from this element.

fn negate(&mut self)[src]

Negates this element.

fn inverse(&self) -> Option<Self>[src]

Computes the multiplicative inverse of this element, if nonzero.

fn frobenius_map(&mut self, _: usize)[src]

Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism. Read more

fn mul_assign(&mut self, other: &Fr)[src]

Multiplies another element by this element.

fn square(&mut self)[src]

Squares this element.

fn pow<S>(&self, exp: S) -> Self where
    S: AsRef<[u64]>, 
[src]

Exponentiates this element by a number represented with u64 limbs, least significant digit first. Read more

impl From<Fr> for FrRepr[src]

fn from(e: Fr) -> FrRepr[src]

Performs the conversion.

impl Hash for Fr[src]

fn hash<H: Hasher>(&self, state: &mut H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl Ord for Fr[src]

Elements are ordered lexicographically.

fn cmp(&self, other: &Fr) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Fr> for Fr[src]

fn eq(&self, other: &Fr) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl PartialOrd<Fr> for Fr[src]

fn partial_cmp(&self, other: &Fr) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl PrimeField for Fr[src]

type Repr = FrRepr

The prime field can be converted back and forth into this biginteger representation. Read more

fn from_repr(r: FrRepr) -> Result<Fr, PrimeFieldDecodingError>[src]

Convert this prime field element into a biginteger representation.

fn from_raw_repr(r: FrRepr) -> Result<Self, PrimeFieldDecodingError>[src]

Creates an element from raw representation in Montgommery form.

fn into_repr(&self) -> FrRepr[src]

Convert a biginteger representation into a prime field element, if the number is an element of the field. Read more

fn into_raw_repr(&self) -> FrRepr[src]

Expose Montgommery represendation.

fn char() -> FrRepr[src]

Returns the field characteristic; the modulus.

const NUM_BITS: u32[src]

How many bits are needed to represent an element of this field.

const CAPACITY: u32[src]

How many bits of information can be reliably stored in the field element.

fn multiplicative_generator() -> Self[src]

Returns the multiplicative generator of char() - 1 order. This element must also be quadratic nonresidue. Read more

const S: u32[src]

2^s * t = char() - 1 with t odd.

fn root_of_unity() -> Self[src]

Returns the 2^s root of unity computed by exponentiating the multiplicative_generator() by t. Read more

fn from_str(s: &str) -> Option<Self>[src]

Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string. Read more

impl Rand for Fr[src]

fn rand<R: Rng>(rng: &mut R) -> Self[src]

Computes a uniformly random element using rejection sampling.

impl SqrtField for Fr[src]

fn legendre(&self) -> LegendreSymbol[src]

Returns the Legendre symbol of the field element.

fn sqrt(&self) -> Option<Self>[src]

Returns the square root of the field element, if it is quadratic residue. Read more

impl Copy for Fr[src]

impl Eq for Fr[src]

Auto Trait Implementations

impl RefUnwindSafe for Fr

impl Send for Fr

impl Sync for Fr

impl Unpin for Fr

impl UnwindSafe for Fr

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

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]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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]

Performs the conversion.