Type Alias Fp

Source
pub type Fp = Bls12_381Fp;

Aliased Type§

struct Fp(/* private fields */);

Implementations

Source§

impl Bls12_381Fp

Source

pub const fn from_const_bytes(bytes: [u8; 48]) -> Self

Constructor from little-endian bytes. Does not enforce the integer value of bytes must be less than the modulus.

Trait Implementations§

Source§

impl Field for Fp

Source§

const ZERO: Self = <Self as IntMod>::ZERO

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

const ONE: Self = <Self as IntMod>::ONE

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

type SelfRef<'a> = &'a Bls12_381Fp

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> Add<&'a Bls12_381Fp> for Bls12_381Fp

Source§

type Output = Bls12_381Fp

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl Add for Bls12_381Fp

Source§

type Output = Bls12_381Fp

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_381Fp> for Bls12_381Fp

Source§

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

Performs the += operation. Read more
Source§

impl AddAssign for Bls12_381Fp

Source§

fn add_assign(&mut self, other: Self)

Performs the += operation. Read more
Source§

impl Clone for Bls12_381Fp

Source§

fn clone(&self) -> Bls12_381Fp

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 Bls12_381Fp

Source§

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

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

impl<'de> Deserialize<'de> for Bls12_381Fp

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_381Fp> for Bls12_381Fp

Source§

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

Undefined behaviour when denominator is not coprime to N

Source§

impl DivAssignUnsafe for Bls12_381Fp

Source§

fn div_assign_unsafe(&mut self, other: Self)

Undefined behaviour when denominator is not coprime to N

Source§

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

Source§

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

Undefined behaviour when denominator is not coprime to N

Source§

type Output = Bls12_381Fp

Output type of div_unsafe.
Source§

impl DivUnsafe for Bls12_381Fp

Source§

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

Undefined behaviour when denominator is not coprime to N

Source§

type Output = Bls12_381Fp

Output type of div_unsafe.
Source§

impl IntMod for Bls12_381Fp

Source§

fn assert_reduced(&self)

If self is not in its canonical form, the proof will fail to verify. This means guest execution will never terminate (either successfully or unsuccessfully) if self is not in its canonical form.

Source§

const MODULUS: Self::Repr

Modulus as a Repr.
Source§

const ZERO: Self

The zero element (i.e. the additive identity).
Source§

const NUM_LIMBS: usize = 48usize

Number of limbs used to internally represent an element of Self.
Source§

const ONE: Self

The one element (i.e. the multiplicative identity).
Source§

type Repr = [u8; 48]

Underlying representation of IntMod. Usually of the form [u8; NUM_LIMBS].
Source§

type SelfRef<'a> = &'a Bls12_381Fp

SelfRef<'a> should almost always be &'a Self. This is a way to include implementations of binary operations where both sides are &'a Self.
Source§

fn from_repr(repr: Self::Repr) -> Self

Creates a new IntMod from an instance of Repr. Does not enforce the integer value of bytes must be less than the modulus.
Source§

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

Creates a new IntMod from an array of bytes, little endian. Does not enforce the integer value of bytes must be less than the modulus.
Source§

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

Creates a new IntMod from an array of bytes, big endian. Does not enforce the integer value of bytes must be less than the modulus.
Source§

fn from_u8(val: u8) -> Self

Creates a new IntMod from a u8. Does not enforce the integer value of bytes must be less than the modulus.
Source§

fn from_u32(val: u32) -> Self

Creates a new IntMod from a u32. Does not enforce the integer value of bytes must be less than the modulus.
Source§

fn from_u64(val: u64) -> Self

Creates a new IntMod from a u64. Does not enforce the integer value of bytes must be less than the modulus.
Source§

fn as_le_bytes(&self) -> &[u8]

Value of this IntMod as an array of bytes, little endian.
Source§

fn to_be_bytes(&self) -> [u8; 48]

Value of this IntMod as an array of bytes, big endian.
Source§

fn modulus_biguint() -> BigUint

Modulus N as a BigUint.
Source§

fn from_biguint(biguint: BigUint) -> Self

Creates a new IntMod from a BigUint.
Source§

fn as_biguint(&self) -> BigUint

Value of this IntMod as a BigUint.
Source§

fn neg_assign(&mut self)

Source§

fn double_assign(&mut self)

Doubles self in-place.
Source§

fn square_assign(&mut self)

Squares self in-place.
Source§

fn double(&self) -> Self

Doubles this IntMod.
Source§

fn square(&self) -> Self

Squares this IntMod.
Source§

fn cube(&self) -> Self

Cubes this IntMod.
Source§

fn is_reduced(&self) -> bool

Is the integer representation of self less than the modulus?
Source§

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

Source§

type Output = Bls12_381Fp

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul for Bls12_381Fp

Source§

type Output = Bls12_381Fp

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_381Fp> for Bls12_381Fp

Source§

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

Performs the *= operation. Read more
Source§

impl MulAssign for Bls12_381Fp

Source§

fn mul_assign(&mut self, other: Self)

Performs the *= operation. Read more
Source§

impl Neg for Bls12_381Fp

Source§

type Output = Bls12_381Fp

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl PartialEq for Bls12_381Fp

Source§

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

Source§

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

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

impl Product for Bls12_381Fp

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 Reduce for Bls12_381Fp

Source§

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

Interpret the given bytes as an integer and perform a modular reduction.
Source§

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

Source§

impl Serialize for Bls12_381Fp

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_381Fp> for Bls12_381Fp

Source§

type Output = Bls12_381Fp

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl Sub for Bls12_381Fp

Source§

type Output = Bls12_381Fp

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_381Fp> for Bls12_381Fp

Source§

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

Performs the -= operation. Read more
Source§

impl SubAssign for Bls12_381Fp

Source§

fn sub_assign(&mut self, other: Self)

Performs the -= operation. Read more
Source§

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

Source§

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

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

impl Sum for Bls12_381Fp

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_381Fp