package octez-libs

  1. Overview
  2. Docs
A package that contains multiple base libraries used by the Octez suite

Install

Dune Dependency

Authors

Maintainers

Sources

tezos-18.1.tar.gz
sha256=aa2f5bc99cc4ca2217c52a1af2a2cdfd3b383208cb859ca2e79ca0903396ca1d
sha512=d68bb3eb615e3dcccc845fddfc9901c95b3c6dc8e105e39522ce97637b1308a7fa7aa1d271351d5933febd7476b2819e1694f31198f1f0919681f1f9cc97cb3a

doc/octez-libs.bls12-381-polynomial/Octez_bls12_381_polynomial/Srs/Srs_g2/index.html

Module Srs.Srs_g2Source

Sourcetype polynomial = Polynomial.t
Sourcetype t
Sourceval t : t Repr.t
Sourceval empty : t
Sourceval get : t -> int -> elt

get srs i returns the i-th element of srs

Sourceval size : t -> int

Returns the pippenger ctxt size, i.e. the number of elements the context is supposed to be called with

Sourceval of_bigstring : ?len:int -> Bigstringaf.t -> (t, [> `End_of_file of string | `Invalid_point of int ]) result

of_bigstring ~len bs reads len points of G in affine compressed format from bs and returns a Srs. If len is omitted the whole bs is read. The bigstring can be loaded from a file with:

let bigstring_of_file filename =
  let fd = Unix.openfile filename [ Unix.O_RDONLY ] 0o440 in
  Bigarray.array1_of_genarray
  @@ Unix.map_file fd Bigarray.char Bigarray.c_layout false
       [| (* [-1] means read the whole file *) -1 |]
in
Srs_g1.of_bigstring
      (bigstring_of_file ("srs_zcash_g1_21"))
      (1 lsl 5)

or with Lwt:

let bigstring_of_file filename =
  let fd = Unix.openfile filename [ Unix.O_RDONLY ] 0o440 in
  Lwt_bytes.map_file ~fd ~shared:false ()
in
Sourceval generate_insecure : int -> Bls12_381.Fr.t -> t
Sourceval pippenger : ?offset:int -> ?len:int -> t -> polynomial -> elt

pippenger ctxt poly computes the multiscalar exponentiation using the SRS saved in the context and the coefficients of the given polynomial

Sourceval to_array : ?len:int -> t -> elt array
OCaml

Innovation. Community. Security.