Curvy.Point (Curvy v0.3.0) View Source

Module used for manipulating ECDSA point coordinates.

Link to this section Summary

Types

Jacobian Point Coordiantes

t()

Point Coordinates

Functions

Adds two elliptic curve points.

Doubles an elliptic curve point.

Compares two elliptic curve points.

Converts the signature to a Point using the given hash integer and recovery ID.

Mutiplies an elliptic curve point with the given scalar.

Flips the elliptic curve point to (x, -y).

Subtracts the second elliptic curve point from the first.

Link to this section Types

Specs

jacobian() :: %{x: integer(), y: integer(), z: integer()}

Jacobian Point Coordiantes

Specs

t() :: %Curvy.Point{x: integer(), y: integer()}

Point Coordinates

Link to this section Functions

Specs

add(t(), t()) :: t()

Adds two elliptic curve points.

Returns a Point.

Specs

double(t()) :: t()

Doubles an elliptic curve point.

Returns a Point.

Specs

equals(point :: t(), other :: t()) :: boolean()

Compares two elliptic curve points.

Returns a t:boolean.

Link to this function

from_signature(signature, e, recid)

View Source

Specs

from_signature(Curvy.Signature.t(), integer(), Curvy.Signature.recovery_id()) ::
  t() | :error

Converts the signature to a Point using the given hash integer and recovery ID.

Specs

mul(t(), integer()) :: t()

Mutiplies an elliptic curve point with the given scalar.

Returns a Point.

Specs

negate(point :: t()) :: t()

Flips the elliptic curve point to (x, -y).

Returns a Point.

Specs

subtract(t(), t()) :: t()

Subtracts the second elliptic curve point from the first.

Returns a Point.