Tezex.Crypto.BLS.G1 (tezex v3.2.0)
View SourceG1 elliptic curve group for BLS12-381.
This is the elliptic curve E(Fq): y² = x³ + 4 over the base field Fq. G1 is used for public keys in BLS signatures.
Points are represented in projective coordinates (X, Y, Z) where:
- Affine coordinates: (X/Z, Y/Z) - standard projective coordinate system
- Point at infinity: (1, 1, 0)
Summary
Functions
Adds two G1 points using standard elliptic curve addition.
Doubles a G1 point.
Checks if two G1 points are equal.
Creates a G1 point from affine coordinates.
Deserializes a G1 point from compressed format (48 bytes).
Returns the generator point for G1.
Alias for is_zero?/1 for compatibility.
Checks if a point is on the curve using Jacobian coordinates. Standard curve equation: y² z = x³ + b z³
Checks if a point is the point at infinity.
Multiplies a G1 point by a scalar using binary "double-and-add".
Negates a G1 point.
Creates a G1 point from Jacobian coordinates.
Converts a G1 point to affine coordinates using projective coordinate system where affine = (x/z, y/z), not Jacobian (x/z^2, y/z^3).
Serializes a G1 point to compressed format (48 bytes).
Returns the point at infinity (identity element).
Types
@type t() :: %{ x: Tezex.Crypto.BLS.Fq.t(), y: Tezex.Crypto.BLS.Fq.t(), z: Tezex.Crypto.BLS.Fq.t() }
Functions
Adds two G1 points using standard elliptic curve addition.
Doubles a G1 point.
Checks if two G1 points are equal.
@spec from_affine(Tezex.Crypto.BLS.Fq.t(), Tezex.Crypto.BLS.Fq.t()) :: t()
Creates a G1 point from affine coordinates.
Deserializes a G1 point from compressed format (48 bytes).
@spec generator() :: t()
Returns the generator point for G1.
Alias for is_zero?/1 for compatibility.
Checks if a point is on the curve using Jacobian coordinates. Standard curve equation: y² z = x³ + b z³
Checks if a point is the point at infinity.
@spec mul(t(), Tezex.Crypto.BLS.Fr.t()) :: t()
Multiplies a G1 point by a scalar using binary "double-and-add".
Negates a G1 point.
@spec new(Tezex.Crypto.BLS.Fq.t(), Tezex.Crypto.BLS.Fq.t(), Tezex.Crypto.BLS.Fq.t()) :: t()
Creates a G1 point from Jacobian coordinates.
@spec to_affine(t()) :: {:ok, {Tezex.Crypto.BLS.Fq.t(), Tezex.Crypto.BLS.Fq.t()}} | {:error, :point_at_infinity}
Converts a G1 point to affine coordinates using projective coordinate system where affine = (x/z, y/z), not Jacobian (x/z^2, y/z^3).
Serializes a G1 point to compressed format (48 bytes).
@spec zero() :: t()
Returns the point at infinity (identity element).