package secp256k1-internal

  1. Overview
  2. Docs

Module Internal.GroupSource

Sourcetype t

Type of a group element (affine coordinates).

Sourcetype ge = t
Sourcemodule Storage : sig ... end
Sourcemodule Jacobian : sig ... end
Sourceval of_fields : ?x:Field.t -> ?y:Field.t -> ?infinity:bool -> unit -> t
Sourceval g : t
Sourceval set_xy : t -> Field.t -> Field.t -> unit

Set a group element equal to the point with given X and Y coordinates

Sourceval set_xquad : t -> Field.t -> unit

Set a group element (affine) equal to the point with the given X coordinate and a Y coordinate that is a quadratic residue modulo p. The return value is true iff a coordinate with the given X coordinate exists.

Sourceval set_xovar : t -> Field.t -> int -> bool

Set a group element (affine) equal to the point with the given X coordinate, and given oddness for Y. Return value indicates whether the result is valid.

Sourceval is_infinity : t -> bool

Check whether a group element is the point at infinity.

Sourceval is_valid_var : t -> bool

Check whether a group element is valid (i.e., on the curve).

Sourceval neg : t -> t -> unit

neg r a Set r equal to the inverse of a (i.e., mirrored around the X axis)

Sourceval clear : t -> unit

Clear a t to prevent leaking sensitive information.

Sourceval to_storage : Storage.t -> t -> unit

Convert a group element to the storage type.

Sourceval from_storage : t -> Storage.t -> unit

Convert a group element back from the storage type.

Sourceval to_pubkey : ?compress:bool -> Cstruct.t -> t -> Cstruct.t

to_pubkey ?compress buf ge serializes ge in buf and returns buf, adjusted to the actual size.

Sourceval from_pubkey : t -> Cstruct.t -> unit

from_pubkey ge buf parses a serialized pubkey in buf and writes the result in ge.

OCaml

Innovation. Community. Security.