package octez-libs
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/octez-libs.kzg/Kzg/Bls/G1_carray/index.html
Module Bls.G1_carray
Source
include module type of struct include Octez_bls12_381_polynomial.G1_carray end
init n f
returns a fresh C array of length n
, with element number i
initialized to the result of f i
.
degree p
returns the index of the last non-zero element of p
. Returns -1 if all elements of p
are zero.
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
fold_left_map
is a combination of fold_left and map that threads an accumulator through calls to f
.
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:
- size of domain must be a power of two
- degree of polynomial must be strictly less than the size of domain
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:
- size of domain must be a power of two
- size of a polynomial must be equal to size of domain
add_arrays_inplace a b
writes the element-wise sum of the input vectors a
and b
into a
mul_arrays evaluations arrays
computes the EC point multiplication given the scalar multipliers evaluations
and the points arrays