package cryptokit

  1. Overview
  2. Docs

Parameter ECDSA.C

Parameters of the curve

type point

The type of points on the curve.

val x : point -> Z.t

X coordinate of a point.

val y : point -> Z.t

Y coordinate of a point.

val zero : point

The point at infinity. It is the neutral element of the group.

val generator : point

The generator for the group.

val make_point : (Z.t * Z.t) -> point

Construct a point with the given (x, y) coordinates.

val encode_point : ?compressed:bool -> point -> string

Encode a point as a string according to P1363-2000. If compressed is false, the encoding contains the x and y coordinates. If compressed is true, the encoding only contains the x coordinate and the sign of y.

val decode_point : string -> point

Decode a P1363-2000 encoding (as produced by encode_point) into a point of the curve.

val add : point -> point -> point

Sum of two points. This is the group operation.

val neg : point -> point

Opposite of a point. This is the group inverse.

val dbl : point -> point

Doubling of a point: dbl x = add x x, but a bit faster.

val mul : Z.t -> point -> point

Multiplication of a point by a scalar. mul n p is p added to itself n times. n must be non-negative.

val muladd : Z.t -> point -> Z.t -> point -> point

Multiplication of two points by two scalars, and addition. mul n p m q is add (mul n p) (mul m q). n and m must be non-negative.