# `Tezex.Crypto.BLS.G1`
[🔗](https://github.com/objkt-com/tezex/blob/v4.0.0/lib/crypto/bls/g1.ex#L1)

G1 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)

# `t`

```elixir
@type t() :: %{
  x: Tezex.Crypto.BLS.Fq.t(),
  y: Tezex.Crypto.BLS.Fq.t(),
  z: Tezex.Crypto.BLS.Fq.t()
}
```

# `add`

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

Adds two G1 points using standard elliptic curve addition.

# `double`

```elixir
@spec double(t()) :: t()
```

Doubles a G1 point.

# `eq?`

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

Checks if two G1 points are equal.

# `from_affine`

```elixir
@spec from_affine(Tezex.Crypto.BLS.Fq.t(), Tezex.Crypto.BLS.Fq.t()) :: t()
```

Creates a G1 point from affine coordinates.

# `from_compressed_bytes`

```elixir
@spec from_compressed_bytes(binary()) :: {:ok, t()} | {:error, :invalid_point}
```

Deserializes a G1 point from compressed format (48 bytes).

# `generator`

```elixir
@spec generator() :: t()
```

Returns the generator point for G1.

# `is_infinity?`

```elixir
@spec is_infinity?(t()) :: boolean()
```

Alias for is_zero?/1 for compatibility.

# `is_on_curve?`

```elixir
@spec is_on_curve?(t()) :: boolean()
```

Checks if a point is on the curve using Jacobian coordinates.
Standard curve equation: y² * z = x³ + b * z³

# `is_zero?`

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

Checks if a point is the point at infinity.

# `mul`

```elixir
@spec mul(t(), Tezex.Crypto.BLS.Fr.t()) :: t()
```

Multiplies a G1 point by a scalar using binary "double-and-add".

# `negate`

```elixir
@spec negate(t()) :: t()
```

Negates a G1 point.

# `new`

```elixir
@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.

# `to_affine`

```elixir
@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).

# `to_compressed_bytes`

```elixir
@spec to_compressed_bytes(t()) :: binary()
```

Serializes a G1 point to compressed format (48 bytes).

# `zero`

```elixir
@spec zero() :: t()
```

Returns the point at infinity (identity element).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
