Tezex.Crypto.BLS.Fq (tezex v3.2.0)
View SourceBase field Fq for BLS12-381.
This is the base field over which the BLS12-381 elliptic curves are defined. Modulus: 4002409555221667393417789825735904156556882819939007885332058136124031650490837864442687629129015664037894272559787
Summary
Functions
Adds two field elements.
Checks if two field elements are equal.
Computes the Frobenius endomorphism φ: Fq → Fq where φ(x) = x^p. For the base field Fq, this is the identity function since x^p ≡ x (mod p).
Creates a field element from a binary (48 bytes, big-endian).
Creates a field element from an integer. Negative integers are converted to their positive modular equivalent.
Computes the modular inverse of a field element. Returns {:ok, inverse} or {:error, :not_invertible} if the element is zero.
Checks if a field element is one.
Checks if a field element is zero.
Returns the field modulus.
Multiplies two field elements.
Negates a field element.
One element of the field.
Raises a field element to a power.
Generates a random field element.
Computes the square root of a field element if it exists.
Squares a field element.
Subtracts two field elements (a - b).
Converts a field element to 48-byte big-endian binary.
Converts a field element to integer.
Zero element of the field.
Types
@type t() :: binary()
Functions
Adds two field elements.
Checks if two field elements are equal.
Computes the Frobenius endomorphism φ: Fq → Fq where φ(x) = x^p. For the base field Fq, this is the identity function since x^p ≡ x (mod p).
Creates a field element from a binary (48 bytes, big-endian).
Creates a field element from an integer. Negative integers are converted to their positive modular equivalent.
Computes the modular inverse of a field element. Returns {:ok, inverse} or {:error, :not_invertible} if the element is zero.
Checks if a field element is one.
Checks if a field element is zero.
@spec modulus() :: non_neg_integer()
Returns the field modulus.
Multiplies two field elements.
Negates a field element.
@spec one() :: t()
One element of the field.
@spec pow(t(), non_neg_integer()) :: t()
Raises a field element to a power.
@spec random() :: t()
Generates a random field element.
Computes the square root of a field element if it exists.
Squares a field element.
Subtracts two field elements (a - b).
Converts a field element to 48-byte big-endian binary.
@spec to_integer(t()) :: non_neg_integer()
Converts a field element to integer.
@spec zero() :: t()
Zero element of the field.