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.kzg/bls.ml.html
Source file bls.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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
module Poly = Polynomial module Pairing = Bls12_381.Pairing module Srs = Srs module Evals = Evaluations module Scalar = struct include Bls12_381.Fr type scalar = t let mone = negate one let string_of_scalar s = if String.length (to_string s) < 10 then to_string s else if String.length (to_string (negate s)) < 10 then "-" ^ to_string (negate s) else "H" ^ (to_z s |> Z.hash |> string_of_int) let equal a b = Bytes.equal (to_bytes a) (to_bytes b) (* TODO https://gitlab.com/nomadic-labs/privacy-team/-/issues/183 Duplicated in plonk/bls.ml *) let t : t Repr.t = Repr.(map (bytes_of (`Fixed size_in_bytes)) of_bytes_exn to_bytes) let encoding = conv to_bytes of_bytes_exn (Fixed.bytes size_in_bytes) end module Scalar_map = Map.Make (Scalar) module G (G : Bls12_381.CURVE) (Srs : Srs_sig with type elt = G.t) = struct module Srs = Srs include G let t : t Repr.t = Repr.( map (bytes_of (`Fixed (size_in_bytes / 2))) of_compressed_bytes_exn to_compressed_bytes) let encoding = conv to_compressed_bytes of_compressed_bytes_exn (Fixed.bytes (size_in_bytes / 2)) end module Srs_g1 = Srs.Srs_g1 module Srs_g2 = Srs.Srs_g2 module G1 = G (Bls12_381.G1) (Srs_g1) module G2 = G (Bls12_381.G2) (Srs_g2) module type G_sig = sig include Bls12_381.CURVE module Srs : Srs_sig with type elt = t val t : t Repr.ty val encoding : t encoding end module GT = struct include Bls12_381.GT let t : t Repr.t = Repr.(map (bytes_of (`Fixed size_in_bytes)) of_bytes_exn to_bytes) end let to_encoding repr = let of_string repr bs = Stdlib.Result.map_error (fun (`Msg msg) -> msg) @@ Repr.(unstage @@ of_bin_string repr) bs in let to_string repr e = Repr.(unstage @@ to_bin_string repr) e in let data_encoding_of_repr repr = Data_encoding.conv_with_guard (to_string repr) (of_string repr) (Data_encoding.string' Hex) in data_encoding_of_repr repr module Domain = struct include Domain let encoding = to_encoding Domain.t end module G1_carray = struct include G1_carray let encoding = to_encoding G1_carray.t end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>