Struct pairing_ce::bls12_381::fq::Fq

source ·
pub struct Fq(/* private fields */);

Trait Implementations§

source§

impl Clone for Fq

source§

fn clone(&self) -> Fq

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Fq

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for Fq

source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for Fq

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Fq

source§

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

Formats the value using the given formatter. Read more
source§

impl Field for Fq

source§

fn zero() -> Self

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

fn one() -> Self

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

fn is_zero(&self) -> bool

Returns true iff this element is zero.
source§

fn add_assign(&mut self, other: &Fq)

Adds another element to this element.
source§

fn double(&mut self)

Doubles this element.
source§

fn sub_assign(&mut self, other: &Fq)

Subtracts another element from this element.
source§

fn negate(&mut self)

Negates this element.
source§

fn inverse(&self) -> Option<Self>

Computes the multiplicative inverse of this element, if nonzero.
source§

fn frobenius_map(&mut self, _: usize)

Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
source§

fn mul_assign(&mut self, other: &Fq)

Multiplies another element by this element.
source§

fn square(&mut self)

Squares this element.
source§

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

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

impl From<Fq> for FqRepr

source§

fn from(e: Fq) -> FqRepr

Converts to this type from the input type.
source§

impl Hash for Fq

source§

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

Feeds this value into the given Hasher. Read more
1.3.0 · source§

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

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

impl Ord for Fq

Elements are ordered lexicographically.

source§

fn cmp(&self, other: &Fq) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Fq

source§

fn eq(&self, other: &Fq) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Fq

source§

fn partial_cmp(&self, other: &Fq) -> Option<Ordering>

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

fn lt(&self, other: &Rhs) -> bool

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

fn le(&self, other: &Rhs) -> bool

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

fn gt(&self, other: &Rhs) -> bool

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

fn ge(&self, other: &Rhs) -> bool

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

impl PrimeField for Fq

§

type Repr = FqRepr

The prime field can be converted back and forth into this biginteger representation.
source§

fn from_repr(r: FqRepr) -> Result<Fq, PrimeFieldDecodingError>

Convert this prime field element into a biginteger representation.
source§

fn from_raw_repr(r: FqRepr) -> Result<Self, PrimeFieldDecodingError>

Creates an element from raw representation in Montgommery form.
source§

fn into_repr(&self) -> FqRepr

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

fn into_raw_repr(&self) -> FqRepr

Expose Montgommery represendation.
source§

fn char() -> FqRepr

Returns the field characteristic; the modulus.
source§

const NUM_BITS: u32 = 381u32

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

const CAPACITY: u32 = 380u32

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

fn multiplicative_generator() -> Self

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

const S: u32 = 1u32

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

fn root_of_unity() -> Self

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

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

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

impl Rand for Fq

source§

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

Computes a uniformly random element using rejection sampling.

source§

impl Serialize for Fq

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SqrtField for Fq

source§

fn legendre(&self) -> LegendreSymbol

Returns the Legendre symbol of the field element.
source§

fn sqrt(&self) -> Option<Self>

Returns the square root of the field element, if it is quadratic residue.
source§

impl Copy for Fq

source§

impl Eq for Fq

Auto Trait Implementations§

§

impl Freeze for Fq

§

impl RefUnwindSafe for Fq

§

impl Send for Fq

§

impl Sync for Fq

§

impl Unpin for Fq

§

impl UnwindSafe for Fq

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,