package tezos-plonk

  1. Overview
  2. Docs
Plonk zero-knowledge proving system

Install

Dune Dependency

Authors

Maintainers

Sources

privacy-team-v1.0.1.tar.gz
md5=03d6ca5fb1c6865b6628e0dd49575895
sha512=20494d1d00ded43f3625e06e037d3bad04f0a7320914b542b882d3d0293c9b02845b7ca9ee4ff0eb8ea495eff5633016861c39370cca92c12aacae0e84483ca4

doc/tezos-plonk.aggregation/Aggregation/Polynomial_commitment/Make/argument-2-PC/Polynomial/Srs/Srs_g1/index.html

Module Srs.Srs_g1

type polynomial = Polynomial.t
type t
val t : t Repr.t
type elt
val empty : t
val get : t -> int -> elt

get srs i returns the i-th element of srs

val size : t -> int

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

val 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
val generate_insecure : int -> Bls12_381.Fr.t -> t
val 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

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

Innovation. Community. Security.