View Source Eddy.Point (Eddy v1.0.0)

Module for manipulating elliptic curve points, using EdDSA mathematics on the Ed25519 curve.

Link to this section Summary

Types

t()

EdDSA Point

Functions

Adds two elliptic curve points.

Doubles an elliptic curve point.

Compares two elliptic curve points.

Mutiplies an elliptic curve point with the given scalar.

Negates an elliptic curve point.

Subtracts the second elliptic curve point from the first.

Link to this section Types

@type t() :: %Eddy.Point{x: integer(), y: integer()}

EdDSA Point

A Point is a pair of coordinates (x, y) on an elliptic curve. Specifically, the Ed25519 curve, as defined by the equation:

y^2 = x^3 + 486662x^2 + x

Link to this section Functions

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

Adds two elliptic curve points.

@spec double(t()) :: t()

Doubles an elliptic curve point.

@spec eq(t(), t()) :: boolean()

Compares two elliptic curve points.

@spec mul(t(), integer()) :: t()

Mutiplies an elliptic curve point with the given scalar.

@spec neg(t()) :: t()

Negates an elliptic curve point.

@spec sub(t(), t()) :: t()

Subtracts the second elliptic curve point from the first.