Type Alias Fp2

Source
pub type Fp2 = Bls12_381Fp2;

Aliased Type§

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

Fields§

§c0: Bls12_381Fp

Real coordinate

§c1: Bls12_381Fp

Imaginary coordinate

Implementations

Source§

impl Bls12_381Fp2

Source

pub const ZERO: Self

Source

pub const ONE: Self

Source

pub fn neg_assign(&mut self)

Source§

impl Bls12_381Fp2

Source

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

Trait Implementations§

Source§

impl FieldExtension<Bls12_381Fp> for Fp2

Source§

const D: usize = 2usize

Extension field degree.
Source§

type Coeffs = [Bls12_381Fp; 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(base_elem: 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 Bls12_381Fp2> for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

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 Bls12_381Fp2> for Bls12_381Fp2

Source§

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

Performs the += operation. Read more
Source§

impl AddAssign for Bls12_381Fp2

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Clone for Bls12_381Fp2

Source§

fn clone(&self) -> Bls12_381Fp2

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 Bls12_381Fp2

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 Bls12_381Fp2

Source§

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

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

impl<'de> Deserialize<'de> for Bls12_381Fp2

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 Bls12_381Fp2> for Bls12_381Fp2

Source§

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

Undefined behavior when denominator is not invertible.
Source§

impl DivAssignUnsafe for Bls12_381Fp2

Source§

fn div_assign_unsafe(&mut self, other: Self)

Undefined behavior when denominator is not invertible.
Source§

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

Source§

type Output = Bls12_381Fp2

Output type of div_unsafe.
Source§

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

Undefined behavior when denominator is not invertible.
Source§

impl DivUnsafe for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

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 Bls12_381Fp2

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 Bls12_381Fp2 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 Bls12_381Fp2> for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

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 Bls12_381Fp2> for Bls12_381Fp2

Source§

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

Performs the *= operation. Read more
Source§

impl MulAssign for Bls12_381Fp2

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Neg for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Bls12_381Fp2

Source§

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

Source§

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

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

impl Product for Bls12_381Fp2

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 Bls12_381Fp2

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 Bls12_381Fp2> for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub for Bls12_381Fp2

Source§

type Output = Bls12_381Fp2

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 Bls12_381Fp2> for Bls12_381Fp2

Source§

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

Performs the -= operation. Read more
Source§

impl SubAssign for Bls12_381Fp2

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

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

Source§

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

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

impl Sum for Bls12_381Fp2

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 Bls12_381Fp2

Source§

impl StructuralPartialEq for Bls12_381Fp2