package bls12-381-js-gen

  1. Overview
  2. Docs

Module G2.MakeStubsSource

Parameters

module M : sig ... end

Signature

include Bls12_381_gen.Elliptic_curve_sig.RAW_BASE
Sourceval size_in_bytes : int
Sourceval check_bytes : Bytes.t -> bool
Sourceval check_compressed_bytes : Bytes.t -> bool

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

Sourceval 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).

Sourceval 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.

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

Innovation. Community. Security.