Mavkit_bls12_381_polynomial.G1_carray
type elt = Mavryk_bls12_381.G1.t
val t : t Repr.t
val empty : t
val allocate : int -> t
allocate len
creates a C array of size len
initialized with zeros.
init n f
returns a fresh C array of length n
, with element number i
initialized to the result of f i
.
val degree : t -> int
degree p
returns the index of the last non-zero element of p
. Returns -1 if all elements of p
are zero.
val erase : t -> int -> unit
erase p n
fills with zeros the first n
elements of p
.
val length : t -> int
length c
returns the length of a C array c
get_inplace c i res
copies the i
-th element of a C array c
in res
iter_copy_elt f a
applies function f
in turn to a **copy** of all the elements of a
. It is equivalent to f a.(0); f a.(1); ...; f a.(length a - 1); ()
.
Same as iter_copy_elt
, but the function is applied to the index of the element as first argument, and a **copy** of the element itself as second argument.
copy c
copies len
elements from a C array c
starting from position offset
blit src src_off dst dst_off len
copies len
elements from src
to dst
starting at the respective offsets.
equal a offset1 b offset2
returns true if the segments of len
elements of a
and b
are equal starting from their respective offsets offset1
(for a
) and offset2
(for b
).
to_array c
converts a C array c
to an OCaml array
val of_bigstring : Bigstringaf.t -> t
val to_bigstring : t -> Bigstringaf.t
fold_left_map
is a combination of fold_left and map that threads an accumulator through calls to f
.
type domain = Domain.t
evaluation_ecfft domain points
computes the ECFFT. domain
can be obtained using Domain.build
.
The ECFFT computes the G-linear map G^n -> G^n :
(P_i)_{i=0,...,n-1} |-> (sum_{i=0}^{n-1} [domain.(i*j mod n)]P_i)_{j=0,...,n-1}
.
where a
P denotes the elliptic curve point multiplication.
Note:
interpolation_ecfft_inplace domain points
computes the inverse ECFFT. domain
can be obtained using Domain.build
.
It is the inverse function of evaluation_ecfft_inplace
.
Note:
add_arrays_inplace a b
writes the element-wise sum of the input vectors a
and b
into a
type evaluations = Evaluations.t
val mul_arrays : evaluations:evaluations array -> arrays:t array -> t array
mul_arrays evaluations arrays
computes the EC point multiplication given the scalar multipliers evaluations
and the points arrays