View Source Tezex.Crypto.Curve (tezex v3.0.1)
Specific elliptic curve data.
Parameters:
:A
[non_neg_integer/0
]: angular coefficient of x in the curve equation. ex: 123:B
[non_neg_integer/0
]: linear coefficient of x in the curve equation. ex: 123:P
[non_neg_integer/0
]: curve modulo. ex: 12345:N
[non_neg_integer/0
]: curve order. ex: 12345:G
[Tezex.Crypto.Point.t/0
]: EC Point corresponding to the public key. ex:%Tezex.Crypto.Point{x: 123, y: 456}
:name
[atom/0
]: curve name. ex: :secp256k1
Summary
Functions
Verifies if the point p
is on the curve using the elliptic curve equation:
y^2 = x^3 + A*x + B (mod P)
Get the curve length
Types
@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() }
Functions
@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
[Tezex.Crypto.Curve.t/0
]: curve datap
[Tezex.Crypto.Point.t/0
]: curve point
Returns:
result
[boolean/0
]: true if point is on the curve, false otherwise
@spec get_length(t()) :: non_neg_integer()
Get the curve length
Parameters:
curve
[Tezex.Crypto.Curve.t/0
]: curve data
Returns:
length
[non_neg_integer/0
]: curve length