package bls12-381-gen

  1. Overview
  2. Docs
include Elliptic_curve_sig.RAW_BASE
val size_in_bytes : int
val check_bytes : Stdlib.Bytes.t -> bool
val check_compressed_bytes : Stdlib.Bytes.t -> bool

check_compressed_bytes bs checks if the given bytes bs represents a point on the curve

val compressed_of_uncompressed : Stdlib.Bytes.t -> Stdlib.Bytes.t

compressed_of_uncompressed bs allocates (size_in_bytes / 2) bytes to copy the compressed version of the point represented by the size_in_bytes bytes (i.e. the « uncompressed » version).

val uncompressed_of_compressed_unsafe : Stdlib.Bytes.t -> Stdlib.Bytes.t

uncompressed_of_compressed bs allocates size_in_bytes bytes to copy the uncompressed version of the point represented by the (size_in_bytes / 2) bytes (i.e. the « compressed » version). The method is signed as « unsafe » because it does not verify the point is on the curve. Therefore, check_compressed_bytes must be used to get a safe version.

val is_zero : Stdlib.Bytes.t -> bool
val random : unit -> Stdlib.Bytes.t
val zero : unit -> Stdlib.Bytes.t
val one : unit -> Stdlib.Bytes.t
val add : Stdlib.Bytes.t -> Stdlib.Bytes.t -> Stdlib.Bytes.t
val mul : Stdlib.Bytes.t -> Stdlib.Bytes.t -> Stdlib.Bytes.t
val eq : Stdlib.Bytes.t -> Stdlib.Bytes.t -> bool
val negate : Stdlib.Bytes.t -> Stdlib.Bytes.t
val double : Stdlib.Bytes.t -> Stdlib.Bytes.t
val build_from_components : Stdlib.Bytes.t -> Stdlib.Bytes.t -> Stdlib.Bytes.t option
OCaml

Innovation. Community. Security.