openvm_pairing_guest::bls12_381

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

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