Type Alias Fp2

Source
pub type Fp2 = Bn254Fp2;

Aliased Type§

struct Fp2 {
    pub c0: Bn254Fp,
    pub c1: Bn254Fp,
}

Fields§

§c0: Bn254Fp

Real coordinate

§c1: Bn254Fp

Imaginary coordinate

Implementations

Source§

impl Bn254Fp2

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub fn neg_assign(&mut self)

Source§

impl Bn254Fp2

Source

pub const fn new(c0: Fp, c1: Fp) -> Self

Trait Implementations§

Source§

impl FieldExtension<Bn254Fp> for Fp2

Source§

const D: usize = 2usize

Extension field degree.
Source§

type Coeffs = [Bn254Fp; 2]

This should be [BaseField; D]. It is an associated type due to rust const generic limitations.
Source§

fn from_coeffs([c0, c1]: Self::Coeffs) -> Self

Create an extension field element from its base field coefficients.
Source§

fn from_bytes(bytes: &[u8]) -> Self

Create an extension field element from little-endian bytes.
Source§

fn to_coeffs(self) -> Self::Coeffs

Convert an extension field element to its base field coefficients.
Source§

fn to_bytes(&self) -> Vec<u8>

Convert an extension field element to little-endian bytes.
Source§

fn embed(c0: Fp) -> Self

Embed a base field element into an extension field element.
Source§

fn frobenius_map(&self, power: usize) -> Self

Frobenius map: take self to the p^powerth power, where p is the prime characteristic of the field.
Source§

fn mul_base(&self, rhs: &Fp) -> Self

Multiply an extension field element by an element in the base field
Source§

impl<'a> Add<&'a Bn254Fp2> for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the + operator.
Source§

fn add(self, other: &'a Bn254Fp2) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a> AddAssign<&'a Bn254Fp2> for Bn254Fp2

Source§

fn add_assign(&mut self, other: &'a Bn254Fp2)

Performs the += operation. Read more
Source§

impl AddAssign for Bn254Fp2

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Clone for Bn254Fp2

Source§

fn clone(&self) -> Bn254Fp2

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 ComplexConjugate for Bn254Fp2

Source§

fn conjugate(self) -> Self

Conjugate an extension field element.
Source§

fn conjugate_assign(&mut self)

Replace self with its conjugate.
Source§

impl Debug for Bn254Fp2

Source§

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

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

impl<'de> Deserialize<'de> for Bn254Fp2

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<'a> DivAssignUnsafe<&'a Bn254Fp2> for Bn254Fp2

Source§

fn div_assign_unsafe(&mut self, other: &'a Bn254Fp2)

Undefined behavior when denominator is not invertible.
Source§

impl DivAssignUnsafe for Bn254Fp2

Source§

fn div_assign_unsafe(&mut self, other: Self)

Undefined behavior when denominator is not invertible.
Source§

impl<'a> DivUnsafe<&'a Bn254Fp2> for Bn254Fp2

Source§

type Output = Bn254Fp2

Output type of div_unsafe.
Source§

fn div_unsafe(self, other: &'a Bn254Fp2) -> Self::Output

Undefined behavior when denominator is not invertible.
Source§

impl DivUnsafe for Bn254Fp2

Source§

type Output = Bn254Fp2

Output type of div_unsafe.
Source§

fn div_unsafe(self, other: Self) -> Self::Output

Undefined behavior when denominator is not invertible.
Source§

impl Field for Bn254Fp2

Source§

const ZERO: Self = Self::ZERO

The zero element of the field, the additive identity.
Source§

const ONE: Self = Self::ONE

The one element of the field, the multiplicative identity.
Source§

type SelfRef<'a> = &'a Bn254Fp2 where Self: 'a

Source§

fn double_assign(&mut self)

Doubles self in-place.
Source§

fn square_assign(&mut self)

Square self in-place
Source§

fn invert(&self) -> Self

Unchecked inversion. See DivUnsafe. Read more
Source§

impl<'a> Mul<&'a Bn254Fp2> for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the * operator.
Source§

fn mul(self, other: &'a Bn254Fp2) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a> MulAssign<&'a Bn254Fp2> for Bn254Fp2

Source§

fn mul_assign(&mut self, other: &'a Bn254Fp2)

Performs the *= operation. Read more
Source§

impl MulAssign for Bn254Fp2

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Neg for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Bn254Fp2

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Product<&'a Bn254Fp2> for Bn254Fp2

Source§

fn product<I: Iterator<Item = &'a Bn254Fp2>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Product for Bn254Fp2

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl Serialize for Bn254Fp2

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<'a> Sub<&'a Bn254Fp2> for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the - operator.
Source§

fn sub(self, other: &'a Bn254Fp2) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Bn254Fp2

Source§

type Output = Bn254Fp2

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a> SubAssign<&'a Bn254Fp2> for Bn254Fp2

Source§

fn sub_assign(&mut self, other: &'a Bn254Fp2)

Performs the -= operation. Read more
Source§

impl SubAssign for Bn254Fp2

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

impl<'a> Sum<&'a Bn254Fp2> for Bn254Fp2

Source§

fn sum<I: Iterator<Item = &'a Bn254Fp2>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Sum for Bn254Fp2

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl Eq for Bn254Fp2

Source§

impl StructuralPartialEq for Bn254Fp2