From e9a9b61969b7a44749bed9bd9cdbcb4f2283220f Mon Sep 17 00:00:00 2001 From: Victor Dumitrescu Date: Fri, 23 Sep 2022 16:30:47 +0200 Subject: [PATCH 1/2] BLS: use bls12-381.5.0.0 and bls12-381-signature.1.0.0 for signature --- manifest/main.ml | 7 ++- opam/tezos-crypto.opam | 3 +- opam/tezos-protocol-environment.opam | 2 +- package-lock.json | 6 +-- package.json | 2 +- src/lib_crypto/bls.ml | 50 +++++++++---------- src/lib_crypto/bls.mli | 6 +-- src/lib_crypto/dune | 3 +- .../environment_V4.ml | 24 ++++----- .../environment_V4.mli | 2 +- .../environment_V5.ml | 6 +-- .../environment_V5.mli | 4 +- .../environment_V6.ml | 6 +-- .../environment_V6.mli | 4 +- src/lib_signer_backends/encrypted.ml | 2 +- .../tx_rollup_benchmarks.ml | 12 ++--- .../tx_rollup_benchmarks.ml | 8 +-- .../test/pbt/test_tx_rollup_l2_encoding.ml | 2 +- .../tx_rollup_benchmarks.ml | 8 +-- .../test/pbt/test_tx_rollup_l2_encoding.ml | 2 +- 20 files changed, 83 insertions(+), 76 deletions(-) diff --git a/manifest/main.ml b/manifest/main.ml index 9307c505fa46..e4df3965b7f3 100644 --- a/manifest/main.ml +++ b/manifest/main.ml @@ -82,13 +82,17 @@ let bigstringaf = let bisect_ppx = opam_only "bisect_ppx" V.(at_least "2.7.0") let bls12_381 = - let version = V.(at_least "4.0.0" && less_than "4.1.0") in + let version = V.(at_least "5.0.0" && less_than "5.1.0") in external_lib ~js_compatible:true ~npm_deps:[Npm.make "@dannywillems/ocaml-bls12-381" version] "bls12-381" version +let bls12_381_signature = + let version = V.exactly "1.0.0" in + external_lib ~js_compatible:true "bls12-381-signature" version + let bls12_381_polynomial = let version = V.at_least "0.1.0" in external_lib ~js_compatible:false "tezos-bls12-381-polynomial" version @@ -784,6 +788,7 @@ let octez_crypto = zarith; zarith_stubs_js; bls12_381; + bls12_381_signature; ] ~js_compatible:true diff --git a/opam/tezos-crypto.opam b/opam/tezos-crypto.opam index 4be50b0e047e..821ad15dd175 100644 --- a/opam/tezos-crypto.opam +++ b/opam/tezos-crypto.opam @@ -20,7 +20,8 @@ depends: [ "ringo" { >= "0.9" } "zarith" { >= "1.12" & < "1.13" } "zarith_stubs_js" - "bls12-381" { >= "4.0.0" & < "4.1.0" } + "bls12-381" { >= "5.0.0" & < "5.1.0" } + "bls12-381-signature" { = "1.0.0" } "alcotest" { with-test & >= "1.5.0" } "qcheck-alcotest" { with-test & >= "0.18" } "tezos-test-helpers" {with-test} diff --git a/opam/tezos-protocol-environment.opam b/opam/tezos-protocol-environment.opam index f3b99f85119c..0ca4a3fd0f77 100644 --- a/opam/tezos-protocol-environment.opam +++ b/opam/tezos-protocol-environment.opam @@ -15,7 +15,7 @@ depends: [ "tezos-lwt-result-stdlib" "tezos-scoru-wasm" "data-encoding" { >= "0.6" & < "0.7" } - "bls12-381" { >= "4.0.0" & < "4.1.0" } + "bls12-381" { >= "5.0.0" & < "5.1.0" } "tezos-plonk" { >= "0.1.2" } "zarith" { >= "1.12" & < "1.13" } "zarith_stubs_js" diff --git a/package-lock.json b/package-lock.json index ec037f0a30eb..ddaff16cb31d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3,9 +3,9 @@ "lockfileVersion": 1, "dependencies": { "@dannywillems/ocaml-bls12-381": { - "version": "4.0.0", - "resolved": "https://gitlab.com/api/v4/projects/16568061/packages/npm/@dannywillems/ocaml-bls12-381/-/@dannywillems/ocaml-bls12-381-4.0.0.tgz", - "integrity": "sha1-M2TlDp0LJ6czBxLqJY/+IZ5tORI=" + "version": "5.0.0", + "resolved": "https://gitlab.com/api/v4/projects/16568061/packages/npm/@dannywillems/ocaml-bls12-381/-/@dannywillems/ocaml-bls12-381-5.0.0.tgz", + "integrity": "sha1-CfFSlhsC5Foa3Kl3zve71YmCli4=" }, "@nomadic-labs/secp256k1-wasm": { "version": "0.3.0", diff --git a/package.json b/package.json index 6311cadb83f6..fb83f3d07052 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "n/a", "license": "n/a", "dependencies": { - "@dannywillems/ocaml-bls12-381": ">=4.0.0 <4.1.0", + "@dannywillems/ocaml-bls12-381": ">=5.0.0 <5.1.0", "@nomadic-labs/secp256k1-wasm": ">=0.3.0", "hacl-wasm": "1.1.0" } diff --git a/src/lib_crypto/bls.ml b/src/lib_crypto/bls.ml index 76bc0193f6bf..8918679b47eb 100644 --- a/src/lib_crypto/bls.ml +++ b/src/lib_crypto/bls.ml @@ -45,9 +45,9 @@ end let () = Base58.check_encoded_prefix Public_key_hash.b58check_encoding "tz4" 36 module Public_key = struct - open Bls12_381.Signature.MinPk + open Bls12_381_signature.MinPk - type t = Bls12_381.Signature.MinPk.pk + type t = Bls12_381_signature.MinPk.pk let name = "Bls12_381.Public_key" @@ -63,7 +63,7 @@ module Public_key = struct let of_bytes_without_validation = of_bytes_opt - let size _pk = Bls12_381.Signature.MinPk.pk_size_in_bytes + let size _pk = Bls12_381_signature.MinPk.pk_size_in_bytes type Base58.data += Data of t @@ -84,8 +84,8 @@ module Public_key = struct let compare a b = Bytes.compare - (Bls12_381.Signature.MinPk.pk_to_bytes a) - (Bls12_381.Signature.MinPk.pk_to_bytes b) + (Bls12_381_signature.MinPk.pk_to_bytes a) + (Bls12_381_signature.MinPk.pk_to_bytes b) end) include Helpers.MakeRaw (struct @@ -134,7 +134,7 @@ module Public_key = struct end module Secret_key = struct - type t = Bls12_381.Signature.sk + type t = Bls12_381_signature.sk let name = "Bls12_381.Secret_key" @@ -144,22 +144,22 @@ module Secret_key = struct type nonrec t = t let compare a b = - let a = Bls12_381.Signature.sk_to_bytes a - and b = Bls12_381.Signature.sk_to_bytes b in + let a = Bls12_381_signature.sk_to_bytes a + and b = Bls12_381_signature.sk_to_bytes b in Bytes.compare a b end) - let size = Bls12_381.Signature.sk_size_in_bytes + let size = Bls12_381_signature.sk_size_in_bytes - let to_bytes = Bls12_381.Signature.sk_to_bytes + let to_bytes = Bls12_381_signature.sk_to_bytes let to_string s = Bytes.to_string (to_bytes s) - let of_bytes_opt = Bls12_381.Signature.sk_of_bytes_opt + let of_bytes_opt = Bls12_381_signature.sk_of_bytes_opt let of_string_opt s = of_bytes_opt (Bytes.of_string s) - let to_public_key = Bls12_381.Signature.MinPk.derive_pk + let to_public_key = Bls12_381_signature.MinPk.derive_pk type Base58.data += Data of t @@ -237,21 +237,21 @@ module Secret_key = struct let pp ppf t = Format.fprintf ppf "%s" (to_b58check t) end -type t = Bls12_381.Signature.MinPk.signature +type t = Bls12_381_signature.MinPk.signature type watermark = Bytes.t -let name = "Bls12_381.Signature" +let name = "Bls12_381_signature" let title = "A Bls12_381 signature" -let size = Bls12_381.Signature.MinPk.signature_size_in_bytes +let size = Bls12_381_signature.MinPk.signature_size_in_bytes -let to_bytes = Bls12_381.Signature.MinPk.signature_to_bytes +let to_bytes = Bls12_381_signature.MinPk.signature_to_bytes let of_bytes_opt s = if Bytes.length s = size then - Bls12_381.Signature.MinPk.signature_of_bytes_opt s + Bls12_381_signature.MinPk.signature_of_bytes_opt s else None let to_string s = Bytes.to_string (to_bytes s) @@ -322,7 +322,7 @@ end) let pp ppf t = Format.fprintf ppf "%s" (to_b58check t) let zero = - Bls12_381.Signature.MinPk.signature_of_bytes_exn + Bls12_381_signature.MinPk.signature_of_bytes_exn @@ Bytes.of_string "\192\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" @@ -330,15 +330,15 @@ let sign ?watermark sk msg = let msg = match watermark with None -> msg | Some prefix -> Bytes.cat prefix msg in - Bls12_381.Signature.MinPk.Aug.sign sk msg + Bls12_381_signature.MinPk.Aug.sign sk msg let check ?watermark pk signature msg = let msg = match watermark with None -> msg | Some prefix -> Bytes.cat prefix msg in - Bls12_381.Signature.MinPk.Aug.verify pk msg signature + Bls12_381_signature.MinPk.Aug.verify pk msg signature -(* [seed] must be at least of 32 bytes or [Bls12_381.Signature.generate_sk] will +(* [seed] must be at least of 32 bytes or [Bls12_381_signature.generate_sk] will throw an error. *) let generate_key ?seed () = let seed = @@ -349,8 +349,8 @@ let generate_key ?seed () = bytes of 32 *) Hacl.Rand.gen 32 in - let sk = Bls12_381.Signature.generate_sk seed in - let pk = Bls12_381.Signature.MinPk.derive_pk sk in + let sk = Bls12_381_signature.generate_sk seed in + let pk = Bls12_381_signature.MinPk.derive_pk sk in let pkh = Public_key.hash pk in (pkh, pk, sk) @@ -373,9 +373,9 @@ let aggregate_check pk_msg_list signature = (pk, msg)) pk_msg_list in - Bls12_381.Signature.MinPk.Aug.aggregate_verify pk_msg_list signature + Bls12_381_signature.MinPk.Aug.aggregate_verify pk_msg_list signature -let aggregate_signature_opt = Bls12_381.Signature.MinPk.aggregate_signature_opt +let aggregate_signature_opt = Bls12_381_signature.MinPk.aggregate_signature_opt module Primitive = struct include Bls12_381 diff --git a/src/lib_crypto/bls.mli b/src/lib_crypto/bls.mli index 1d77eef66502..2827c7fd263c 100644 --- a/src/lib_crypto/bls.mli +++ b/src/lib_crypto/bls.mli @@ -27,9 +27,9 @@ include S.AGGREGATE_SIGNATURE - with type Public_key.t = Bls12_381.Signature.MinPk.pk - and type Secret_key.t = Bls12_381.Signature.sk - and type t = Bls12_381.Signature.MinPk.signature + with type Public_key.t = Bls12_381_signature.MinPk.pk + and type Secret_key.t = Bls12_381_signature.sk + and type t = Bls12_381_signature.MinPk.signature and type watermark = Bytes.t include S.RAW_DATA with type t := t diff --git a/src/lib_crypto/dune b/src/lib_crypto/dune index 254fd50ba7a4..85de0054c2e5 100644 --- a/src/lib_crypto/dune +++ b/src/lib_crypto/dune @@ -19,7 +19,8 @@ ringo zarith zarith_stubs_js - bls12-381) + bls12-381 + bls12-381-signature) (js_of_ocaml) (flags (:standard) diff --git a/src/lib_protocol_environment/environment_V4.ml b/src/lib_protocol_environment/environment_V4.ml index b91c03739fa9..5e021387b98e 100644 --- a/src/lib_protocol_environment/environment_V4.ml +++ b/src/lib_protocol_environment/environment_V4.ml @@ -85,7 +85,7 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator_legacy - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk type error += Ecoproto_error of Error_monad.error @@ -273,31 +273,31 @@ struct end module Bls_signature = struct - type pk = Bls12_381.Signature.MinPk.pk + type pk = Bls12_381_signature.MinPk.pk - let unsafe_pk_of_bytes = Bls12_381.Signature.MinPk.unsafe_pk_of_bytes + let unsafe_pk_of_bytes = Bls12_381_signature.MinPk.unsafe_pk_of_bytes - let pk_of_bytes_opt = Bls12_381.Signature.MinPk.pk_of_bytes_opt + let pk_of_bytes_opt = Bls12_381_signature.MinPk.pk_of_bytes_opt - let pk_to_bytes = Bls12_381.Signature.MinPk.pk_to_bytes + let pk_to_bytes = Bls12_381_signature.MinPk.pk_to_bytes type signature = Bytes.t let verify pk bytes signature = - Bls12_381.Signature.MinPk.Aug.verify + Bls12_381_signature.MinPk.Aug.verify pk bytes - (Bls12_381.Signature.MinPk.unsafe_signature_of_bytes signature) + (Bls12_381_signature.MinPk.unsafe_signature_of_bytes signature) let aggregate_verify data signature = - Bls12_381.Signature.MinPk.Aug.aggregate_verify + Bls12_381_signature.MinPk.Aug.aggregate_verify data - (Bls12_381.Signature.MinPk.unsafe_signature_of_bytes signature) + (Bls12_381_signature.MinPk.unsafe_signature_of_bytes signature) let aggregate_signature_opt sigs = - Option.map Bls12_381.Signature.MinPk.signature_to_bytes - @@ Bls12_381.Signature.MinPk.aggregate_signature_opt - (List.map Bls12_381.Signature.MinPk.unsafe_signature_of_bytes sigs) + Option.map Bls12_381_signature.MinPk.signature_to_bytes + @@ Bls12_381_signature.MinPk.aggregate_signature_opt + (List.map Bls12_381_signature.MinPk.unsafe_signature_of_bytes sigs) end module Ed25519 = Ed25519 diff --git a/src/lib_protocol_environment/environment_V4.mli b/src/lib_protocol_environment/environment_V4.mli index ce50e7d43c32..a15249df27fc 100644 --- a/src/lib_protocol_environment/environment_V4.mli +++ b/src/lib_protocol_environment/environment_V4.mli @@ -80,7 +80,7 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator_legacy - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk (** An [Ecoproto_error e] is a shell error that carry a protocol error. diff --git a/src/lib_protocol_environment/environment_V5.ml b/src/lib_protocol_environment/environment_V5.ml index 23b56ed9f0f3..9425e50a5fa7 100644 --- a/src/lib_protocol_environment/environment_V5.ml +++ b/src/lib_protocol_environment/environment_V5.ml @@ -90,8 +90,8 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk - and type Bls_signature.signature = Bls12_381.Signature.MinPk.signature + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk + and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t type error += Ecoproto_error of Error_monad.error @@ -258,7 +258,7 @@ struct end module Bls_signature = struct - include Bls12_381.Signature.MinPk + include Bls12_381_signature.MinPk let verify = Aug.verify diff --git a/src/lib_protocol_environment/environment_V5.mli b/src/lib_protocol_environment/environment_V5.mli index 8df6da5fdad3..40ad8b7971b0 100644 --- a/src/lib_protocol_environment/environment_V5.mli +++ b/src/lib_protocol_environment/environment_V5.mli @@ -91,8 +91,8 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk - and type Bls_signature.signature = Bls12_381.Signature.MinPk.signature + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk + and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t (** An [Ecoproto_error e] is a shell error that carry a protocol error. diff --git a/src/lib_protocol_environment/environment_V6.ml b/src/lib_protocol_environment/environment_V6.ml index 9ff61c2cb530..35cc9e792c29 100644 --- a/src/lib_protocol_environment/environment_V6.ml +++ b/src/lib_protocol_environment/environment_V6.ml @@ -90,8 +90,8 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk - and type Bls_signature.signature = Bls12_381.Signature.MinPk.signature + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk + and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t and type Bls12_381.Fr.t = Bls12_381.Fr.t and type Plonk.transcript = @@ -264,7 +264,7 @@ struct end module Bls_signature = struct - include Bls12_381.Signature.MinPk + include Bls12_381_signature.MinPk let verify = Aug.verify diff --git a/src/lib_protocol_environment/environment_V6.mli b/src/lib_protocol_environment/environment_V6.mli index 5117b46be127..8b78b555463f 100644 --- a/src/lib_protocol_environment/environment_V6.mli +++ b/src/lib_protocol_environment/environment_V6.mli @@ -91,8 +91,8 @@ module type T = sig and type Timelock.chest_key = Timelock.chest_key and type Timelock.opening_result = Timelock.opening_result and module Sapling = Tezos_sapling.Core.Validator - and type Bls_signature.pk = Bls12_381.Signature.MinPk.pk - and type Bls_signature.signature = Bls12_381.Signature.MinPk.signature + and type Bls_signature.pk = Bls12_381_signature.MinPk.pk + and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t and type Bls12_381.Fr.t = Bls12_381.Fr.t and type Plonk.transcript = diff --git a/src/lib_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index baa7341a9ce1..9c0184b06e57 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -162,7 +162,7 @@ module Encodings = struct let bls12_381 = let length = (* 32 + 16 + 8 = 56 *) - Bls12_381.Signature.sk_size_in_bytes + Crypto_box.tag_length + Bls12_381_signature.sk_size_in_bytes + Crypto_box.tag_length + Raw.salt_len in Base58.register_encoding diff --git a/src/proto_014_PtKathma/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_014_PtKathma/lib_benchmarks_proto/tx_rollup_benchmarks.ml index b32c2bc9d0e1..60247c8d2d58 100644 --- a/src/proto_014_PtKathma/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_014_PtKathma/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -220,8 +220,8 @@ module Prover_context = Tx_rollup_l2_context.Make (Prover_storage) module Prover_apply = Tx_rollup_l2_apply.Make (Prover_context) type address = { - sk : Bls12_381.Signature.sk; - pk : Bls12_381.Signature.MinPk.pk; + sk : Bls12_381_signature.sk; + pk : Bls12_381_signature.MinPk.pk; addr : Tx_rollup_l2_address.t; index : Tx_rollup_l2_context_sig.address_index; mutable counter : int; @@ -250,8 +250,8 @@ let unique_ticket_id = let gen_l2_account rng_state = let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in - let secret_key = Bls12_381.Signature.generate_sk seed in - let public_key = Bls12_381.Signature.MinPk.derive_pk secret_key in + let secret_key = Bls12_381_signature.generate_sk seed in + let public_key = Bls12_381_signature.MinPk.derive_pk secret_key in (secret_key, public_key) let hash_key_exn ctxt ~ticketer ~typ ~contents ~owner = @@ -494,10 +494,10 @@ let make_msg ~rng_state input nb_op = transaction in let signatures = - List.map (fun sk -> Bls12_381.Signature.MinPk.Aug.sign sk buf) signers + List.map (fun sk -> Bls12_381_signature.MinPk.Aug.sign sk buf) signers in let aggregated_signature = - match Bls12_381.Signature.MinPk.aggregate_signature_opt signatures with + match Bls12_381_signature.MinPk.aggregate_signature_opt signatures with | Some res -> res | None -> assert false in diff --git a/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml index 57ca5f14c4c4..7df61184866e 100644 --- a/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_015_PtLimaPt/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -220,8 +220,8 @@ module Prover_context = Tx_rollup_l2_context.Make (Prover_storage) module Prover_apply = Tx_rollup_l2_apply.Make (Prover_context) type address = { - sk : Bls12_381.Signature.sk; - pk : Bls12_381.Signature.MinPk.pk; + sk : Bls12_381_signature.sk; + pk : Bls12_381_signature.MinPk.pk; addr : Tx_rollup_l2_address.t; index : Tx_rollup_l2_context_sig.address_index; mutable counter : int; @@ -490,10 +490,10 @@ let make_msg ~rng_state input nb_op = transaction in let signatures = - List.map (fun sk -> Bls12_381.Signature.MinPk.Aug.sign sk buf) signers + List.map (fun sk -> Bls12_381_signature.MinPk.Aug.sign sk buf) signers in let aggregated_signature = - match Bls12_381.Signature.MinPk.aggregate_signature_opt signatures with + match Bls12_381_signature.MinPk.aggregate_signature_opt signatures with | Some res -> res | None -> assert false in diff --git a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index 5618862c4c3a..fcf89c89ec43 100644 --- a/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_015_PtLimaPt/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -144,7 +144,7 @@ let v1_batch = tests here as the bytes length stays the same. *) let bytes = Bls12_381.G2.(to_compressed_bytes (random ())) in let aggregated_signature = - Bls12_381.Signature.MinPk.unsafe_signature_of_bytes bytes + Bls12_381_signature.MinPk.unsafe_signature_of_bytes bytes in V1.{aggregated_signature; contents} diff --git a/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml b/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml index 57ca5f14c4c4..7df61184866e 100644 --- a/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml +++ b/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml @@ -220,8 +220,8 @@ module Prover_context = Tx_rollup_l2_context.Make (Prover_storage) module Prover_apply = Tx_rollup_l2_apply.Make (Prover_context) type address = { - sk : Bls12_381.Signature.sk; - pk : Bls12_381.Signature.MinPk.pk; + sk : Bls12_381_signature.sk; + pk : Bls12_381_signature.MinPk.pk; addr : Tx_rollup_l2_address.t; index : Tx_rollup_l2_context_sig.address_index; mutable counter : int; @@ -490,10 +490,10 @@ let make_msg ~rng_state input nb_op = transaction in let signatures = - List.map (fun sk -> Bls12_381.Signature.MinPk.Aug.sign sk buf) signers + List.map (fun sk -> Bls12_381_signature.MinPk.Aug.sign sk buf) signers in let aggregated_signature = - match Bls12_381.Signature.MinPk.aggregate_signature_opt signatures with + match Bls12_381_signature.MinPk.aggregate_signature_opt signatures with | Some res -> res | None -> assert false in diff --git a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml index 5618862c4c3a..fcf89c89ec43 100644 --- a/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml +++ b/src/proto_alpha/lib_protocol/test/pbt/test_tx_rollup_l2_encoding.ml @@ -144,7 +144,7 @@ let v1_batch = tests here as the bytes length stays the same. *) let bytes = Bls12_381.G2.(to_compressed_bytes (random ())) in let aggregated_signature = - Bls12_381.Signature.MinPk.unsafe_signature_of_bytes bytes + Bls12_381_signature.MinPk.unsafe_signature_of_bytes bytes in V1.{aggregated_signature; contents} -- GitLab From 62328983eeefbc622e09810dd49e324fc0a8f486 Mon Sep 17 00:00:00 2001 From: Danny Willems Date: Fri, 23 Sep 2022 17:09:11 +0200 Subject: [PATCH 2/2] CI: bump up tezos/opam-repository To bump up bls12-381 to 5.0.0 and use bls12-381-signature.1.0.0 --- .gitlab/ci/templates.yml | 2 +- scripts/version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab/ci/templates.yml b/.gitlab/ci/templates.yml index aa937faf1008..57a04fcdc738 100644 --- a/.gitlab/ci/templates.yml +++ b/.gitlab/ci/templates.yml @@ -2,7 +2,7 @@ variables: # /!\ CI_REGISTRY is overriden to use a private Docker registry mirror in AWS ECR # in GitLab namespaces `nomadic-labs` and `tezos` ## This value MUST be the same as `opam_repository_tag` in `scripts/version.sh` - build_deps_image_version: b880f4773e2db8d08bcb54abcb5f99565c33c18a + build_deps_image_version: 575ab3679d48a9ffe1823859374692b8dd134d08 build_deps_image_name: "${CI_REGISTRY}/tezos/opam-repository" GIT_STRATEGY: fetch GIT_DEPTH: "1" diff --git a/scripts/version.sh b/scripts/version.sh index 506866e3c741..ac0925c6adf4 100755 --- a/scripts/version.sh +++ b/scripts/version.sh @@ -25,7 +25,7 @@ export full_opam_repository_tag=5b15e5ee8adbd7522032018e1694f547555ba2b6 ## opam_repository is an additional, tezos-specific opam repository. ## This value MUST be the same as `build_deps_image_version` in `.gitlab/ci/templates.ym export opam_repository_url=https://gitlab.com/tezos/opam-repository -export opam_repository_tag=b880f4773e2db8d08bcb54abcb5f99565c33c18a +export opam_repository_tag=575ab3679d48a9ffe1823859374692b8dd134d08 export opam_repository_git=$opam_repository_url.git export opam_repository=$opam_repository_git\#$opam_repository_tag -- GitLab