Tezex.Crypto.BLS.FqP (tezex v3.2.0)

View Source

Polynomial extension field base class for BLS12-381. This is the base for building higher-degree extension fields like Fq12.

Summary

Functions

Adds two polynomial field elements.

Checks if two elements are equal.

Computes the modular inverse using the extended Euclidean algorithm. Polynomial inversion using extended Euclidean algorithm.

Checks if the element is zero.

Multiplies two polynomial field elements with modular reduction. This implementation uses an optimized multiplication algorithm.

Negates a polynomial field element.

Creates a polynomial extension field element from coefficients.

Returns the one element.

Subtracts two polynomial field elements.

Returns the zero element.

Types

t()

@type t() :: %{coeffs: [Tezex.Crypto.BLS.Fq.t()], modulus_coeffs: [integer()]}

Functions

add(map1, map2)

@spec add(t(), t()) :: t()

Adds two polynomial field elements.

eq?(map1, map2)

@spec eq?(t(), t()) :: boolean()

Checks if two elements are equal.

inv(elem)

@spec inv(t()) :: t()

Computes the modular inverse using the extended Euclidean algorithm. Polynomial inversion using extended Euclidean algorithm.

is_zero?(map)

@spec is_zero?(t()) :: boolean()

Checks if the element is zero.

mul(map1, map2)

@spec mul(t(), t()) :: t()

Multiplies two polynomial field elements with modular reduction. This implementation uses an optimized multiplication algorithm.

neg(map)

@spec neg(t()) :: t()

Negates a polynomial field element.

new(coeffs, modulus_coeffs)

@spec new([Tezex.Crypto.BLS.Fq.t()], [integer()]) :: t()

Creates a polynomial extension field element from coefficients.

one(modulus_coeffs)

@spec one([integer()]) :: t()

Returns the one element.

sub(map1, map2)

@spec sub(t(), t()) :: t()

Subtracts two polynomial field elements.

zero(modulus_coeffs)

@spec zero([integer()]) :: t()

Returns the zero element.