Struct bellman_ce::bn256::fq2::Fq2

source ·
pub struct Fq2 {
    pub c0: Fq,
    pub c1: Fq,
}
Expand description

An element of Fq2, represented by c0 + c1 * u.

Fields§

§c0: Fq§c1: Fq

Implementations§

source§

impl Fq2

source

pub fn mul_by_nonresidue(&mut self)

Multiply this element by quadratic nonresidue 9 + u.

source

pub fn mul_by_xi(&mut self)

source

pub fn norm(&self) -> Fq

Norm of Fq2 as extension field in i over Fq

source

pub fn conjugate(&mut self)

Trait Implementations§

source§

impl Clone for Fq2

source§

fn clone(&self) -> Fq2

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 Fq2

source§

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

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

impl Default for Fq2

source§

fn default() -> Fq2

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

impl<'de> Deserialize<'de> for Fq2

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Fq2, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

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

impl Display for Fq2

source§

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

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

impl Field for Fq2

source§

fn zero() -> Fq2

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

fn one() -> Fq2

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 square(&mut self)

Squares this element.
source§

fn double(&mut self)

Doubles this element.
source§

fn negate(&mut self)

Negates this element.
source§

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

Adds another element to this element.
source§

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

Subtracts another element from this element.
source§

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

Multiplies another element by this element.
source§

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

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

fn frobenius_map(&mut self, power: usize)

Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
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 Hash for Fq2

source§

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

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 Fq2

Fq2 elements are ordered lexicographically.

source§

fn cmp(&self, other: &Fq2) -> 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 Fq2

source§

fn eq(&self, other: &Fq2) -> 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 Fq2

source§

fn partial_cmp(&self, other: &Fq2) -> 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 Rand for Fq2

source§

fn rand<R>(rng: &mut R) -> Fq2
where R: Rng,

Generates a random instance of this type using the specified source of randomness.
source§

impl Serialize for Fq2

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

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

impl SqrtField for Fq2

source§

fn legendre(&self) -> LegendreSymbol

Returns the Legendre symbol of the field element.
source§

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

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

impl Copy for Fq2

source§

impl Eq for Fq2

source§

impl StructuralPartialEq for Fq2

Auto Trait Implementations§

§

impl Freeze for Fq2

§

impl RefUnwindSafe for Fq2

§

impl Send for Fq2

§

impl Sync for Fq2

§

impl Unpin for Fq2

§

impl UnwindSafe for Fq2

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>,