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

Specific elliptic curve data.

Parameters:
  - `:A` [`t:non_neg_integer/0`]: angular coefficient of x in the curve equation. ex: 123
  - `:B` [`t:non_neg_integer/0`]: linear coefficient of x in the curve equation. ex: 123
  - `:P` [`t:non_neg_integer/0`]: curve modulo. ex: 12345
  - `:N` [`t:non_neg_integer/0`]: curve order. ex: 12345
  - `:G` [`t:Tezex.Crypto.Point.t/0`]: EC Point corresponding to the public key. ex: `%Tezex.Crypto.Point{x: 123, y: 456}`
  - `:name` [`t:atom/0`]: curve name. ex: :secp256k1

# `t`

```elixir
@type t() :: %Tezex.Crypto.Curve{
  A: non_neg_integer(),
  B: non_neg_integer(),
  G: Tezex.Crypto.Point.t(),
  N: non_neg_integer(),
  P: non_neg_integer(),
  name: atom()
}
```

# `contains?`

```elixir
@spec contains?(t(), Tezex.Crypto.Point.t()) :: boolean()
```

Verifies if the point `p` is on the curve using the elliptic curve equation:
y^2 = x^3 + A*x + B (mod P)

Parameters:
- `curve` [`t:Tezex.Crypto.Curve.t/0`]: curve data
- `p` [`t:Tezex.Crypto.Point.t/0`]: curve point

Returns:
- `result` [`t:boolean/0`]: true if point is on the curve, false otherwise

# `get_length`

```elixir
@spec get_length(t()) :: non_neg_integer()
```

Get the curve length

Parameters:
- `curve` [`t:Tezex.Crypto.Curve.t/0`]: curve data

Returns:
- `length` [`t:non_neg_integer/0`]: curve length

---

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