View Source Bitcoinex.Secp256k1.Point (bitcoinex v0.1.8)

Contains the x, y, and z of an elliptic curve point.

Link to this section Summary

Functions

has_even_y returns true if y is even and false if y is odd

is_inf returns whether or not point P is the point at infinity, ie. P.x == P.y == 0

lift_x returns the Point P where P.x = x and P.y is even.

parse_public_key parses a public key

sec serializes a compressed public key to binary

serialize_public_key serializes a compressed public key to string

x_bytes returns the binary encoding of the x value of the point

x_hex returns the hex-encoded x value of the point

Link to this section Types

@type t() :: %Bitcoinex.Secp256k1.Point{x: integer(), y: integer(), z: integer()}

Link to this section Functions

@spec has_even_y(t()) :: boolean()

has_even_y returns true if y is even and false if y is odd

@spec is_inf(t()) :: boolean()

is_inf returns whether or not point P is the point at infinity, ie. P.x == P.y == 0

Link to this macro

is_point(term)

View Source (macro)
@spec lift_x(integer() | binary()) :: {:ok, t()} | {:error, String.t()}

lift_x returns the Point P where P.x = x and P.y is even.

@spec parse_public_key(binary()) :: {:ok, t()} | {:error, String.t()}

parse_public_key parses a public key

@spec sec(t()) :: binary()

sec serializes a compressed public key to binary

Link to this function

serialize_public_key(pubkey)

View Source
@spec serialize_public_key(t()) :: String.t()

serialize_public_key serializes a compressed public key to string

@spec x_bytes(t()) :: binary()

x_bytes returns the binary encoding of the x value of the point

@spec x_hex(t()) :: String.t()

x_hex returns the hex-encoded x value of the point