package octez-libs
A package that contains multiple base libraries used by the Octez suite
Install
Dune Dependency
Authors
Maintainers
Sources
tezos-octez-v20.1.tag.bz2
sha256=ddfb5076eeb0b32ac21c1eed44e8fc86a6743ef18ab23fff02d36e365bb73d61
sha512=d22a827df5146e0aa274df48bc2150b098177ff7e5eab52c6109e867eb0a1f0ec63e6bfbb0e3645a6c2112de3877c91a17df32ccbff301891ce4ba630c997a65
doc/src/octez-libs.plonk/input_commitment.ml.html
Source file input_commitment.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
open Kzg.Bls open Identities module SMap = Kzg.SMap module type S = sig module Commitment : Kzg.Interfaces.Commitment with type secret = Poly.t Kzg.SMap.t type public_parameters = Commitment.public_parameters type prover_aux = {poly : Poly.t; pc_prover_aux : Commitment.prover_aux} [@@deriving repr] type public = Commitment.t [@@deriving repr] type t = {public : public; prover_aux : prover_aux} [@@deriving repr] (* size is the expected length of the commitment ; it must be at least bigger than the length of the secret if it’s given, the secret is padded with zero to reach this length *) val commit : ?size:int -> ?shift:int -> public_parameters -> int -> Scalar.t array -> t end module Make_impl (Commitment : Kzg.Interfaces.Commitment) = struct module Commitment = Commitment type public_parameters = Commitment.public_parameters type prover_aux = {poly : Poly.t; pc_prover_aux : Commitment.prover_aux} [@@deriving repr] type public = Commitment.t [@@deriving repr] type t = {public : public; prover_aux : prover_aux} [@@deriving repr] let commit ?size ?(shift = 0) pp n secret = let domain = Domain.build n in let l = Array.length secret in let size = Option.value ~default:l size in let secret = Array.(append secret (init (size - l) (Fun.const Scalar.zero))) in (* we add some randomness to hide the secret *) let secret = let random _ = Scalar.random () in let head = Array.init shift random in let tail = Array.init (n - size - shift) random in Array.concat [head; secret; tail] in let poly = Evaluations.interpolation_fft2 domain secret in let poly_map = SMap.singleton "com" poly in let public, pc_prover_aux = Commitment.commit pp poly_map in {public; prover_aux = {poly; pc_prover_aux}} end module Make : functor (Commitment : Kzg.Interfaces.Commitment) -> S with module Commitment = Commitment = Make_impl
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>