package bls12-381-gen

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

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

val compressed_of_uncompressed : Bytes.t -> 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 : Bytes.t -> 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 : Bytes.t -> bool
val random : unit -> Bytes.t
val zero : unit -> Bytes.t
val one : unit -> Bytes.t
val add : Bytes.t -> Bytes.t -> Bytes.t
val mul : Bytes.t -> Bytes.t -> Bytes.t
val eq : Bytes.t -> Bytes.t -> bool
val negate : Bytes.t -> Bytes.t
val double : Bytes.t -> Bytes.t
OCaml

Innovation. Community. Security.