package tezos-bls12-381-polynomial

  1. Overview
  2. Docs
module Fr = Bls12_381.Fr
module Stubs : sig ... end
module Carray : sig ... end
include module type of struct include Carray end
type scalar = Bls12_381.Fr.t
type t = Stubs.fr_array * int
val encoding : t Data_encoding.t
val allocate : int -> Stubs.fr_array

allocate len creates a C array of size len intialized with zeros of blst_fr

val erase : t -> unit

erase c overwrites a C array c with zeros of blst_fr

val length : t -> int

length c returns the length of a C array c

val get : t -> int -> scalar

get c i returns the i-th element of a C array c

val copy : ?offset:int -> ?len:int -> t -> t

copy c copies len elements from a C array c starting from position offset

val to_string : t -> string

to_string c returns the string representation of a C array c

val to_array : t -> scalar array

to_array c converts a C array c to an OCaml array

val of_array : scalar array -> t

of_array c converts an OCaml array c to a C array

val equal : t -> t -> bool

equal a b checks whether a C array a is equal to a C array b

Note: equal is defined as polynomial equality, i.e., a and b can have different sizes and padded with zeros of blst_fr

OCaml

Innovation. Community. Security.