diff --git a/CHANGES.rst b/CHANGES.rst index 93747c111eca9b5cc26fff77ef0892d7ea5543bc..f0138399f03c11abe1897beebde6da20fcc14d00 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -325,3 +325,5 @@ Protocol Miscellaneous ------------- + +- Renamed ``Bls`` file from the crypto library in ``Bls_aug.ml``. (MR :gl:`!16683`). diff --git a/devtools/yes_wallet/test/bench_signature_perf.ml b/devtools/yes_wallet/test/bench_signature_perf.ml index d1d354de60eefe35d61e728208471ef655de9551..1af12fa4ea5c502cbca55a788bf06dc957d3b60d 100644 --- a/devtools/yes_wallet/test/bench_signature_perf.ml +++ b/devtools/yes_wallet/test/bench_signature_perf.ml @@ -32,23 +32,23 @@ let keys = let keys_p = Tezos_crypto.Signature.generate_key ~algo:P256 () in let keys_e = Tezos_crypto.Signature.generate_key ~algo:Ed25519 () in let keys_s = Tezos_crypto.Signature.generate_key ~algo:Secp256k1 () in - let keys_b = Tezos_crypto.Signature.generate_key ~algo:Bls () in + let keys_b = Tezos_crypto.Signature.generate_key ~algo:Bls_aug () in function | Tezos_crypto.Signature.P256 -> keys_p | Ed25519 -> keys_e | Secp256k1 -> keys_s - | Bls -> keys_b + | Bls_aug -> keys_b let wrong_keys = let keys_p = Tezos_crypto.Signature.generate_key ~algo:P256 () in let keys_e = Tezos_crypto.Signature.generate_key ~algo:Ed25519 () in let keys_s = Tezos_crypto.Signature.generate_key ~algo:Secp256k1 () in - let keys_b = Tezos_crypto.Signature.generate_key ~algo:Bls () in + let keys_b = Tezos_crypto.Signature.generate_key ~algo:Bls_aug () in function | Tezos_crypto.Signature.P256 -> keys_p | Ed25519 -> keys_e | Secp256k1 -> keys_s - | Bls -> keys_b + | Bls_aug -> keys_b let wrong_pk algo = let _, pk, _ = wrong_keys algo in @@ -106,7 +106,7 @@ let str_of_algo = function | Tezos_crypto.Signature.Ed25519 -> "Ed25519" | Tezos_crypto.Signature.Secp256k1 -> "Secp256k1" | Tezos_crypto.Signature.P256 -> "P256" - | Tezos_crypto.Signature.Bls -> "Bls" + | Tezos_crypto.Signature.Bls_aug -> "Bls" let time ~yes_crypto ~algo size datas = Format.eprintf "generating signatures...@?" ; @@ -164,5 +164,5 @@ let () = let _ = repeat 5 (time ~algo 100_000) (generate_data 1_000 100_000) in let _ = repeat 5 (time ~algo 1_000_000) (generate_data 1_000 1_000_000) in ()) - [Ed25519; Secp256k1; P256; Bls] + [Ed25519; Secp256k1; P256; Bls_aug] (* let _ = time (generate_data 1_000 10_000_000) *) diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index c6c2ea7b0cf827f478e222713b68a80480aac716..de5c5229f01497f2b67e7717fd47221ea50d464e 100644 --- a/manifest/product_octez.ml +++ b/manifest/product_octez.ml @@ -6440,7 +6440,7 @@ let hash = Protocol.hash S "%{targets}"; S (sf - {| module Bls = Tezos_crypto.Signature.Bls + {| module Bls_aug = Tezos_crypto.Signature.Bls_aug module Ed25519 = Tezos_crypto.Signature.Ed25519 module P256 = Tezos_crypto.Signature.P256 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 diff --git a/src/lib_client_base/client_keys.ml b/src/lib_client_base/client_keys.ml index bb8213e143aa5c2507266b71d973f95218a806bc..fd4412e80c00b62ff8945d27fe0671af60441bca 100644 --- a/src/lib_client_base/client_keys.ml +++ b/src/lib_client_base/client_keys.ml @@ -877,7 +877,7 @@ module V0 = Make (struct Tezos_crypto.Signature.Public_key_hash.t -> Public_key_hash.t tzresult = let open Result_syntax in function - | Bls _ -> + | Bls_aug _ -> tzfail (Exn (Failure "BLS public key hash not supported by V0")) | Ed25519 k -> return (Ed25519 k : Public_key_hash.t) | Secp256k1 k -> return (Secp256k1 k : Public_key_hash.t) @@ -887,7 +887,7 @@ module V0 = Make (struct Tezos_crypto.Signature.Public_key.t -> Public_key.t tzresult = let open Result_syntax in function - | Bls _ -> tzfail (Exn (Failure "BLS public key not supported by V0")) + | Bls_aug _ -> tzfail (Exn (Failure "BLS public key not supported by V0")) | Ed25519 k -> return (Ed25519 k : Public_key.t) | Secp256k1 k -> return (Secp256k1 k : Public_key.t) | P256 k -> return (P256 k : Public_key.t) @@ -895,7 +895,7 @@ module V0 = Make (struct let signature : Tezos_crypto.Signature.t -> t tzresult = let open Result_syntax in function - | Bls _ -> tzfail (Exn (Failure "BLS signature not supported by V0")) + | Bls_aug _ -> tzfail (Exn (Failure "BLS signature not supported by V0")) | Ed25519 k -> return (Ed25519 k : t) | Secp256k1 k -> return (Secp256k1 k : t) | P256 k -> return (P256 k : t) @@ -913,7 +913,7 @@ module V1 = Make (struct Tezos_crypto.Signature.Public_key_hash.t -> Public_key_hash.t tzresult = let open Result_syntax in function - | Bls k -> return (Bls k : Public_key_hash.t) + | Bls_aug k -> return (Bls k : Public_key_hash.t) | Ed25519 k -> return (Ed25519 k : Public_key_hash.t) | Secp256k1 k -> return (Secp256k1 k : Public_key_hash.t) | P256 k -> return (P256 k : Public_key_hash.t) @@ -922,7 +922,7 @@ module V1 = Make (struct Tezos_crypto.Signature.Public_key.t -> Public_key.t tzresult = let open Result_syntax in function - | Bls k -> return (Bls k : Public_key.t) + | Bls_aug k -> return (Bls k : Public_key.t) | Ed25519 k -> return (Ed25519 k : Public_key.t) | Secp256k1 k -> return (Secp256k1 k : Public_key.t) | P256 k -> return (P256 k : Public_key.t) @@ -930,7 +930,7 @@ module V1 = Make (struct let signature : Tezos_crypto.Signature.t -> t tzresult = let open Result_syntax in function - | Bls k -> return (Bls k : t) + | Bls_aug k -> return (Bls k : t) | Ed25519 k -> return (Ed25519 k : t) | Secp256k1 k -> return (Secp256k1 k : t) | P256 k -> return (P256 k : t) diff --git a/src/lib_client_commands/client_keys_commands.ml b/src/lib_client_commands/client_keys_commands.ml index 8ccfb8fd88babb6e7cf0c7215477a0829195a443..e40f59fac8ca7ce915590304e9922358c53451ec 100644 --- a/src/lib_client_commands/client_keys_commands.ml +++ b/src/lib_client_commands/client_keys_commands.ml @@ -40,7 +40,7 @@ let algo_param () = | "ed25519" -> return Signature.Ed25519 | "secp256k1" -> return Signature.Secp256k1 | "p256" -> return Signature.P256 - | "bls" -> return Signature.Bls + | "bls" -> return Signature.Bls_aug | name -> failwith "Unknown signature algorithm (%s). Available: 'ed25519', \ diff --git a/src/lib_crypto/aggregate_signature.ml b/src/lib_crypto/aggregate_signature.ml index ad5ea65917cf58f17910b8520e847dd2f7bed46b..e48bb3ed2926e636e61585ed3d24cfb31373038f 100644 --- a/src/lib_crypto/aggregate_signature.ml +++ b/src/lib_crypto/aggregate_signature.ml @@ -25,14 +25,14 @@ open Error_monad -type public_key_hash = Bls12_381 of Bls.Public_key_hash.t +type public_key_hash = Bls12_381 of Bls_aug.Public_key_hash.t -type public_key = Bls12_381 of Bls.Public_key.t +type public_key = Bls12_381 of Bls_aug.Public_key.t -type secret_key = Bls12_381 of Bls.Secret_key.t +type secret_key = Bls12_381 of Bls_aug.Secret_key.t module Public_key_hash = struct - type t = public_key_hash = Bls12_381 of Bls.Public_key_hash.t + type t = public_key_hash = Bls12_381 of Bls_aug.Public_key_hash.t let name = "Aggregate_signature.Public_key_hash" @@ -56,7 +56,7 @@ module Public_key_hash = struct [ case (Tag 0) - Bls.Public_key_hash.encoding + Bls_aug.Public_key_hash.encoding ~title:"Bls12_381" (function Bls12_381 x -> Some x) (function x -> Bls12_381 x); @@ -70,9 +70,9 @@ module Public_key_hash = struct let of_string_opt s = of_bytes_opt (Bytes.of_string s) - let size = 1 + Bls.Public_key_hash.size + let size = 1 + Bls_aug.Public_key_hash.size - let zero = Bls12_381 Bls.Public_key_hash.zero + let zero = Bls12_381 Bls_aug.Public_key_hash.zero include Helpers.MakeRaw (struct type nonrec t = t @@ -88,7 +88,7 @@ module Public_key_hash = struct let of_b58check_opt s = match Base58.decode s with - | Some (Bls.Public_key_hash.Data pkh) -> Some (Bls12_381 pkh) + | Some (Bls_aug.Public_key_hash.Data pkh) -> Some (Bls12_381 pkh) | _ -> None let of_b58check_exn s = @@ -103,25 +103,26 @@ module Public_key_hash = struct error_with "Failed to read a b58check_encoding data (%s): %S" name s let to_b58check = function - | Bls12_381 pkh -> Bls.Public_key_hash.to_b58check pkh + | Bls12_381 pkh -> Bls_aug.Public_key_hash.to_b58check pkh let to_short_b58check = function - | Bls12_381 pkh -> Bls.Public_key_hash.to_short_b58check pkh + | Bls12_381 pkh -> Bls_aug.Public_key_hash.to_short_b58check pkh let to_path key l = match key with - | Bls12_381 h -> "bls12_381" :: Bls.Public_key_hash.to_path h l + | Bls12_381 h -> "bls12_381" :: Bls_aug.Public_key_hash.to_path h l let of_path = function | "bls12_381" :: q -> - Bls.Public_key_hash.of_path q |> Option.map (fun pkh -> Bls12_381 pkh) + Bls_aug.Public_key_hash.of_path q + |> Option.map (fun pkh -> Bls12_381 pkh) | _ -> assert false let of_path_exn = function - | "bls12_381" :: q -> Bls12_381 (Bls.Public_key_hash.of_path_exn q) + | "bls12_381" :: q -> Bls12_381 (Bls_aug.Public_key_hash.of_path_exn q) | _ -> assert false - let path_length = 1 + Bls.Public_key_hash.path_length + let path_length = 1 + Bls_aug.Public_key_hash.path_length let prefix_path _ = assert false (* unused *) @@ -134,7 +135,7 @@ module Public_key_hash = struct let compare a b = match (a, b) with - | Bls12_381 x, Bls12_381 y -> Bls.Public_key_hash.compare x y + | Bls12_381 x, Bls12_381 y -> Bls_aug.Public_key_hash.compare x y end) include Helpers.MakeEncoder (struct @@ -183,7 +184,7 @@ module Public_key_hash = struct end module Public_key = struct - type t = public_key = Bls12_381 of Bls.Public_key.t + type t = public_key = Bls12_381 of Bls_aug.Public_key.t let name = "Aggregate_signature.Public_key" @@ -191,13 +192,14 @@ module Public_key = struct let hash pk = match pk with - | Bls12_381 pk -> Public_key_hash.Bls12_381 (Bls.Public_key.hash pk) + | Bls12_381 pk -> Public_key_hash.Bls12_381 (Bls_aug.Public_key.hash pk) include Compare.Make (struct type nonrec t = t let compare a b = - match (a, b) with Bls12_381 x, Bls12_381 y -> Bls.Public_key.compare x y + match (a, b) with + | Bls12_381 x, Bls12_381 y -> Bls_aug.Public_key.compare x y end) type Base58.data += Data of t (* unused *) @@ -213,7 +215,7 @@ module Public_key = struct let of_b58check_opt s = match Base58.decode s with - | Some (Bls.Public_key.Data public_key) -> Some (Bls12_381 public_key) + | Some (Bls_aug.Public_key.Data public_key) -> Some (Bls12_381 public_key) | _ -> None let of_b58check_exn s = @@ -227,18 +229,19 @@ module Public_key = struct | None -> error_with "Failed to read a b58check_encoding data (%s): %S" name s - let to_b58check = function Bls12_381 pk -> Bls.Public_key.to_b58check pk + let to_b58check = function Bls12_381 pk -> Bls_aug.Public_key.to_b58check pk let to_short_b58check = function - | Bls12_381 pk -> Bls.Public_key.to_short_b58check pk + | Bls12_381 pk -> Bls_aug.Public_key.to_short_b58check pk let of_bytes_without_validation b = let tag = Bytes.(get_int8 b 0) in let b = Bytes.(sub b 1 (length b - 1)) in match tag with | 0 -> - Option.bind (Bls.Public_key.of_bytes_without_validation b) (fun pk -> - Some (Bls12_381 pk)) + Option.bind + (Bls_aug.Public_key.of_bytes_without_validation b) + (fun pk -> Some (Bls12_381 pk)) | _ -> None include Helpers.MakeEncoder (struct @@ -255,7 +258,7 @@ module Public_key = struct [ case (Tag 0) - Bls.Public_key.encoding + Bls_aug.Public_key.encoding ~title:"Bls12_381" (function Bls12_381 x -> Some x) (function x -> Bls12_381 x); @@ -278,20 +281,21 @@ module Public_key = struct end module Secret_key = struct - type t = secret_key = Bls12_381 of Bls.Secret_key.t + type t = secret_key = Bls12_381 of Bls_aug.Secret_key.t let name = "Aggregate_signature.Secret_key" let title = "A Bls12_381 secret key" let to_public_key = function - | Bls12_381 sk -> Public_key.Bls12_381 (Bls.Secret_key.to_public_key sk) + | Bls12_381 sk -> Public_key.Bls12_381 (Bls_aug.Secret_key.to_public_key sk) include Compare.Make (struct type nonrec t = t let compare a b = - match (a, b) with Bls12_381 x, Bls12_381 y -> Bls.Secret_key.compare x y + match (a, b) with + | Bls12_381 x, Bls12_381 y -> Bls_aug.Secret_key.compare x y end) type Base58.data += Data of t (* unused *) @@ -307,7 +311,7 @@ module Secret_key = struct let of_b58check_opt b = match Base58.decode b with - | Some (Bls.Secret_key.Data sk) -> Some (Bls12_381 sk) + | Some (Bls_aug.Secret_key.Data sk) -> Some (Bls12_381 sk) | _ -> None let of_b58check_exn s = @@ -321,10 +325,10 @@ module Secret_key = struct | None -> error_with "Failed to read a b58check_encoding data (%s): %S" name s - let to_b58check = function Bls12_381 sk -> Bls.Secret_key.to_b58check sk + let to_b58check = function Bls12_381 sk -> Bls_aug.Secret_key.to_b58check sk let to_short_b58check = function - | Bls12_381 sk -> Bls.Secret_key.to_short_b58check sk + | Bls12_381 sk -> Bls_aug.Secret_key.to_short_b58check sk include Helpers.MakeEncoder (struct type nonrec t = t @@ -340,7 +344,7 @@ module Secret_key = struct [ case (Tag 0) - Bls.Secret_key.encoding + Bls_aug.Secret_key.encoding ~title:"Bls12_381" (function Bls12_381 x -> Some x) (function x -> Bls12_381 x); @@ -360,7 +364,7 @@ module Secret_key = struct let pp ppf t = Format.fprintf ppf "%s" (to_b58check t) end -type signature = Bls12_381 of Bls.t | Unknown of Bytes.t +type signature = Bls12_381 of Bls_aug.t | Unknown of Bytes.t type t = signature @@ -370,9 +374,9 @@ let name = "Aggregate signature" let title = "A Bls12_381 signature" -let size = Bls.size +let size = Bls_aug.size -let to_bytes = function Bls12_381 b -> Bls.to_bytes b | Unknown b -> b +let to_bytes = function Bls12_381 b -> Bls_aug.to_bytes b | Unknown b -> b let of_bytes_opt s = if Bytes.length s = size then Some (Unknown s) else None @@ -413,8 +417,8 @@ include Compare.Make (struct end) let of_b58check_opt s = - if TzString.has_prefix ~prefix:Bls.b58check_encoding.encoded_prefix s then - Option.map (fun x -> Bls12_381 x) (Bls.of_b58check_opt s) + if TzString.has_prefix ~prefix:Bls_aug.b58check_encoding.encoded_prefix s then + Option.map (fun x -> Bls12_381 x) (Bls_aug.of_b58check_opt s) else Base58.simple_decode b58check_encoding s let of_b58check_exn s = @@ -428,11 +432,11 @@ let of_b58check s = | None -> error_with "Failed to read a b58check_encoding data (%s): %S" name s let to_b58check = function - | Bls12_381 b -> Bls.to_b58check b + | Bls12_381 b -> Bls_aug.to_b58check b | Unknown b -> Base58.simple_encode b58check_encoding (Unknown b) let to_short_b58check = function - | Bls12_381 b -> Bls.to_short_b58check b + | Bls12_381 b -> Bls_aug.to_short_b58check b | Unknown b -> Base58.simple_encode b58check_encoding (Unknown b) include Helpers.MakeEncoder (struct @@ -458,31 +462,32 @@ end) let pp ppf t = Format.fprintf ppf "%s" (to_b58check t) -let zero = Bls12_381 Bls.zero +let zero = Bls12_381 Bls_aug.zero let sign ?watermark (Secret_key.Bls12_381 sk) bytes = - Bls12_381 (Bls.sign ?watermark sk bytes) + Bls12_381 (Bls_aug.sign ?watermark sk bytes) let check ?watermark pk signature message = match (pk, signature) with | Public_key.Bls12_381 pk, Unknown signature -> - Bls.of_bytes_opt signature - |> Option.map (fun signature -> Bls.check ?watermark pk signature message) + Bls_aug.of_bytes_opt signature + |> Option.map (fun signature -> + Bls_aug.check ?watermark pk signature message) |> Option.value ~default:false | Public_key.Bls12_381 pk, Bls12_381 signature -> - Bls.check ?watermark pk signature message + Bls_aug.check ?watermark pk signature message let generate_key ?seed () = - let pkh, pk, sk = Bls.generate_key ?seed () in + let pkh, pk, sk = Bls_aug.generate_key ?seed () in ( Public_key_hash.Bls12_381 pkh, Public_key.Bls12_381 pk, Secret_key.Bls12_381 sk ) let deterministic_nonce (Secret_key.Bls12_381 sk) msg = - Bls.deterministic_nonce sk msg + Bls_aug.deterministic_nonce sk msg let deterministic_nonce_hash (Secret_key.Bls12_381 sk) msg = - Bls.deterministic_nonce_hash sk msg + Bls_aug.deterministic_nonce_hash sk msg let aggregate_check pks signature = let pks = @@ -492,10 +497,10 @@ let aggregate_check pks signature = pks in match signature with - | Bls12_381 signature -> Bls.aggregate_check pks signature + | Bls12_381 signature -> Bls_aug.aggregate_check pks signature | Unknown signature -> - Bls.of_bytes_opt signature - |> Option.map (Bls.aggregate_check pks) + Bls_aug.of_bytes_opt signature + |> Option.map (Bls_aug.aggregate_check pks) |> Option.value ~default:false let aggregate_signature_opt signatures = @@ -504,11 +509,11 @@ let aggregate_signature_opt signatures = match s with | Bls12_381 s -> return @@ (s :: acc) | Unknown s -> - let* s = Bls.of_bytes s in + let* s = Bls_aug.of_bytes s in return (s :: acc) in match List.fold_left_e aux [] signatures with | Ok signatures -> - Bls.aggregate_signature_opt signatures + Bls_aug.aggregate_signature_opt signatures |> Option.map (fun s -> Bls12_381 s) | Error _ -> None diff --git a/src/lib_crypto/aggregate_signature.mli b/src/lib_crypto/aggregate_signature.mli index cd1baeef5d5f2afa114893fcfe14e4ca1e289c75..026ecf765d5168a89f90510b4d29347ea05a1c44 100644 --- a/src/lib_crypto/aggregate_signature.mli +++ b/src/lib_crypto/aggregate_signature.mli @@ -27,13 +27,13 @@ Remove this module and use `Signature` module instead. *) -type public_key_hash = Bls12_381 of Bls.Public_key_hash.t +type public_key_hash = Bls12_381 of Bls_aug.Public_key_hash.t -type public_key = Bls12_381 of Bls.Public_key.t +type public_key = Bls12_381 of Bls_aug.Public_key.t -type secret_key = Bls12_381 of Bls.Secret_key.t +type secret_key = Bls12_381 of Bls_aug.Secret_key.t -type signature = Bls12_381 of Bls.t | Unknown of Bytes.t +type signature = Bls12_381 of Bls_aug.t | Unknown of Bytes.t include S.AGGREGATE_SIGNATURE diff --git a/src/lib_crypto/bls.ml b/src/lib_crypto/bls_aug.ml similarity index 100% rename from src/lib_crypto/bls.ml rename to src/lib_crypto/bls_aug.ml diff --git a/src/lib_crypto/bls.mli b/src/lib_crypto/bls_aug.mli similarity index 100% rename from src/lib_crypto/bls.mli rename to src/lib_crypto/bls_aug.mli diff --git a/src/lib_crypto/signature.ml b/src/lib_crypto/signature.ml index ccac7d958a2648fc0fe7f8c859d0c706804e4f73..f6644977c3ca1a5cc80131c0fe70394345b4de7c 100644 --- a/src/lib_crypto/signature.ml +++ b/src/lib_crypto/signature.ml @@ -82,26 +82,26 @@ module V0 = struct | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls _ -> None + | V_latest.Bls_aug _ -> None let public_key : V_latest.Public_key.t -> Public_key.t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls _ -> None + | V_latest.Bls_aug _ -> None let secret_key : V_latest.Secret_key.t -> Secret_key.t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls _ -> None + | V_latest.Bls_aug _ -> None let signature : V_latest.t -> t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) | V_latest.Unknown k -> Some (Unknown k) - | V_latest.Bls _ -> None + | V_latest.Bls_aug _ -> None let get_public_key pk = match public_key pk with @@ -164,26 +164,26 @@ module V1 = struct | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls k -> Some (Bls k) + | V_latest.Bls_aug k -> Some (Bls k) let public_key : V_latest.Public_key.t -> Public_key.t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls k -> Some (Bls k) + | V_latest.Bls_aug k -> Some (Bls k) let secret_key : V_latest.Secret_key.t -> Secret_key.t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) - | V_latest.Bls k -> Some (Bls k) + | V_latest.Bls_aug k -> Some (Bls k) let signature : V_latest.t -> t option = function | V_latest.Ed25519 k -> Some (Ed25519 k) | V_latest.Secp256k1 k -> Some (Secp256k1 k) | V_latest.P256 k -> Some (P256 k) | V_latest.Unknown k -> Some (Unknown k) - | V_latest.Bls k -> Some (Bls k) + | V_latest.Bls_aug k -> Some (Bls k) let get_public_key pk = match public_key pk with diff --git a/src/lib_crypto/signature_v1.ml b/src/lib_crypto/signature_v1.ml index a6313b5a6c4c0b1fea6e1f312c87221231d5939f..402cbeff72f1cea516febad5fdec0301398ac63d 100644 --- a/src/lib_crypto/signature_v1.ml +++ b/src/lib_crypto/signature_v1.ml @@ -31,19 +31,19 @@ type public_key_hash = | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls of Bls_aug.Public_key_hash.t type public_key = | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls of Bls_aug.Public_key.t type secret_key = | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls of Bls_aug.Secret_key.t type watermark = Signature_v0.watermark = | Block_header of Chain_id.t @@ -56,7 +56,7 @@ module Public_key_hash = struct | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls of Bls_aug.Public_key_hash.t let name = "Signature.Public_key_hash" @@ -99,7 +99,7 @@ module Public_key_hash = struct case (Tag 3) ~title:"Bls" - Bls.Public_key_hash.encoding + Bls_aug.Public_key_hash.encoding (function Bls x -> Some x | _ -> None) (function x -> Bls x); ] @@ -133,7 +133,7 @@ module Public_key_hash = struct | Some (Ed25519.Public_key_hash.Data pkh) -> Some (Ed25519 pkh) | Some (Secp256k1.Public_key_hash.Data pkh) -> Some (Secp256k1 pkh) | Some (P256.Public_key_hash.Data pkh) -> Some (P256 pkh) - | Some (Bls.Public_key_hash.Data pkh) -> Some (Bls pkh) + | Some (Bls_aug.Public_key_hash.Data pkh) -> Some (Bls pkh) | _ -> None let of_b58check_exn s = @@ -151,20 +151,20 @@ module Public_key_hash = struct | Ed25519 pkh -> Ed25519.Public_key_hash.to_b58check pkh | Secp256k1 pkh -> Secp256k1.Public_key_hash.to_b58check pkh | P256 pkh -> P256.Public_key_hash.to_b58check pkh - | Bls pkh -> Bls.Public_key_hash.to_b58check pkh + | Bls pkh -> Bls_aug.Public_key_hash.to_b58check pkh let to_short_b58check = function | Ed25519 pkh -> Ed25519.Public_key_hash.to_short_b58check pkh | Secp256k1 pkh -> Secp256k1.Public_key_hash.to_short_b58check pkh | P256 pkh -> P256.Public_key_hash.to_short_b58check pkh - | Bls pkh -> Bls.Public_key_hash.to_short_b58check pkh + | Bls pkh -> Bls_aug.Public_key_hash.to_short_b58check pkh let to_path key l = match key with | Ed25519 h -> "ed25519" :: Ed25519.Public_key_hash.to_path h l | Secp256k1 h -> "secp256k1" :: Secp256k1.Public_key_hash.to_path h l | P256 h -> "p256" :: P256.Public_key_hash.to_path h l - | Bls h -> "bls" :: Bls.Public_key_hash.to_path h l + | Bls h -> "bls" :: Bls_aug.Public_key_hash.to_path h l let of_path = function | "ed25519" :: q -> ( @@ -180,7 +180,7 @@ module Public_key_hash = struct | Some pkh -> Some (P256 pkh) | None -> None) | "bls" :: q -> ( - match Bls.Public_key_hash.of_path q with + match Bls_aug.Public_key_hash.of_path q with | Some pkh -> Some (Bls pkh) | None -> None) | _ -> assert false @@ -191,7 +191,7 @@ module Public_key_hash = struct | "ed25519" :: q -> Ed25519 (Ed25519.Public_key_hash.of_path_exn q) | "secp256k1" :: q -> Secp256k1 (Secp256k1.Public_key_hash.of_path_exn q) | "p256" :: q -> P256 (P256.Public_key_hash.of_path_exn q) - | "bls" :: q -> Bls (Bls.Public_key_hash.of_path_exn q) + | "bls" :: q -> Bls (Bls_aug.Public_key_hash.of_path_exn q) | _ -> assert false (* FIXME classification des erreurs *) @@ -200,7 +200,7 @@ module Public_key_hash = struct let l1 = Ed25519.Public_key_hash.path_length and l2 = Secp256k1.Public_key_hash.path_length and l3 = P256.Public_key_hash.path_length - and l4 = Bls.Public_key_hash.path_length in + and l4 = Bls_aug.Public_key_hash.path_length in assert (Compare.Int.(l1 = l2)) ; assert (Compare.Int.(l1 = l3)) ; assert (Compare.Int.(l1 = l4)) ; @@ -220,7 +220,7 @@ module Public_key_hash = struct | Ed25519 x, Ed25519 y -> Ed25519.Public_key_hash.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Public_key_hash.compare x y | P256 x, P256 y -> P256.Public_key_hash.compare x y - | Bls x, Bls y -> Bls.Public_key_hash.compare x y + | Bls x, Bls y -> Bls_aug.Public_key_hash.compare x y | _ -> Stdlib.compare a b end) @@ -274,7 +274,7 @@ module Public_key = struct | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls of Bls_aug.Public_key.t let name = "Signature.Public_key" @@ -285,7 +285,7 @@ module Public_key = struct | Ed25519 pk -> Public_key_hash.Ed25519 (Ed25519.Public_key.hash pk) | Secp256k1 pk -> Public_key_hash.Secp256k1 (Secp256k1.Public_key.hash pk) | P256 pk -> Public_key_hash.P256 (P256.Public_key.hash pk) - | Bls pk -> Public_key_hash.Bls (Bls.Public_key.hash pk) + | Bls pk -> Public_key_hash.Bls (Bls_aug.Public_key.hash pk) include Compare.Make (struct type nonrec t = t @@ -295,7 +295,7 @@ module Public_key = struct | Ed25519 x, Ed25519 y -> Ed25519.Public_key.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Public_key.compare x y | P256 x, P256 y -> P256.Public_key.compare x y - | Bls x, Bls y -> Bls.Public_key.compare x y + | Bls x, Bls y -> Bls_aug.Public_key.compare x y | Ed25519 _, (Secp256k1 _ | P256 _ | Bls _) -> -1 | Secp256k1 _, (P256 _ | Bls _) -> -1 | P256 _, Bls _ -> -1 @@ -320,7 +320,7 @@ module Public_key = struct | Some (Ed25519.Public_key.Data public_key) -> Some (Ed25519 public_key) | Some (Secp256k1.Public_key.Data public_key) -> Some (Secp256k1 public_key) | Some (P256.Public_key.Data public_key) -> Some (P256 public_key) - | Some (Bls.Public_key.Data public_key) -> Some (Bls public_key) + | Some (Bls_aug.Public_key.Data public_key) -> Some (Bls public_key) | _ -> None let of_b58check_exn s = @@ -338,13 +338,13 @@ module Public_key = struct | Ed25519 pk -> Ed25519.Public_key.to_b58check pk | Secp256k1 pk -> Secp256k1.Public_key.to_b58check pk | P256 pk -> P256.Public_key.to_b58check pk - | Bls pk -> Bls.Public_key.to_b58check pk + | Bls pk -> Bls_aug.Public_key.to_b58check pk let to_short_b58check = function | Ed25519 pk -> Ed25519.Public_key.to_short_b58check pk | Secp256k1 pk -> Secp256k1.Public_key.to_short_b58check pk | P256 pk -> P256.Public_key.to_short_b58check pk - | Bls pk -> Bls.Public_key.to_short_b58check pk + | Bls pk -> Bls_aug.Public_key.to_short_b58check pk let of_bytes_without_validation b = let tag = Bytes.(get_int8 b 0) in @@ -362,8 +362,9 @@ module Public_key = struct Option.bind (P256.Public_key.of_bytes_without_validation b) (fun pk -> Some (P256 pk)) | 3 -> - Option.bind (Bls.Public_key.of_bytes_without_validation b) (fun pk -> - Some (Bls pk)) + Option.bind + (Bls_aug.Public_key.of_bytes_without_validation b) + (fun pk -> Some (Bls pk)) | _ -> None include Helpers.MakeEncoder (struct @@ -399,7 +400,7 @@ module Public_key = struct case ~title:"Bls" (Tag 3) - Bls.Public_key.encoding + Bls_aug.Public_key.encoding (function Bls x -> Some x | _ -> None) (function x -> Bls x); ] @@ -425,7 +426,7 @@ module Secret_key = struct | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls of Bls_aug.Secret_key.t let name = "Signature.Secret_key" @@ -436,7 +437,7 @@ module Secret_key = struct | Secp256k1 sk -> Public_key.Secp256k1 (Secp256k1.Secret_key.to_public_key sk) | P256 sk -> Public_key.P256 (P256.Secret_key.to_public_key sk) - | Bls sk -> Public_key.Bls (Bls.Secret_key.to_public_key sk) + | Bls sk -> Public_key.Bls (Bls_aug.Secret_key.to_public_key sk) include Compare.Make (struct type nonrec t = t @@ -446,7 +447,7 @@ module Secret_key = struct | Ed25519 x, Ed25519 y -> Ed25519.Secret_key.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Secret_key.compare x y | P256 x, P256 y -> P256.Secret_key.compare x y - | Bls x, Bls y -> Bls.Secret_key.compare x y + | Bls x, Bls y -> Bls_aug.Secret_key.compare x y | _ -> Stdlib.compare a b end) @@ -466,7 +467,7 @@ module Secret_key = struct | Some (Ed25519.Secret_key.Data sk) -> Some (Ed25519 sk) | Some (Secp256k1.Secret_key.Data sk) -> Some (Secp256k1 sk) | Some (P256.Secret_key.Data sk) -> Some (P256 sk) - | Some (Bls.Secret_key.Data sk) -> Some (Bls sk) + | Some (Bls_aug.Secret_key.Data sk) -> Some (Bls sk) | _ -> None let of_b58check_exn s = @@ -484,13 +485,13 @@ module Secret_key = struct | Ed25519 sk -> Ed25519.Secret_key.to_b58check sk | Secp256k1 sk -> Secp256k1.Secret_key.to_b58check sk | P256 sk -> P256.Secret_key.to_b58check sk - | Bls sk -> Bls.Secret_key.to_b58check sk + | Bls sk -> Bls_aug.Secret_key.to_b58check sk let to_short_b58check = function | Ed25519 sk -> Ed25519.Secret_key.to_short_b58check sk | Secp256k1 sk -> Secp256k1.Secret_key.to_short_b58check sk | P256 sk -> P256.Secret_key.to_short_b58check sk - | Bls sk -> Bls.Secret_key.to_short_b58check sk + | Bls sk -> Bls_aug.Secret_key.to_short_b58check sk include Helpers.MakeEncoder (struct type nonrec t = t @@ -525,7 +526,7 @@ module Secret_key = struct case (Tag 3) ~title:"Bls" - Bls.Secret_key.encoding + Bls_aug.Secret_key.encoding (function Bls x -> Some x | _ -> None) (function x -> Bls x); ] @@ -548,7 +549,7 @@ type signature = | Ed25519 of Ed25519.t | Secp256k1 of Secp256k1.t | P256 of P256.t - | Bls of Bls.t + | Bls of Bls_aug.t | Unknown of Bytes.t type prefix = Bls_prefix of Bytes.t @@ -565,12 +566,13 @@ let to_bytes = function | Ed25519 b -> Ed25519.to_bytes b | Secp256k1 b -> Secp256k1.to_bytes b | P256 b -> P256.to_bytes b - | Bls b -> Bls.to_bytes b + | Bls b -> Bls_aug.to_bytes b | Unknown b -> b let of_bytes_opt s = let len = Bytes.length s in - if len = Bls.size then Option.map (fun b -> Bls b) (Bls.of_bytes_opt s) + if len = Bls_aug.size then + Option.map (fun b -> Bls b) (Bls_aug.of_bytes_opt s) else if len = Ed25519.size then Some (Unknown s) else None @@ -578,7 +580,7 @@ let () = assert (Ed25519.size = 64) ; assert (Secp256k1.size = 64) ; assert (P256.size = 64) ; - assert (Bls.size = 96) + assert (Bls_aug.size = 96) type Base58.data += Data_unknown of Bytes.t @@ -619,8 +621,8 @@ let of_b58check_opt s = then Option.map (fun x -> Secp256k1 x) (Secp256k1.of_b58check_opt s) else if TzString.has_prefix ~prefix:P256.b58check_encoding.encoded_prefix s then Option.map (fun x -> P256 x) (P256.of_b58check_opt s) - else if TzString.has_prefix ~prefix:Bls.b58check_encoding.encoded_prefix s - then Option.map (fun x -> Bls x) (Bls.of_b58check_opt s) + else if TzString.has_prefix ~prefix:Bls_aug.b58check_encoding.encoded_prefix s + then Option.map (fun x -> Bls x) (Bls_aug.of_b58check_opt s) else Option.map (fun x -> Unknown x) @@ -640,14 +642,14 @@ let to_b58check = function | Ed25519 b -> Ed25519.to_b58check b | Secp256k1 b -> Secp256k1.to_b58check b | P256 b -> P256.to_b58check b - | Bls b -> Bls.to_b58check b + | Bls b -> Bls_aug.to_b58check b | Unknown b -> Base58.simple_encode unknown_b58check_encoding b let to_short_b58check = function | Ed25519 b -> Ed25519.to_short_b58check b | Secp256k1 b -> Secp256k1.to_short_b58check b | P256 b -> P256.to_short_b58check b - | Bls b -> Bls.to_short_b58check b + | Bls b -> Bls_aug.to_short_b58check b | Unknown b -> Base58.simple_encode unknown_b58check_encoding b let raw_encoding = @@ -734,7 +736,7 @@ let prefix_encoding = case (Tag 3) ~title:"Bls_prefix" - (Fixed.bytes (Bls.size - Ed25519.size)) + (Fixed.bytes (Bls_aug.size - Ed25519.size)) (function Bls_prefix x -> Some x) (function x -> Bls_prefix x); ] @@ -743,7 +745,7 @@ let split_signature = function | (Ed25519 _ | Secp256k1 _ | P256 _) as s -> {prefix = None; suffix = to_bytes s} | Bls s -> - let s = Bls.to_bytes s in + let s = Bls_aug.to_bytes s in let prefix = Bytes.sub s 0 32 in let suffix = Bytes.sub s 32 64 in {prefix = Some (Bls_prefix prefix); suffix} @@ -756,7 +758,7 @@ let of_splitted {prefix; suffix} = match prefix with | None -> of_bytes_opt suffix | Some (Bls_prefix prefix) -> - let+ s = Bls.of_bytes_opt (Bytes.cat prefix suffix) in + let+ s = Bls_aug.of_bytes_opt (Bytes.cat prefix suffix) in Bls s let bytes_of_watermark = function @@ -786,7 +788,7 @@ let sign ?watermark secret_key message = | Secret_key.Ed25519 sk -> of_ed25519 (Ed25519.sign ?watermark sk message) | Secp256k1 sk -> of_secp256k1 (Secp256k1.sign ?watermark sk message) | P256 sk -> of_p256 (P256.sign ?watermark sk message) - | Bls sk -> of_bls (Bls.sign ?watermark sk message) + | Bls sk -> of_bls (Bls_aug.sign ?watermark sk message) let check ?watermark public_key signature message = let watermark = Option.map bytes_of_watermark watermark in @@ -804,8 +806,8 @@ let check ?watermark public_key signature message = | Some s -> P256.check ?watermark pk s message | None -> false) | Public_key.Bls pk, Unknown signature -> ( - match Bls.of_bytes_opt signature with - | Some s -> Bls.check ?watermark pk s message + match Bls_aug.of_bytes_opt signature with + | Some s -> Bls_aug.check ?watermark pk s message | None -> false) | Public_key.Ed25519 pk, Ed25519 signature -> Ed25519.check ?watermark pk signature message @@ -814,7 +816,7 @@ let check ?watermark public_key signature message = | Public_key.P256 pk, P256 signature -> P256.check ?watermark pk signature message | Public_key.Bls pk, Bls signature -> - Bls.check ?watermark pk signature message + Bls_aug.check ?watermark pk signature message | _ -> false let fake_sign_from_pk pk msg = @@ -981,7 +983,7 @@ let generate_key ?(algo = Ed25519) ?seed () = let pkh, pk, sk = P256.generate_key ?seed () in (Public_key_hash.P256 pkh, Public_key.P256 pk, Secret_key.P256 sk) | Bls -> - let pkh, pk, sk = Bls.generate_key ?seed () in + let pkh, pk, sk = Bls_aug.generate_key ?seed () in (Public_key_hash.Bls pkh, Public_key.Bls pk, Secret_key.Bls sk) let fake_generate_key ?(algo = Ed25519) ?seed () = @@ -1001,14 +1003,14 @@ let deterministic_nonce sk msg = | Secret_key.Ed25519 sk -> Ed25519.deterministic_nonce sk msg | Secret_key.Secp256k1 sk -> Secp256k1.deterministic_nonce sk msg | Secret_key.P256 sk -> P256.deterministic_nonce sk msg - | Secret_key.Bls sk -> Bls.deterministic_nonce sk msg + | Secret_key.Bls sk -> Bls_aug.deterministic_nonce sk msg let deterministic_nonce_hash sk msg = match sk with | Secret_key.Ed25519 sk -> Ed25519.deterministic_nonce_hash sk msg | Secret_key.Secp256k1 sk -> Secp256k1.deterministic_nonce_hash sk msg | Secret_key.P256 sk -> P256.deterministic_nonce_hash sk msg - | Secret_key.Bls sk -> Bls.deterministic_nonce_hash sk msg + | Secret_key.Bls sk -> Bls_aug.deterministic_nonce_hash sk msg module Of_V0 = struct let public_key_hash : Signature_v0.Public_key_hash.t -> Public_key_hash.t = diff --git a/src/lib_crypto/signature_v1.mli b/src/lib_crypto/signature_v1.mli index 22f1856bc0bc57cd3d54a4063477d5c2247f0d47..d58cdbba7ca55262f69fd686722571a20b5ad328 100644 --- a/src/lib_crypto/signature_v1.mli +++ b/src/lib_crypto/signature_v1.mli @@ -28,19 +28,19 @@ type public_key_hash = | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls of Bls_aug.Public_key_hash.t type public_key = | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls of Bls_aug.Public_key.t type secret_key = | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls of Bls_aug.Secret_key.t type watermark = Signature_v0.watermark = | Block_header of Chain_id.t @@ -56,7 +56,7 @@ type signature = | Ed25519 of Ed25519.t | Secp256k1 of Secp256k1.t | P256 of P256.t - | Bls of Bls.t + | Bls of Bls_aug.t | Unknown of Bytes.t (** A signature prefix holds data only for signature that are more than 64 bytes @@ -98,7 +98,7 @@ val of_ed25519 : Ed25519.t -> t val of_p256 : P256.t -> t (** [of_bls s] returns a wrapped version of the BLS signature [s] in {!t}. *) -val of_bls : Bls.t -> t +val of_bls : Bls_aug.t -> t (** The type of signing algorithms. *) type algo = Ed25519 | Secp256k1 | P256 | Bls diff --git a/src/lib_crypto/signature_v2.ml b/src/lib_crypto/signature_v2.ml index 4375503a33329c782fc4c797638fb3873a737ee4..4b7d8cda81011db7468ff1673fb8f5d6ac5d1e06 100644 --- a/src/lib_crypto/signature_v2.ml +++ b/src/lib_crypto/signature_v2.ml @@ -11,19 +11,19 @@ type public_key_hash = | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls_aug of Bls_aug.Public_key_hash.t type public_key = | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls_aug of Bls_aug.Public_key.t type secret_key = | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls_aug of Bls_aug.Secret_key.t type watermark = Signature_v0.watermark = | Block_header of Chain_id.t @@ -36,7 +36,7 @@ module Public_key_hash = struct | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls_aug of Bls_aug.Public_key_hash.t let name = "Signature.Public_key_hash" @@ -79,9 +79,9 @@ module Public_key_hash = struct case (Tag 3) ~title:"Bls" - Bls.Public_key_hash.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + Bls_aug.Public_key_hash.encoding + (function Bls_aug x -> Some x | _ -> None) + (function x -> Bls_aug x); ] let to_bytes s = Data_encoding.Binary.to_bytes_exn raw_encoding s @@ -113,7 +113,7 @@ module Public_key_hash = struct | Some (Ed25519.Public_key_hash.Data pkh) -> Some (Ed25519 pkh) | Some (Secp256k1.Public_key_hash.Data pkh) -> Some (Secp256k1 pkh) | Some (P256.Public_key_hash.Data pkh) -> Some (P256 pkh) - | Some (Bls.Public_key_hash.Data pkh) -> Some (Bls pkh) + | Some (Bls_aug.Public_key_hash.Data pkh) -> Some (Bls_aug pkh) | _ -> None let of_b58check_exn s = @@ -131,20 +131,20 @@ module Public_key_hash = struct | Ed25519 pkh -> Ed25519.Public_key_hash.to_b58check pkh | Secp256k1 pkh -> Secp256k1.Public_key_hash.to_b58check pkh | P256 pkh -> P256.Public_key_hash.to_b58check pkh - | Bls pkh -> Bls.Public_key_hash.to_b58check pkh + | Bls_aug pkh -> Bls_aug.Public_key_hash.to_b58check pkh let to_short_b58check = function | Ed25519 pkh -> Ed25519.Public_key_hash.to_short_b58check pkh | Secp256k1 pkh -> Secp256k1.Public_key_hash.to_short_b58check pkh | P256 pkh -> P256.Public_key_hash.to_short_b58check pkh - | Bls pkh -> Bls.Public_key_hash.to_short_b58check pkh + | Bls_aug pkh -> Bls_aug.Public_key_hash.to_short_b58check pkh let to_path key l = match key with | Ed25519 h -> "ed25519" :: Ed25519.Public_key_hash.to_path h l | Secp256k1 h -> "secp256k1" :: Secp256k1.Public_key_hash.to_path h l | P256 h -> "p256" :: P256.Public_key_hash.to_path h l - | Bls h -> "bls" :: Bls.Public_key_hash.to_path h l + | Bls_aug h -> "bls" :: Bls_aug.Public_key_hash.to_path h l let of_path = function | "ed25519" :: q -> ( @@ -160,8 +160,8 @@ module Public_key_hash = struct | Some pkh -> Some (P256 pkh) | None -> None) | "bls" :: q -> ( - match Bls.Public_key_hash.of_path q with - | Some pkh -> Some (Bls pkh) + match Bls_aug.Public_key_hash.of_path q with + | Some pkh -> Some (Bls_aug pkh) | None -> None) | _ -> assert false @@ -171,7 +171,7 @@ module Public_key_hash = struct | "ed25519" :: q -> Ed25519 (Ed25519.Public_key_hash.of_path_exn q) | "secp256k1" :: q -> Secp256k1 (Secp256k1.Public_key_hash.of_path_exn q) | "p256" :: q -> P256 (P256.Public_key_hash.of_path_exn q) - | "bls" :: q -> Bls (Bls.Public_key_hash.of_path_exn q) + | "bls" :: q -> Bls_aug (Bls_aug.Public_key_hash.of_path_exn q) | _ -> assert false (* FIXME classification des erreurs *) @@ -180,7 +180,7 @@ module Public_key_hash = struct let l1 = Ed25519.Public_key_hash.path_length and l2 = Secp256k1.Public_key_hash.path_length and l3 = P256.Public_key_hash.path_length - and l4 = Bls.Public_key_hash.path_length in + and l4 = Bls_aug.Public_key_hash.path_length in assert (Compare.Int.(l1 = l2)) ; assert (Compare.Int.(l1 = l3)) ; assert (Compare.Int.(l1 = l4)) ; @@ -200,7 +200,7 @@ module Public_key_hash = struct | Ed25519 x, Ed25519 y -> Ed25519.Public_key_hash.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Public_key_hash.compare x y | P256 x, P256 y -> P256.Public_key_hash.compare x y - | Bls x, Bls y -> Bls.Public_key_hash.compare x y + | Bls_aug x, Bls_aug y -> Bls_aug.Public_key_hash.compare x y | _ -> Stdlib.compare a b end) @@ -254,7 +254,7 @@ module Public_key = struct | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls_aug of Bls_aug.Public_key.t let name = "Signature.Public_key" @@ -265,7 +265,7 @@ module Public_key = struct | Ed25519 pk -> Public_key_hash.Ed25519 (Ed25519.Public_key.hash pk) | Secp256k1 pk -> Public_key_hash.Secp256k1 (Secp256k1.Public_key.hash pk) | P256 pk -> Public_key_hash.P256 (P256.Public_key.hash pk) - | Bls pk -> Public_key_hash.Bls (Bls.Public_key.hash pk) + | Bls_aug pk -> Public_key_hash.Bls_aug (Bls_aug.Public_key.hash pk) include Compare.Make (struct type nonrec t = t @@ -275,11 +275,11 @@ module Public_key = struct | Ed25519 x, Ed25519 y -> Ed25519.Public_key.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Public_key.compare x y | P256 x, P256 y -> P256.Public_key.compare x y - | Bls x, Bls y -> Bls.Public_key.compare x y - | Ed25519 _, (Secp256k1 _ | P256 _ | Bls _) -> -1 - | Secp256k1 _, (P256 _ | Bls _) -> -1 - | P256 _, Bls _ -> -1 - | Bls _, (P256 _ | Secp256k1 _ | Ed25519 _) -> 1 + | Bls_aug x, Bls_aug y -> Bls_aug.Public_key.compare x y + | Ed25519 _, (Secp256k1 _ | P256 _ | Bls_aug _) -> -1 + | Secp256k1 _, (P256 _ | Bls_aug _) -> -1 + | P256 _, Bls_aug _ -> -1 + | Bls_aug _, (P256 _ | Secp256k1 _ | Ed25519 _) -> 1 | P256 _, (Secp256k1 _ | Ed25519 _) -> 1 | Secp256k1 _, Ed25519 _ -> 1 end) @@ -300,7 +300,7 @@ module Public_key = struct | Some (Ed25519.Public_key.Data public_key) -> Some (Ed25519 public_key) | Some (Secp256k1.Public_key.Data public_key) -> Some (Secp256k1 public_key) | Some (P256.Public_key.Data public_key) -> Some (P256 public_key) - | Some (Bls.Public_key.Data public_key) -> Some (Bls public_key) + | Some (Bls_aug.Public_key.Data public_key) -> Some (Bls_aug public_key) | _ -> None let of_b58check_exn s = @@ -318,13 +318,13 @@ module Public_key = struct | Ed25519 pk -> Ed25519.Public_key.to_b58check pk | Secp256k1 pk -> Secp256k1.Public_key.to_b58check pk | P256 pk -> P256.Public_key.to_b58check pk - | Bls pk -> Bls.Public_key.to_b58check pk + | Bls_aug pk -> Bls_aug.Public_key.to_b58check pk let to_short_b58check = function | Ed25519 pk -> Ed25519.Public_key.to_short_b58check pk | Secp256k1 pk -> Secp256k1.Public_key.to_short_b58check pk | P256 pk -> P256.Public_key.to_short_b58check pk - | Bls pk -> Bls.Public_key.to_short_b58check pk + | Bls_aug pk -> Bls_aug.Public_key.to_short_b58check pk let of_bytes_without_validation b = let tag = Bytes.(get_int8 b 0) in @@ -342,8 +342,9 @@ module Public_key = struct Option.bind (P256.Public_key.of_bytes_without_validation b) (fun pk -> Some (P256 pk)) | 3 -> - Option.bind (Bls.Public_key.of_bytes_without_validation b) (fun pk -> - Some (Bls pk)) + Option.bind + (Bls_aug.Public_key.of_bytes_without_validation b) + (fun pk -> Some (Bls_aug pk)) | _ -> None include Helpers.MakeEncoder (struct @@ -379,9 +380,9 @@ module Public_key = struct case ~title:"Bls" (Tag 3) - Bls.Public_key.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + Bls_aug.Public_key.encoding + (function Bls_aug x -> Some x | _ -> None) + (function x -> Bls_aug x); ] let of_b58check = of_b58check @@ -405,7 +406,7 @@ module Secret_key = struct | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls_aug of Bls_aug.Secret_key.t let name = "Signature.Secret_key" @@ -416,7 +417,7 @@ module Secret_key = struct | Secp256k1 sk -> Public_key.Secp256k1 (Secp256k1.Secret_key.to_public_key sk) | P256 sk -> Public_key.P256 (P256.Secret_key.to_public_key sk) - | Bls sk -> Public_key.Bls (Bls.Secret_key.to_public_key sk) + | Bls_aug sk -> Public_key.Bls_aug (Bls_aug.Secret_key.to_public_key sk) include Compare.Make (struct type nonrec t = t @@ -426,7 +427,7 @@ module Secret_key = struct | Ed25519 x, Ed25519 y -> Ed25519.Secret_key.compare x y | Secp256k1 x, Secp256k1 y -> Secp256k1.Secret_key.compare x y | P256 x, P256 y -> P256.Secret_key.compare x y - | Bls x, Bls y -> Bls.Secret_key.compare x y + | Bls_aug x, Bls_aug y -> Bls_aug.Secret_key.compare x y | _ -> Stdlib.compare a b end) @@ -446,7 +447,7 @@ module Secret_key = struct | Some (Ed25519.Secret_key.Data sk) -> Some (Ed25519 sk) | Some (Secp256k1.Secret_key.Data sk) -> Some (Secp256k1 sk) | Some (P256.Secret_key.Data sk) -> Some (P256 sk) - | Some (Bls.Secret_key.Data sk) -> Some (Bls sk) + | Some (Bls_aug.Secret_key.Data sk) -> Some (Bls_aug sk) | _ -> None let of_b58check_exn s = @@ -464,13 +465,13 @@ module Secret_key = struct | Ed25519 sk -> Ed25519.Secret_key.to_b58check sk | Secp256k1 sk -> Secp256k1.Secret_key.to_b58check sk | P256 sk -> P256.Secret_key.to_b58check sk - | Bls sk -> Bls.Secret_key.to_b58check sk + | Bls_aug sk -> Bls_aug.Secret_key.to_b58check sk let to_short_b58check = function | Ed25519 sk -> Ed25519.Secret_key.to_short_b58check sk | Secp256k1 sk -> Secp256k1.Secret_key.to_short_b58check sk | P256 sk -> P256.Secret_key.to_short_b58check sk - | Bls sk -> Bls.Secret_key.to_short_b58check sk + | Bls_aug sk -> Bls_aug.Secret_key.to_short_b58check sk include Helpers.MakeEncoder (struct type nonrec t = t @@ -505,9 +506,9 @@ module Secret_key = struct case (Tag 3) ~title:"Bls" - Bls.Secret_key.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + Bls_aug.Secret_key.encoding + (function Bls_aug x -> Some x | _ -> None) + (function x -> Bls_aug x); ] let of_b58check = of_b58check @@ -528,7 +529,7 @@ type signature = | Ed25519 of Ed25519.t | Secp256k1 of Secp256k1.t | P256 of P256.t - | Bls of Bls.t + | Bls_aug of Bls_aug.t | Unknown of Bytes.t type prefix = Bls_prefix of Bytes.t @@ -545,12 +546,13 @@ let to_bytes = function | Ed25519 b -> Ed25519.to_bytes b | Secp256k1 b -> Secp256k1.to_bytes b | P256 b -> P256.to_bytes b - | Bls b -> Bls.to_bytes b + | Bls_aug b -> Bls_aug.to_bytes b | Unknown b -> b let of_bytes_opt s = let len = Bytes.length s in - if len = Bls.size then Option.map (fun b -> Bls b) (Bls.of_bytes_opt s) + if len = Bls_aug.size then + Option.map (fun b -> Bls_aug b) (Bls_aug.of_bytes_opt s) else if len = Ed25519.size then Some (Unknown s) else None @@ -558,7 +560,7 @@ let () = assert (Ed25519.size = 64) ; assert (Secp256k1.size = 64) ; assert (P256.size = 64) ; - assert (Bls.size = 96) + assert (Bls_aug.size = 96) type Base58.data += Data_unknown of Bytes.t @@ -599,8 +601,8 @@ let of_b58check_opt s = then Option.map (fun x -> Secp256k1 x) (Secp256k1.of_b58check_opt s) else if TzString.has_prefix ~prefix:P256.b58check_encoding.encoded_prefix s then Option.map (fun x -> P256 x) (P256.of_b58check_opt s) - else if TzString.has_prefix ~prefix:Bls.b58check_encoding.encoded_prefix s - then Option.map (fun x -> Bls x) (Bls.of_b58check_opt s) + else if TzString.has_prefix ~prefix:Bls_aug.b58check_encoding.encoded_prefix s + then Option.map (fun x -> Bls_aug x) (Bls_aug.of_b58check_opt s) else Option.map (fun x -> Unknown x) @@ -620,14 +622,14 @@ let to_b58check = function | Ed25519 b -> Ed25519.to_b58check b | Secp256k1 b -> Secp256k1.to_b58check b | P256 b -> P256.to_b58check b - | Bls b -> Bls.to_b58check b + | Bls_aug b -> Bls_aug.to_b58check b | Unknown b -> Base58.simple_encode unknown_b58check_encoding b let to_short_b58check = function | Ed25519 b -> Ed25519.to_short_b58check b | Secp256k1 b -> Secp256k1.to_short_b58check b | P256 b -> P256.to_short_b58check b - | Bls b -> Bls.to_short_b58check b + | Bls_aug b -> Bls_aug.to_short_b58check b | Unknown b -> Base58.simple_encode unknown_b58check_encoding b let raw_encoding = @@ -694,7 +696,7 @@ let of_secp256k1 s = Secp256k1 s let of_p256 s = P256 s -let of_bls s = Bls s +let of_bls s = Bls_aug s let zero = of_ed25519 Ed25519.zero @@ -714,7 +716,7 @@ let prefix_encoding = case (Tag 3) ~title:"Bls_prefix" - (Fixed.bytes (Bls.size - Ed25519.size)) + (Fixed.bytes (Bls_aug.size - Ed25519.size)) (function Bls_prefix x -> Some x) (function x -> Bls_prefix x); ] @@ -722,8 +724,8 @@ let prefix_encoding = let split_signature = function | (Ed25519 _ | Secp256k1 _ | P256 _) as s -> {prefix = None; suffix = to_bytes s} - | Bls s -> - let s = Bls.to_bytes s in + | Bls_aug s -> + let s = Bls_aug.to_bytes s in let prefix = Bytes.sub s 0 32 in let suffix = Bytes.sub s 32 64 in {prefix = Some (Bls_prefix prefix); suffix} @@ -736,8 +738,8 @@ let of_splitted {prefix; suffix} = match prefix with | None -> of_bytes_opt suffix | Some (Bls_prefix prefix) -> - let+ s = Bls.of_bytes_opt (Bytes.cat prefix suffix) in - Bls s + let+ s = Bls_aug.of_bytes_opt (Bytes.cat prefix suffix) in + Bls_aug s let bytes_of_watermark = function | Block_header chain_id -> @@ -766,7 +768,7 @@ let sign ?watermark secret_key message = | Secret_key.Ed25519 sk -> of_ed25519 (Ed25519.sign ?watermark sk message) | Secp256k1 sk -> of_secp256k1 (Secp256k1.sign ?watermark sk message) | P256 sk -> of_p256 (P256.sign ?watermark sk message) - | Bls sk -> of_bls (Bls.sign ?watermark sk message) + | Bls_aug sk -> of_bls (Bls_aug.sign ?watermark sk message) let check ?watermark public_key signature message = let watermark = Option.map bytes_of_watermark watermark in @@ -783,9 +785,9 @@ let check ?watermark public_key signature message = match P256.of_bytes_opt signature with | Some s -> P256.check ?watermark pk s message | None -> false) - | Public_key.Bls pk, Unknown signature -> ( - match Bls.of_bytes_opt signature with - | Some s -> Bls.check ?watermark pk s message + | Public_key.Bls_aug pk, Unknown signature -> ( + match Bls_aug.of_bytes_opt signature with + | Some s -> Bls_aug.check ?watermark pk s message | None -> false) | Public_key.Ed25519 pk, Ed25519 signature -> Ed25519.check ?watermark pk signature message @@ -793,8 +795,8 @@ let check ?watermark public_key signature message = Secp256k1.check ?watermark pk signature message | Public_key.P256 pk, P256 signature -> P256.check ?watermark pk signature message - | Public_key.Bls pk, Bls signature -> - Bls.check ?watermark pk signature message + | Public_key.Bls_aug pk, Bls_aug signature -> + Bls_aug.check ?watermark pk signature message | _ -> false let fake_sign_from_pk pk msg = @@ -808,7 +810,7 @@ let fake_sign_from_pk pk msg = Bytes.blit msg 0 tmp half (all_or_half msg) ; of_bytes_exn tmp -type algo = Ed25519 | Secp256k1 | P256 | Bls +type algo = Ed25519 | Secp256k1 | P256 | Bls_aug let fake_sign ?watermark:_ secret_key msg = let pk = Secret_key.to_public_key secret_key in @@ -825,7 +827,7 @@ let hardcoded_sk algo : secret_key = | P256 -> Secret_key.of_b58check_exn "p2sk2k6YAkNJ8CySZCS3vGA5Ht6Lj6LXG3yb8UrHvMKZy7Ab8JUtWh" - | Bls -> + | Bls_aug -> Secret_key.of_b58check_exn "BLsk1hfuv6V8JJRaLDBJgPTRGLKusTZnTmWGrvSKYzUaMuzvPLmeGG" @@ -835,9 +837,9 @@ let hardcoded_pk = ( Secret_key.to_public_key (hardcoded_sk Ed25519), Secret_key.to_public_key (hardcoded_sk Secp256k1), Secret_key.to_public_key (hardcoded_sk P256), - Secret_key.to_public_key (hardcoded_sk Bls) ) + Secret_key.to_public_key (hardcoded_sk Bls_aug) ) in - function Ed25519 -> ed | Secp256k1 -> secp | P256 -> p | Bls -> bls + function Ed25519 -> ed | Secp256k1 -> secp | P256 -> p | Bls_aug -> bls let hardcoded_msg = Bytes.of_string "Cheers" @@ -847,16 +849,16 @@ let hardcoded_sig = ( sign (hardcoded_sk Ed25519) hardcoded_msg, sign (hardcoded_sk Secp256k1) hardcoded_msg, sign (hardcoded_sk P256) hardcoded_msg, - sign (hardcoded_sk Bls) hardcoded_msg ) + sign (hardcoded_sk Bls_aug) hardcoded_msg ) in - function Ed25519 -> ed | Secp256k1 -> secp | P256 -> p | Bls -> bls + function Ed25519 -> ed | Secp256k1 -> secp | P256 -> p | Bls_aug -> bls let algo_of_pk (pk : Public_key.t) = match pk with | Ed25519 _ -> Ed25519 | Secp256k1 _ -> Secp256k1 | P256 _ -> P256 - | Bls _ -> Bls + | Bls_aug _ -> Bls_aug let fast_fake_sign ?watermark:_ sk _msg = let pk = Secret_key.to_public_key sk in @@ -935,7 +937,7 @@ let append ?watermark sk msg = Bytes.cat msg (to_bytes (sign ?watermark sk msg)) let concat msg signature = Bytes.cat msg (to_bytes signature) -let algos = [Ed25519; Secp256k1; P256; Bls] +let algos = [Ed25519; Secp256k1; P256; Bls_aug] let fake_generate_key (pkh, pk, _) = let sk_of_pk (pk : public_key) : secret_key = @@ -960,9 +962,9 @@ let generate_key ?(algo = Ed25519) ?seed () = | P256 -> let pkh, pk, sk = P256.generate_key ?seed () in (Public_key_hash.P256 pkh, Public_key.P256 pk, Secret_key.P256 sk) - | Bls -> - let pkh, pk, sk = Bls.generate_key ?seed () in - (Public_key_hash.Bls pkh, Public_key.Bls pk, Secret_key.Bls sk) + | Bls_aug -> + let pkh, pk, sk = Bls_aug.generate_key ?seed () in + (Public_key_hash.Bls_aug pkh, Public_key.Bls_aug pk, Secret_key.Bls_aug sk) let fake_generate_key ?(algo = Ed25519) ?seed () = let true_keys = generate_key ~algo ?seed () in @@ -981,14 +983,14 @@ let deterministic_nonce sk msg = | Secret_key.Ed25519 sk -> Ed25519.deterministic_nonce sk msg | Secret_key.Secp256k1 sk -> Secp256k1.deterministic_nonce sk msg | Secret_key.P256 sk -> P256.deterministic_nonce sk msg - | Secret_key.Bls sk -> Bls.deterministic_nonce sk msg + | Secret_key.Bls_aug sk -> Bls_aug.deterministic_nonce sk msg let deterministic_nonce_hash sk msg = match sk with | Secret_key.Ed25519 sk -> Ed25519.deterministic_nonce_hash sk msg | Secret_key.Secp256k1 sk -> Secp256k1.deterministic_nonce_hash sk msg | Secret_key.P256 sk -> P256.deterministic_nonce_hash sk msg - | Secret_key.Bls sk -> Bls.deterministic_nonce_hash sk msg + | Secret_key.Bls_aug sk -> Bls_aug.deterministic_nonce_hash sk msg module Of_V0 = struct let public_key_hash : Signature_v0.Public_key_hash.t -> Public_key_hash.t = @@ -1020,24 +1022,24 @@ module Of_V1 = struct | Signature_v1.Ed25519 k -> Ed25519 k | Signature_v1.Secp256k1 k -> Secp256k1 k | Signature_v1.P256 k -> P256 k - | Signature_v1.Bls k -> Bls k + | Signature_v1.Bls k -> Bls_aug k let public_key : Signature_v1.Public_key.t -> Public_key.t = function | Signature_v1.Ed25519 k -> Ed25519 k | Signature_v1.Secp256k1 k -> Secp256k1 k | Signature_v1.P256 k -> P256 k - | Signature_v1.Bls k -> Bls k + | Signature_v1.Bls k -> Bls_aug k let secret_key : Signature_v1.Secret_key.t -> Secret_key.t = function | Signature_v1.Ed25519 k -> Ed25519 k | Signature_v1.Secp256k1 k -> Secp256k1 k | Signature_v1.P256 k -> P256 k - | Signature_v1.Bls k -> Bls k + | Signature_v1.Bls k -> Bls_aug k let signature : Signature_v1.t -> t = function | Signature_v1.Ed25519 k -> Ed25519 k | Signature_v1.Secp256k1 k -> Secp256k1 k | Signature_v1.P256 k -> P256 k | Signature_v1.Unknown k -> Unknown k - | Signature_v1.Bls k -> Bls k + | Signature_v1.Bls k -> Bls_aug k end diff --git a/src/lib_crypto/signature_v2.mli b/src/lib_crypto/signature_v2.mli index cc9217248cdaa70af1b3a7f75ec66352ecae3c2a..e8d03eefe4b6bd207c0aad38294c77431992d977 100644 --- a/src/lib_crypto/signature_v2.mli +++ b/src/lib_crypto/signature_v2.mli @@ -9,19 +9,19 @@ type public_key_hash = | Ed25519 of Ed25519.Public_key_hash.t | Secp256k1 of Secp256k1.Public_key_hash.t | P256 of P256.Public_key_hash.t - | Bls of Bls.Public_key_hash.t + | Bls_aug of Bls_aug.Public_key_hash.t type public_key = | Ed25519 of Ed25519.Public_key.t | Secp256k1 of Secp256k1.Public_key.t | P256 of P256.Public_key.t - | Bls of Bls.Public_key.t + | Bls_aug of Bls_aug.Public_key.t type secret_key = | Ed25519 of Ed25519.Secret_key.t | Secp256k1 of Secp256k1.Secret_key.t | P256 of P256.Secret_key.t - | Bls of Bls.Secret_key.t + | Bls_aug of Bls_aug.Secret_key.t type watermark = Signature_v0.watermark = | Block_header of Chain_id.t @@ -37,7 +37,7 @@ type signature = | Ed25519 of Ed25519.t | Secp256k1 of Secp256k1.t | P256 of P256.t - | Bls of Bls.t + | Bls_aug of Bls_aug.t | Unknown of Bytes.t (** A signature prefix holds data only for signature that are more than 64 bytes @@ -79,10 +79,10 @@ val of_ed25519 : Ed25519.t -> t val of_p256 : P256.t -> t (** [of_bls s] returns a wrapped version of the BLS signature [s] in {!t}. *) -val of_bls : Bls.t -> t +val of_bls : Bls_aug.t -> t (** The type of signing algorithms. *) -type algo = Ed25519 | Secp256k1 | P256 | Bls +type algo = Ed25519 | Secp256k1 | P256 | Bls_aug (** The list of signing algorithm supported, i.e. all constructors of type {!algo}. *) diff --git a/src/lib_crypto/test/test_prop_signature.ml b/src/lib_crypto/test/test_prop_signature.ml index 1e709784c83f10089707fde2884b438c57f96e5c..aae3382090fb4157fe63ea9584ca509bc969b587 100644 --- a/src/lib_crypto/test/test_prop_signature.ml +++ b/src/lib_crypto/test/test_prop_signature.ml @@ -161,7 +161,7 @@ let () = let name = "Bls12_381" end) (struct - include Signature.Bls + include Signature.Bls_aug let watermark_of_bytes b = b end) @@ -191,6 +191,6 @@ let () = (Ed25519, "Ed25519"); (Secp256k1, "Secp256k1"); (P256, "P256"); - (Bls, "Bls"); + (Bls_aug, "Bls"); ] |> Alcotest.run ~__FILE__ "tezos-crypto-prop-signature" diff --git a/src/lib_crypto/test/test_signature.ml b/src/lib_crypto/test/test_signature.ml index aae0fda75a2ed7925fe59ed424fc5e1edc8bc85e..fe36293842e9f30a3055e0e4db2bf975d91b80f8 100644 --- a/src/lib_crypto/test/test_signature.ml +++ b/src/lib_crypto/test/test_signature.ml @@ -61,13 +61,13 @@ let test_size () = in assert (Compare.Int.(expected = length)) ; let length = - let _pkh, pk, _sk = generate_key ~algo:Bls () in + let _pkh, pk, _sk = generate_key ~algo:Bls_aug () in Public_key.size pk in let expected = (* add 1 for the tag of union encoding *) (WithExceptions.Option.get ~loc:__LOC__ - @@ Data_encoding.Binary.fixed_length Bls.Public_key.encoding) + @@ Data_encoding.Binary.fixed_length Bls_aug.Public_key.encoding) + 1 in assert (Compare.Int.(expected = length)) @@ -81,7 +81,7 @@ let test_of_bytes_without_validation () = in let pk2 = Signature.Public_key.of_bytes_without_validation bytes in assert (Some pk = pk2)) - [Ed25519; Secp256k1; P256; Bls] + [Ed25519; Secp256k1; P256; Bls_aug] let secp256k1_sig_to_hex signature = Hex.show @@ Hex.of_string diff --git a/src/lib_crypto/test/test_signature_encodings.ml b/src/lib_crypto/test/test_signature_encodings.ml index 8fa39525b79d6c57ab68450b6253d493f65537b0..1a0cf11a7222aae098a60ebf6a43c89c4d3d389e 100644 --- a/src/lib_crypto/test/test_signature_encodings.ml +++ b/src/lib_crypto/test/test_signature_encodings.ml @@ -173,7 +173,7 @@ module Test_P256 = module Test_Bls = Make_tests - (Signature.Bls) + (Signature.Bls_aug) (struct let name = "bls12_381" diff --git a/src/lib_crypto/tezos_crypto.ml b/src/lib_crypto/tezos_crypto.ml index 12b7bdce7d253252a4281f53232efca273a3a757..d02b83e8d467beb78a3373968ae3f389dba4baa6 100644 --- a/src/lib_crypto/tezos_crypto.ml +++ b/src/lib_crypto/tezos_crypto.ml @@ -47,7 +47,7 @@ module Hashed = struct end module Signature = struct - module Bls = Bls + module Bls_aug = Bls_aug module Ed25519 = Ed25519 module P256 = P256 module Secp256k1 = Secp256k1 diff --git a/src/lib_protocol_environment/environment_V10.ml b/src/lib_protocol_environment/environment_V10.ml index 120d968900a74fa65e86fa4af666347a7596b817..a8773489540283251989e29960e6fde0413107ae 100644 --- a/src/lib_protocol_environment/environment_V10.ml +++ b/src/lib_protocol_environment/environment_V10.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -319,7 +319,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V10.mli b/src/lib_protocol_environment/environment_V10.mli index 32b0dc749be6289db5ad60421852278f7e3d1fd6..2226d0edef61486fd0c483d80396d7184c6807d9 100644 --- a/src/lib_protocol_environment/environment_V10.mli +++ b/src/lib_protocol_environment/environment_V10.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V11.ml b/src/lib_protocol_environment/environment_V11.ml index 8849bb66fdff9d3f0602912a1ca2de5306e6492e..126296665e055469ab599a3e6524265142e2d052 100644 --- a/src/lib_protocol_environment/environment_V11.ml +++ b/src/lib_protocol_environment/environment_V11.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -330,7 +330,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V11.mli b/src/lib_protocol_environment/environment_V11.mli index a1037ceff962730e8f4a02991a1cf2ef003a442f..560035ef8e6208ceffef5619636caa1ec9fd633d 100644 --- a/src/lib_protocol_environment/environment_V11.mli +++ b/src/lib_protocol_environment/environment_V11.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V12.ml b/src/lib_protocol_environment/environment_V12.ml index f9b7148342b00365cd39d07db9c0c4197d6a12cc..d809610674077a02d0b3fbdeef7ccc6c2b986b89 100644 --- a/src/lib_protocol_environment/environment_V12.ml +++ b/src/lib_protocol_environment/environment_V12.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -330,7 +330,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V12.mli b/src/lib_protocol_environment/environment_V12.mli index ceea2e31398fc88ed72e0e093b5125cb77899b3b..6f0515bfd31a0eafe434b9ce460c480759e3ad77 100644 --- a/src/lib_protocol_environment/environment_V12.mli +++ b/src/lib_protocol_environment/environment_V12.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V13.ml b/src/lib_protocol_environment/environment_V13.ml index a7c3daf2b9fb569aa4313fb70baaa803f55f1e45..35b32c23ea1338d1ad7425d08a84e26f92af3a85 100644 --- a/src/lib_protocol_environment/environment_V13.ml +++ b/src/lib_protocol_environment/environment_V13.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -330,7 +330,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V13.mli b/src/lib_protocol_environment/environment_V13.mli index 00f49fe414319af269a2d870d0c9564efae78548..502b3530423f7145325a37e7a95f902d49807011 100644 --- a/src/lib_protocol_environment/environment_V13.mli +++ b/src/lib_protocol_environment/environment_V13.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V14.ml b/src/lib_protocol_environment/environment_V14.ml index 6ac9746abda461f3b7c2c09f88f24f437318669e..ecb37bd8fd343526b169f8e9214ea3cb3ed27ac2 100644 --- a/src/lib_protocol_environment/environment_V14.ml +++ b/src/lib_protocol_environment/environment_V14.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -335,7 +335,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V14.mli b/src/lib_protocol_environment/environment_V14.mli index 87f305f7bd32d34e9e660e5feb2a73a4bcea8470..af589f379dcf8504a7d1c604b26e7cc709951c48 100644 --- a/src/lib_protocol_environment/environment_V14.mli +++ b/src/lib_protocol_environment/environment_V14.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V15.ml b/src/lib_protocol_environment/environment_V15.ml index 51e7db2003e16e6c854e9589aa7a0ac46a26f7ad..82594d3516df79a656fe156f2fdbce6a8032b828 100644 --- a/src/lib_protocol_environment/environment_V15.ml +++ b/src/lib_protocol_environment/environment_V15.ml @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -335,7 +335,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V15.mli b/src/lib_protocol_environment/environment_V15.mli index e1defb4f4d8ed381f07d2e1f3e8188c3a087ed2b..2ec09e3d877b24da020fc5871fa37087187f5c15 100644 --- a/src/lib_protocol_environment/environment_V15.mli +++ b/src/lib_protocol_environment/environment_V15.mli @@ -79,9 +79,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_protocol_environment/environment_V7.ml b/src/lib_protocol_environment/environment_V7.ml index 2c63f1ae1256702d52948fd7745f7597d6286b0f..cefce9fd12b61f78e6909c5f72a46861af821434 100644 --- a/src/lib_protocol_environment/environment_V7.ml +++ b/src/lib_protocol_environment/environment_V7.ml @@ -75,9 +75,9 @@ module type T = sig and type P256.Public_key_hash.t = Signature.P256.Public_key_hash.t and type P256.Public_key.t = Signature.P256.Public_key.t and type P256.t = Signature.P256.t - and type Bls.Public_key_hash.t = Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Signature.Bls.Public_key.t - and type Bls.t = Signature.Bls.t + and type Bls.Public_key_hash.t = Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Signature.Bls_aug.Public_key.t + and type Bls.t = Signature.Bls_aug.t and type Signature.public_key_hash = Signature.V0.public_key_hash and type Signature.public_key = Signature.V0.public_key and type Signature.t = Signature.V0.t @@ -275,7 +275,7 @@ struct module Ed25519 = Signature.Ed25519 module Secp256k1 = Signature.Secp256k1 module P256 = Signature.P256 - module Bls = Signature.Bls + module Bls = Signature.Bls_aug module Signature = Signature.V0 module Timelock = Tezos_crypto.Timelock_legacy module Vdf = Class_group_vdf.Vdf_self_contained diff --git a/src/lib_protocol_environment/environment_V7.mli b/src/lib_protocol_environment/environment_V7.mli index 80f90cbc2f2c44b312dc961c266f08a3f0989e80..a65363d8ffc0c477d2e653410726e0f07fc3d2e0 100644 --- a/src/lib_protocol_environment/environment_V7.mli +++ b/src/lib_protocol_environment/environment_V7.mli @@ -75,9 +75,9 @@ module type T = sig and type P256.Public_key_hash.t = Signature.P256.Public_key_hash.t and type P256.Public_key.t = Signature.P256.Public_key.t and type P256.t = Signature.P256.t - and type Bls.Public_key_hash.t = Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Signature.Bls.Public_key.t - and type Bls.t = Signature.Bls.t + and type Bls.Public_key_hash.t = Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Signature.Bls_aug.Public_key.t + and type Bls.t = Signature.Bls_aug.t and type Signature.public_key_hash = Signature.V0.public_key_hash and type Signature.public_key = Signature.V0.public_key and type Signature.t = Signature.V0.t diff --git a/src/lib_protocol_environment/environment_V8.ml b/src/lib_protocol_environment/environment_V8.ml index 86cd8a5ab81bef0d553fabb616ca708e3b9cdbbf..76434bb63a00e22cd2195ea953890df3baf96b60 100644 --- a/src/lib_protocol_environment/environment_V8.ml +++ b/src/lib_protocol_environment/environment_V8.ml @@ -75,9 +75,9 @@ module type T = sig and type P256.Public_key_hash.t = Signature.P256.Public_key_hash.t and type P256.Public_key.t = Signature.P256.Public_key.t and type P256.t = Signature.P256.t - and type Bls.Public_key_hash.t = Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Signature.Bls.Public_key.t - and type Bls.t = Signature.Bls.t + and type Bls.Public_key_hash.t = Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Signature.Bls_aug.Public_key.t + and type Bls.t = Signature.Bls_aug.t and type Signature.public_key_hash = Signature.V1.public_key_hash and type Signature.public_key = Signature.V1.public_key and type Signature.signature = Signature.V1.signature @@ -308,7 +308,7 @@ struct module Ed25519 = Signature.Ed25519 module Secp256k1 = Signature.Secp256k1 module P256 = Signature.P256 - module Bls = Signature.Bls + module Bls = Signature.Bls_aug module Signature = Signature.V1 module Timelock = Tezos_crypto.Timelock_legacy module Vdf = Class_group_vdf.Vdf_self_contained diff --git a/src/lib_protocol_environment/environment_V8.mli b/src/lib_protocol_environment/environment_V8.mli index 073f9f8d5ceec877a86c6b2043826ca53174b9e2..ad28c7b6d445cc936628e5bde314251e44b40e00 100644 --- a/src/lib_protocol_environment/environment_V8.mli +++ b/src/lib_protocol_environment/environment_V8.mli @@ -75,9 +75,9 @@ module type T = sig and type P256.Public_key_hash.t = Signature.P256.Public_key_hash.t and type P256.Public_key.t = Signature.P256.Public_key.t and type P256.t = Signature.P256.t - and type Bls.Public_key_hash.t = Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Signature.Bls.Public_key.t - and type Bls.t = Signature.Bls.t + and type Bls.Public_key_hash.t = Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Signature.Bls_aug.Public_key.t + and type Bls.t = Signature.Bls_aug.t and type Signature.public_key_hash = Signature.V1.public_key_hash and type Signature.public_key = Signature.V1.public_key and type Signature.signature = Signature.V1.signature diff --git a/src/lib_protocol_environment/environment_V9.ml b/src/lib_protocol_environment/environment_V9.ml index c15c642c026bd5380810cc96058e2741124c7531..ee212ac1b75b9d3d059506e37a28823f46c8af54 100644 --- a/src/lib_protocol_environment/environment_V9.ml +++ b/src/lib_protocol_environment/environment_V9.ml @@ -77,9 +77,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key @@ -307,7 +307,7 @@ struct module Ed25519 = Tezos_crypto.Signature.Ed25519 module Secp256k1 = Tezos_crypto.Signature.Secp256k1 module P256 = Tezos_crypto.Signature.P256 - module Bls = Tezos_crypto.Signature.Bls + module Bls = Tezos_crypto.Signature.Bls_aug module Signature = struct include Tezos_crypto.Signature.V1 diff --git a/src/lib_protocol_environment/environment_V9.mli b/src/lib_protocol_environment/environment_V9.mli index ec62ed951ed0afd27e1d69a067383ce4bad41ac2..ab97818d7449c1ed2d488bdf08d7e8ba052282b9 100644 --- a/src/lib_protocol_environment/environment_V9.mli +++ b/src/lib_protocol_environment/environment_V9.mli @@ -77,9 +77,9 @@ module type T = sig and type P256.Public_key.t = Tezos_crypto.Signature.P256.Public_key.t and type P256.t = Tezos_crypto.Signature.P256.t and type Bls.Public_key_hash.t = - Tezos_crypto.Signature.Bls.Public_key_hash.t - and type Bls.Public_key.t = Tezos_crypto.Signature.Bls.Public_key.t - and type Bls.t = Tezos_crypto.Signature.Bls.t + Tezos_crypto.Signature.Bls_aug.Public_key_hash.t + and type Bls.Public_key.t = Tezos_crypto.Signature.Bls_aug.Public_key.t + and type Bls.t = Tezos_crypto.Signature.Bls_aug.t and type Signature.public_key_hash = Tezos_crypto.Signature.V1.public_key_hash and type Signature.public_key = Tezos_crypto.Signature.V1.public_key diff --git a/src/lib_shell_benchmarks/encoding_benchmarks.ml b/src/lib_shell_benchmarks/encoding_benchmarks.ml index b96d814719406b995d405b4f7e745373a465e2a4..560064490c3209ae27da93e2d0a7c7398b74a5f9 100644 --- a/src/lib_shell_benchmarks/encoding_benchmarks.ml +++ b/src/lib_shell_benchmarks/encoding_benchmarks.ml @@ -47,7 +47,7 @@ struct | Tezos_crypto.Signature.Ed25519 -> "ed25519" | Tezos_crypto.Signature.Secp256k1 -> "secp256k1" | Tezos_crypto.Signature.P256 -> "p256" - | Tezos_crypto.Signature.Bls -> "bls" + | Tezos_crypto.Signature.Bls_aug -> "bls" module Sampler = Crypto_samplers.Make_finite_key_pool (struct let size = 256 @@ -221,7 +221,7 @@ module P256 = Make_elliptic_curve_encoding_benchmarks (struct end) module Bls = Make_elliptic_curve_encoding_benchmarks (struct - let algo = Tezos_crypto.Signature.Bls + let algo = Tezos_crypto.Signature.Bls_aug end) let chain_id_encoding = diff --git a/src/lib_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index 5ac98b89f231f30da9422b4032bf4d946fe6d157..9c137f51a4b72e5cf161a0b2e7e8a6028bf9a693 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -83,8 +83,10 @@ module Raw = struct Data_encoding.Binary.to_bytes_exn Signature.P256.Secret_key.encoding sk - | Decrypted_sk (Bls sk) -> - Data_encoding.Binary.to_bytes_exn Signature.Bls.Secret_key.encoding sk + | Decrypted_sk (Bls_aug sk) -> + Data_encoding.Binary.to_bytes_exn + Signature.Bls_aug.Secret_key.encoding + sk in Bytes.cat salt (Tezos_crypto.Crypto_box.Secretbox.secretbox key msg nonce) @@ -135,15 +137,15 @@ module Raw = struct | None -> failwith "Corrupted wallet, deciphered key is not a valid P256 secret key") - | Some bytes, Encrypted_sk Signature.Bls -> ( + | Some bytes, Encrypted_sk Signature.Bls_aug -> ( match Data_encoding.Binary.of_bytes_opt - Signature.Bls.Secret_key.encoding + Signature.Bls_aug.Secret_key.encoding bytes with | Some sk -> return_some - (Decrypted_sk (Bls sk : Tezos_crypto.Signature.Secret_key.t)) + (Decrypted_sk (Bls_aug sk : Tezos_crypto.Signature.Secret_key.t)) | None -> failwith "Corrupted wallet, deciphered key is not a valid BLS12_381 \ @@ -303,7 +305,7 @@ let decrypt_payload cctxt ?name encrypted_sk = | Some (Encrypted_p256 encrypted_sk) -> return (Encrypted_sk Signature.P256, encrypted_sk) | Some (Encrypted_bls12_381 encrypted_sk) -> - return (Encrypted_sk Signature.Bls, encrypted_sk) + return (Encrypted_sk Signature.Bls_aug, encrypted_sk) | _ -> failwith "Not a Base58Check-encoded encrypted key" in let* o = noninteractive_decrypt_loop algo ~encrypted_sk !passwords in @@ -369,7 +371,7 @@ let common_encrypt sk password = | Decrypted_sk (Ed25519 _) -> Encodings.ed25519 | Decrypted_sk (Secp256k1 _) -> Encodings.secp256k1 | Decrypted_sk (P256 _) -> Encodings.p256 - | Decrypted_sk (Bls _) -> Encodings.bls12_381 + | Decrypted_sk (Bls_aug _) -> Encodings.bls12_381 in Tezos_crypto.Base58.simple_encode encoding payload diff --git a/src/lib_signer_backends/test/test_encrypted.ml b/src/lib_signer_backends/test/test_encrypted.ml index 78411f6ca325fc6d06d667b33ca14d08ebba5749..4a8975e23871a528a3d320b2f8ed90d1cd2b6a79 100644 --- a/src/lib_signer_backends/test/test_encrypted.ml +++ b/src/lib_signer_backends/test/test_encrypted.ml @@ -228,7 +228,7 @@ let test_random _switch () = let* r = List.iter_es test_random - Tezos_crypto.Signature.[Ed25519; Secp256k1; P256; Bls] + Tezos_crypto.Signature.[Ed25519; Secp256k1; P256; Bls_aug] in match r with | Ok _ -> Lwt.return_unit diff --git a/src/proto_016_PtMumbai/lib_client/dune b/src/proto_016_PtMumbai/lib_client/dune index 5ae1fe251a59143b6d97576727d3808df5ace3af..0818c6e40515fcf29f4c927d931ca1ec2a3f844b 100644 --- a/src/proto_016_PtMumbai/lib_client/dune +++ b/src/proto_016_PtMumbai/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_016_PtMumbai/lib_client/injection.ml b/src/proto_016_PtMumbai/lib_client/injection.ml index 5f7f769a2b89c39f43bd4d3a52dcbd83b3944944..b0e5b7284796d92af6ae296a3915ff6fab5b9d89 100644 --- a/src/proto_016_PtMumbai/lib_client/injection.ml +++ b/src/proto_016_PtMumbai/lib_client/injection.ml @@ -635,10 +635,10 @@ let signature_size_of_algo : Tezos_crypto.Signature.algo -> int = function | Ed25519 -> Tezos_crypto.Signature.Ed25519.size | Secp256k1 -> Tezos_crypto.Signature.Secp256k1.size | P256 -> Tezos_crypto.Signature.P256.size - | Bls -> + | Bls_aug -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Tezos_crypto.Signature.Bls.size + 2 + Tezos_crypto.Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let safety_guard = Gas.Arith.(integral_of_int_exn 100) @@ -1410,7 +1410,7 @@ let inject_manager_operation cctxt ~chain ~block ?successor_level ?branch | Ed25519 _ -> Tezos_crypto.Signature.Ed25519 | Secp256k1 _ -> Secp256k1 | P256 _ -> P256 - | Bls _ -> Bls + | Bls _ -> Bls_aug in let apply_specified_options counter op = Annotated_manager_operation.set_source source op >>? fun op -> diff --git a/src/proto_016_PtMumbai/lib_client_commands/dune b/src/proto_016_PtMumbai/lib_client_commands/dune index 2eb84a3959c70f8e70fe5678564f6834ffb134d3..1eab35b023c28b602f6983fecdc19ca3e6882d8d 100644 --- a/src/proto_016_PtMumbai/lib_client_commands/dune +++ b/src/proto_016_PtMumbai/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_016_PtMumbai/lib_parameters/dune b/src/proto_016_PtMumbai/lib_parameters/dune index 82dcf16996a014be4269f092a9a8960336e1b1f4..0b678d82f962c4990bfa171faa2579ccf4343a3b 100644 --- a/src/proto_016_PtMumbai/lib_parameters/dune +++ b/src/proto_016_PtMumbai/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_016_PtMumbai/lib_plugin/dune b/src/proto_016_PtMumbai/lib_plugin/dune index 827678002475f0acbb27ba5d3021e08aa0c1a610..690af8553c3d8d452034b7b16c351f21633b4f64 100644 --- a/src/proto_016_PtMumbai/lib_plugin/dune +++ b/src/proto_016_PtMumbai/lib_plugin/dune @@ -24,7 +24,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_016_PtMumbai_registerer) diff --git a/src/proto_017_PtNairob/lib_client/dune b/src/proto_017_PtNairob/lib_client/dune index 8151f63434a5b72b98ad3d47c2a10f6a99ea49e3..8ce4c99d57aaa99198c3e7db09383ff2ba755b11 100644 --- a/src/proto_017_PtNairob/lib_client/dune +++ b/src/proto_017_PtNairob/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_017_PtNairob/lib_client/injection.ml b/src/proto_017_PtNairob/lib_client/injection.ml index 414721d1e925991bc19c11b740a31dcbc711b1f7..f409d0e437aed740cad9d36c5d6ee3b1b22b3337 100644 --- a/src/proto_017_PtNairob/lib_client/injection.ml +++ b/src/proto_017_PtNairob/lib_client/injection.ml @@ -602,7 +602,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_017_PtNairob/lib_client_commands/dune b/src/proto_017_PtNairob/lib_client_commands/dune index ad8ebfc541ee0401e04ddad99dfe4f8fc0f83a58..957288e26e0e3c71acba0d97ae1a2835f22a1fee 100644 --- a/src/proto_017_PtNairob/lib_client_commands/dune +++ b/src/proto_017_PtNairob/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_017_PtNairob/lib_parameters/dune b/src/proto_017_PtNairob/lib_parameters/dune index 084f13d2bce536f3c7e123af8527f7a9f2cf129e..a995a2c38621fa68fded39bbaba82cc82a0f366e 100644 --- a/src/proto_017_PtNairob/lib_parameters/dune +++ b/src/proto_017_PtNairob/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_017_PtNairob/lib_plugin/dune b/src/proto_017_PtNairob/lib_plugin/dune index f385fd162cb2c14bd79fbc614b8c9ad48bec4e23..b6f02352382f9a9e2ee36ba6f7d29da62f1b3ac3 100644 --- a/src/proto_017_PtNairob/lib_plugin/dune +++ b/src/proto_017_PtNairob/lib_plugin/dune @@ -24,7 +24,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_017_PtNairob_registerer) diff --git a/src/proto_017_PtNairob/lib_sc_rollup_node/dune b/src/proto_017_PtNairob/lib_sc_rollup_node/dune index f12335716415da88eef2705bb3fa2b752bdd7bb4..1f30849f8fd418ffe8a1ac2beab7c24cd1238169 100644 --- a/src/proto_017_PtNairob/lib_sc_rollup_node/dune +++ b/src/proto_017_PtNairob/lib_sc_rollup_node/dune @@ -77,4 +77,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_018_Proxford/lib_client/dune b/src/proto_018_Proxford/lib_client/dune index d1c056a7b12a13c9a416068e32adff71a3195bac..b29ecb9755ec43553f20c9a224cc26c484a29aaa 100644 --- a/src/proto_018_Proxford/lib_client/dune +++ b/src/proto_018_Proxford/lib_client/dune @@ -49,4 +49,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_018_Proxford/lib_client/injection.ml b/src/proto_018_Proxford/lib_client/injection.ml index 96bbaa97fe0638ec155b8711c25f62f7878b16e6..6c3bc1504408d4abfb87e81699c12b4dd42e87d1 100644 --- a/src/proto_018_Proxford/lib_client/injection.ml +++ b/src/proto_018_Proxford/lib_client/injection.ml @@ -622,7 +622,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_018_Proxford/lib_client_commands/dune b/src/proto_018_Proxford/lib_client_commands/dune index 9897cb663f3e438d054baa6411f1ad3f3e459bed..6877dab73c0a00e0fa7f83f571506e5cc809a910 100644 --- a/src/proto_018_Proxford/lib_client_commands/dune +++ b/src/proto_018_Proxford/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_018_Proxford/lib_parameters/dune b/src/proto_018_Proxford/lib_parameters/dune index 4d645024d982e0c3668f9a9aab56bef664e30d8b..4e2bec31d96079905135ca566804d63f3bdef590 100644 --- a/src/proto_018_Proxford/lib_parameters/dune +++ b/src/proto_018_Proxford/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_018_Proxford/lib_plugin/dune b/src/proto_018_Proxford/lib_plugin/dune index 63d7d4e6f0db4a2977e0d58ef7780d6b1f075246..ad055b64fcbe44d6e6896c900b1b9bbf09c2c8ed 100644 --- a/src/proto_018_Proxford/lib_plugin/dune +++ b/src/proto_018_Proxford/lib_plugin/dune @@ -24,7 +24,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_018_Proxford_registerer) diff --git a/src/proto_018_Proxford/lib_sc_rollup_node/dune b/src/proto_018_Proxford/lib_sc_rollup_node/dune index 66bbc57edddd56a8a6cf3d0e3645e1a7733e35e7..5432088338cff680ec746e971adef7f30fe227a8 100644 --- a/src/proto_018_Proxford/lib_sc_rollup_node/dune +++ b/src/proto_018_Proxford/lib_sc_rollup_node/dune @@ -77,4 +77,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_019_PtParisB/lib_client/dune b/src/proto_019_PtParisB/lib_client/dune index d7ae5a34a628031c6d77bb8c8e13edd427934626..d7ceb82931d8c8643e85356e959734d42bc089b3 100644 --- a/src/proto_019_PtParisB/lib_client/dune +++ b/src/proto_019_PtParisB/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_019_PtParisB/lib_client/injection.ml b/src/proto_019_PtParisB/lib_client/injection.ml index 2fa804d9bea3c7874b4a0ca73c83cd107ae96315..219621b838809588ca79ee0cfed53ad83b2e8eba 100644 --- a/src/proto_019_PtParisB/lib_client/injection.ml +++ b/src/proto_019_PtParisB/lib_client/injection.ml @@ -618,7 +618,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_019_PtParisB/lib_client_commands/dune b/src/proto_019_PtParisB/lib_client_commands/dune index a87368b989d401515ffe8ba3463a2e9cea5fbf77..cf7ff05b4ccbaf63a57a5fc2a1d1521ca18a4282 100644 --- a/src/proto_019_PtParisB/lib_client_commands/dune +++ b/src/proto_019_PtParisB/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_019_PtParisB/lib_parameters/dune b/src/proto_019_PtParisB/lib_parameters/dune index 16ee09d2ecb79454cdd32bdb8111dab739c8f39f..a98e6a8628ccc5a0e8d4042c30783b2c310f7c2d 100644 --- a/src/proto_019_PtParisB/lib_parameters/dune +++ b/src/proto_019_PtParisB/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_019_PtParisB/lib_plugin/dune b/src/proto_019_PtParisB/lib_plugin/dune index 379c5deee4d81cddead5e1b67836fb04e0993ed2..9030b66bc9400fa40384aebcb6276478a3d9cc83 100644 --- a/src/proto_019_PtParisB/lib_plugin/dune +++ b/src/proto_019_PtParisB/lib_plugin/dune @@ -23,7 +23,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_019_PtParisB_registerer) diff --git a/src/proto_019_PtParisB/lib_sc_rollup_node/dune b/src/proto_019_PtParisB/lib_sc_rollup_node/dune index 126a9107284105dc34d7ed45ef9900b51bc4a0b8..cad0b5fb31e4df4fbfa0f2621acb655cc2f13fa9 100644 --- a/src/proto_019_PtParisB/lib_sc_rollup_node/dune +++ b/src/proto_019_PtParisB/lib_sc_rollup_node/dune @@ -76,4 +76,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_020_PsParisC/lib_client/dune b/src/proto_020_PsParisC/lib_client/dune index 880f420f3f471c87d1c98e344553e2a363850d33..e108b1737340e839ce88135fd3db11e6b2819b1f 100644 --- a/src/proto_020_PsParisC/lib_client/dune +++ b/src/proto_020_PsParisC/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_020_PsParisC/lib_client/injection.ml b/src/proto_020_PsParisC/lib_client/injection.ml index 2fa804d9bea3c7874b4a0ca73c83cd107ae96315..219621b838809588ca79ee0cfed53ad83b2e8eba 100644 --- a/src/proto_020_PsParisC/lib_client/injection.ml +++ b/src/proto_020_PsParisC/lib_client/injection.ml @@ -618,7 +618,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_020_PsParisC/lib_client_commands/dune b/src/proto_020_PsParisC/lib_client_commands/dune index 8fda293b9f418c7d21967af3245e5e1ff773dff3..829ccdbf55154d802c3af204785e17b51aad668f 100644 --- a/src/proto_020_PsParisC/lib_client_commands/dune +++ b/src/proto_020_PsParisC/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_020_PsParisC/lib_parameters/dune b/src/proto_020_PsParisC/lib_parameters/dune index 944c599acf9cdccabdc26a05455223424aec009e..ee5a59f688902013c549f2fc4b1121780da097a0 100644 --- a/src/proto_020_PsParisC/lib_parameters/dune +++ b/src/proto_020_PsParisC/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_020_PsParisC/lib_plugin/dune b/src/proto_020_PsParisC/lib_plugin/dune index 4111fad4ab52fba9074068a3cb646f964444add3..731efa6baf0816c6a9bff07c8002de5a403d8b2e 100644 --- a/src/proto_020_PsParisC/lib_plugin/dune +++ b/src/proto_020_PsParisC/lib_plugin/dune @@ -23,7 +23,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_020_PsParisC_registerer) diff --git a/src/proto_020_PsParisC/lib_sc_rollup_node/dune b/src/proto_020_PsParisC/lib_sc_rollup_node/dune index 6ab5832a816f210c27c4ff8c0d8b112dc816ab89..feafb2e0d3455d2249f7cf4252a91b65cae9919d 100644 --- a/src/proto_020_PsParisC/lib_sc_rollup_node/dune +++ b/src/proto_020_PsParisC/lib_sc_rollup_node/dune @@ -76,4 +76,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_benchmark/michelson_samplers_base.ml b/src/proto_021_PsQuebec/lib_benchmark/michelson_samplers_base.ml index 651a385016bf6beb466c9ba04d328fe2fb0d77d2..f9be340208357e1d54b8f064abe600d1c64dc167 100644 --- a/src/proto_021_PsQuebec/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_021_PsQuebec/lib_benchmark/michelson_samplers_base.ml @@ -101,7 +101,7 @@ end) : S = struct | 3 -> (* BLS checks that signatures are on the curve so we need to generate real ones by signing a message. *) - let open Tezos_crypto.Signature.Bls in + let open Tezos_crypto.Signature.Bls_aug in let msg = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let _, _, sk = generate_key ~seed () in diff --git a/src/proto_021_PsQuebec/lib_benchmarks_proto/dune b/src/proto_021_PsQuebec/lib_benchmarks_proto/dune index d8ea8515999d2672e2240b0b4e3ec554227d8266..4431ecf07dcd55efa3825e67bbc867bdcca32934 100644 --- a/src/proto_021_PsQuebec/lib_benchmarks_proto/dune +++ b/src/proto_021_PsQuebec/lib_benchmarks_proto/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_benchmarks_proto/interpreter_workload.ml b/src/proto_021_PsQuebec/lib_benchmarks_proto/interpreter_workload.ml index c7c16d355f913efd36cb3ce008a4efe196719529..d18e6316cbd66597ab7fadbd33e44948f3806d9d 100644 --- a/src/proto_021_PsQuebec/lib_benchmarks_proto/interpreter_workload.ml +++ b/src/proto_021_PsQuebec/lib_benchmarks_proto/interpreter_workload.ml @@ -1460,8 +1460,8 @@ let extract_ir_sized_step : let message = Size.bytes message in Instructions.check_signature_p256 pk signature message | Signature.Bls pk -> - let pk = Size.of_int (Signature.Bls.Public_key.size pk) in - let signature = Size.of_int Signature.Bls.size in + let pk = Size.of_int (Signature.Bls_aug.Public_key.size pk) in + let signature = Size.of_int Signature.Bls_aug.size in let message = Size.bytes message in Instructions.check_signature_bls pk signature message) | IHash_key (_, _), _ -> Instructions.hash_key diff --git a/src/proto_021_PsQuebec/lib_client/dune b/src/proto_021_PsQuebec/lib_client/dune index 761ef6a9a5e0eb67d7861033738761bdacd8b4b2..159cf54aac8b493aa159dc822c380039e93e7b8c 100644 --- a/src/proto_021_PsQuebec/lib_client/dune +++ b/src/proto_021_PsQuebec/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_client/injection.ml b/src/proto_021_PsQuebec/lib_client/injection.ml index 2cd1e3948871b282e91b8e320a2e621ebad844b0..0644eeeae20f42c647f508e29b291861616787e0 100644 --- a/src/proto_021_PsQuebec/lib_client/injection.ml +++ b/src/proto_021_PsQuebec/lib_client/injection.ml @@ -619,7 +619,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_021_PsQuebec/lib_client_commands/dune b/src/proto_021_PsQuebec/lib_client_commands/dune index 516dbb13792ae62515ccca791e0dced22e31200f..211a85a63407f43f84369739e6c41b9caaf9b9fd 100644 --- a/src/proto_021_PsQuebec/lib_client_commands/dune +++ b/src/proto_021_PsQuebec/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_021_PsQuebec/lib_dal/dune b/src/proto_021_PsQuebec/lib_dal/dune index e274b93973413ea5e6d5928cf8b8c62dcfe6636a..7a485c425783bdb8868243150708d82d81cbeee7 100644 --- a/src/proto_021_PsQuebec/lib_dal/dune +++ b/src/proto_021_PsQuebec/lib_dal/dune @@ -42,4 +42,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_delegate/dune b/src/proto_021_PsQuebec/lib_delegate/dune index 264a9f9b1bec53a00493fd1daefc6f3ced2e0b1a..039dd9df8323f2f9b514d4806f7ad671f2002447 100644 --- a/src/proto_021_PsQuebec/lib_delegate/dune +++ b/src/proto_021_PsQuebec/lib_delegate/dune @@ -58,7 +58,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib/dune b/src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib/dune index 5b97211d170fb2822bf06f528bd8b0e2ca04c582..7738914199b638189c252cc43f48b014ed70cb33 100644 --- a/src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib/dune +++ b/src/proto_021_PsQuebec/lib_delegate/test/tenderbrute/lib/dune @@ -25,4 +25,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_injector/dune b/src/proto_021_PsQuebec/lib_injector/dune index caa994288e29c89c8c18141bf8c6c0ee2f00d4d1..d875b554b155ad745047093cec2b24e3fb1f5a60 100644 --- a/src/proto_021_PsQuebec/lib_injector/dune +++ b/src/proto_021_PsQuebec/lib_injector/dune @@ -31,4 +31,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_parameters/dune b/src/proto_021_PsQuebec/lib_parameters/dune index 8e522ecf12f97fefecbd830e664663787083498f..a4b104936f0501551009b13b5c65bd85e80287f9 100644 --- a/src/proto_021_PsQuebec/lib_parameters/dune +++ b/src/proto_021_PsQuebec/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_021_PsQuebec/lib_plugin/dune b/src/proto_021_PsQuebec/lib_plugin/dune index 365cb65412b9ed2757a6e3b0fc557723f926fa73..9b5b4cd4233b5079314308d0547e0f8434c6865d 100644 --- a/src/proto_021_PsQuebec/lib_plugin/dune +++ b/src/proto_021_PsQuebec/lib_plugin/dune @@ -23,7 +23,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_021_PsQuebec_registerer) diff --git a/src/proto_021_PsQuebec/lib_protocol/test/helpers/dune b/src/proto_021_PsQuebec/lib_protocol/test/helpers/dune index 9f062a78655e2e27e061547a9f7c20d0daa2f762..f777ee746f9b6e209d32140644f07041cbf93cd1 100644 --- a/src/proto_021_PsQuebec/lib_protocol/test/helpers/dune +++ b/src/proto_021_PsQuebec/lib_protocol/test/helpers/dune @@ -43,4 +43,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_protocol/test/helpers/operation_generator.ml b/src/proto_021_PsQuebec/lib_protocol/test/helpers/operation_generator.ml index 587f3f109276bb1a6eb3ab7675569ef0ff1f173e..e8c60d98401d9c14829305e4eee6ddbb30cd3439 100644 --- a/src/proto_021_PsQuebec/lib_protocol/test/helpers/operation_generator.ml +++ b/src/proto_021_PsQuebec/lib_protocol/test/helpers/operation_generator.ml @@ -167,8 +167,8 @@ let random_tz3 = let random_tz4 = let open QCheck2.Gen in - let+ str = string_size (pure Signature.Bls.Public_key_hash.size) in - (Bls (Signature.Bls.Public_key_hash.of_string_exn str) : public_key_hash) + let+ str = string_size (pure Signature.Bls_aug.Public_key_hash.size) in + (Bls (Signature.Bls_aug.Public_key_hash.of_string_exn str) : public_key_hash) let random_pkh = let open QCheck2.Gen in @@ -214,7 +214,7 @@ let random_signature = of_ed25519 Signature.Ed25519.zero; of_secp256k1 Signature.Secp256k1.zero; of_p256 Signature.P256.zero; - of_bls Signature.Bls.zero; + of_bls Signature.Bls_aug.zero; Unknown (Bytes.make 64 '\000'); ] () diff --git a/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_consensus_key.ml index 4e94607cb0a67057e351d2b1119d44646bff1fc8..863b96d44668b4a6bf2d5083140595092e548603 100644 --- a/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -228,7 +228,7 @@ let test_tz4_consensus_key () = Environment.Ecoproto_error (Delegate_consensus_key.Invalid_consensus_key_update_tz4 pk); ] - when Signature.Bls.Public_key.(pk = tz4_pk) -> + when Signature.Bls_aug.Public_key.(pk = tz4_pk) -> return_unit | err -> failwith diff --git a/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_delegation.ml index 9b04edc2bf673ef82c5e9eeabb4a03ac29aac2d8..7c4e225d7d5467dd4caf0a076fd9ba974371b177 100644 --- a/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_021_PsQuebec/lib_protocol/test/integration/consensus/test_delegation.ml @@ -1575,7 +1575,7 @@ let test_bls_account_cannot_self_delegate () = Environment.Ecoproto_error (Contract_delegate_storage.Forbidden_tz4_delegate pkh); ] - when Signature.Bls.Public_key_hash.(pkh = tz4_pkh) -> + when Signature.Bls_aug.Public_key_hash.(pkh = tz4_pkh) -> return_unit | err -> failwith diff --git a/src/proto_021_PsQuebec/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_021_PsQuebec/lib_protocol/test/unit/test_operation_repr.ml index 5785fa0c540621457055563f7a9f5b13b1b5732c..420014cf08fcb5046a274934f1a03721cd8889b2 100644 --- a/src/proto_021_PsQuebec/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_021_PsQuebec/lib_protocol/test/unit/test_operation_repr.ml @@ -96,7 +96,7 @@ module Test_operation_repr = struct | Error _ -> return_unit let zero_bls = - match Signature.(split_signature (Bls Signature.Bls.zero)) with + match Signature.(split_signature (Bls Signature.Bls_aug.zero)) with | {prefix = None; _} -> assert false | {prefix = Some prefix; suffix} -> let prefix = diff --git a/src/proto_021_PsQuebec/lib_sc_rollup_node/dune b/src/proto_021_PsQuebec/lib_sc_rollup_node/dune index 1c4c6b4d119d0bff927899fdb1d8b1c977f02ed6..eb0eb5146a8a3ccfd9642f6ecdcfbb458c0137b1 100644 --- a/src/proto_021_PsQuebec/lib_sc_rollup_node/dune +++ b/src/proto_021_PsQuebec/lib_sc_rollup_node/dune @@ -79,4 +79,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_021_PsQuebec/lib_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_021_PsQuebec/lib_sc_rollup_node/test/test_octez_conversions.ml index ba6e0c7c646a79093f658c6a3e78e63fb3c5b9e4..f2dded7bdef84abc2212ff1e164166556635a352 100644 --- a/src/proto_021_PsQuebec/lib_sc_rollup_node/test/test_octez_conversions.ml +++ b/src/proto_021_PsQuebec/lib_sc_rollup_node/test/test_octez_conversions.ml @@ -119,7 +119,7 @@ let random_algo ~rng_state : Signature.algo = | _ -> assert false let gen_algo = - QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls] + QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls_aug] let gen_pkh = let open QCheck2.Gen in diff --git a/src/proto_alpha/lib_benchmark/michelson_samplers_base.ml b/src/proto_alpha/lib_benchmark/michelson_samplers_base.ml index 651a385016bf6beb466c9ba04d328fe2fb0d77d2..f9be340208357e1d54b8f064abe600d1c64dc167 100644 --- a/src/proto_alpha/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_alpha/lib_benchmark/michelson_samplers_base.ml @@ -101,7 +101,7 @@ end) : S = struct | 3 -> (* BLS checks that signatures are on the curve so we need to generate real ones by signing a message. *) - let open Tezos_crypto.Signature.Bls in + let open Tezos_crypto.Signature.Bls_aug in let msg = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let _, _, sk = generate_key ~seed () in diff --git a/src/proto_alpha/lib_benchmarks_proto/dune b/src/proto_alpha/lib_benchmarks_proto/dune index 1f7fd4dd2cd4dd1c167a17dfab7fe1a230a37765..49c990be9ef044b198566be8f3208ecee7d46cd2 100644 --- a/src/proto_alpha/lib_benchmarks_proto/dune +++ b/src/proto_alpha/lib_benchmarks_proto/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_benchmarks_proto/interpreter_workload.ml b/src/proto_alpha/lib_benchmarks_proto/interpreter_workload.ml index c7c16d355f913efd36cb3ce008a4efe196719529..d18e6316cbd66597ab7fadbd33e44948f3806d9d 100644 --- a/src/proto_alpha/lib_benchmarks_proto/interpreter_workload.ml +++ b/src/proto_alpha/lib_benchmarks_proto/interpreter_workload.ml @@ -1460,8 +1460,8 @@ let extract_ir_sized_step : let message = Size.bytes message in Instructions.check_signature_p256 pk signature message | Signature.Bls pk -> - let pk = Size.of_int (Signature.Bls.Public_key.size pk) in - let signature = Size.of_int Signature.Bls.size in + let pk = Size.of_int (Signature.Bls_aug.Public_key.size pk) in + let signature = Size.of_int Signature.Bls_aug.size in let message = Size.bytes message in Instructions.check_signature_bls pk signature message) | IHash_key (_, _), _ -> Instructions.hash_key diff --git a/src/proto_alpha/lib_client/dune b/src/proto_alpha/lib_client/dune index b609baa80d6211c1518be1c27e6ad281bcf00572..a6f90f08bf78e9da481784ae9c8dd7f0f32986b0 100644 --- a/src/proto_alpha/lib_client/dune +++ b/src/proto_alpha/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml index 2cd1e3948871b282e91b8e320a2e621ebad844b0..0644eeeae20f42c647f508e29b291861616787e0 100644 --- a/src/proto_alpha/lib_client/injection.ml +++ b/src/proto_alpha/lib_client/injection.ml @@ -619,7 +619,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_alpha/lib_client_commands/dune b/src/proto_alpha/lib_client_commands/dune index 5f6379ca6229e27e62694b9a6e059a54bca5ee33..75ff918c1fe0153bd48e049ac953945071d74278 100644 --- a/src/proto_alpha/lib_client_commands/dune +++ b/src/proto_alpha/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_alpha/lib_dal/dune b/src/proto_alpha/lib_dal/dune index 93d502ab07d83c9313e76df8b3435d1baf888600..23cc3edbe6ee065bc35531a5227c0a7704329ca3 100644 --- a/src/proto_alpha/lib_dal/dune +++ b/src/proto_alpha/lib_dal/dune @@ -42,4 +42,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_delegate/dune b/src/proto_alpha/lib_delegate/dune index 1f629c21bad35e1931de64537219419127f0f00d..5ee936b1de7c4dfbb4e9aa0a9a2362bae493e1ae 100644 --- a/src/proto_alpha/lib_delegate/dune +++ b/src/proto_alpha/lib_delegate/dune @@ -58,7 +58,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune b/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune index 1754a62aeb67fb498f29ac80bb149c00afcf18cf..a9dd124d7e9311d7412633b6b107d5fb2113f223 100644 --- a/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune +++ b/src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune @@ -25,4 +25,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_injector/dune b/src/proto_alpha/lib_injector/dune index b25f426e01871379a23eef63c0d411e66910b784..c787cbcc09902d51bdd8d3119f16ad1e646ec11b 100644 --- a/src/proto_alpha/lib_injector/dune +++ b/src/proto_alpha/lib_injector/dune @@ -31,4 +31,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_parameters/dune b/src/proto_alpha/lib_parameters/dune index d16d636f906c3792985d674267459d4147dee06f..1d511b572382c7b77ff4d0dbc6678d64b2e67125 100644 --- a/src/proto_alpha/lib_parameters/dune +++ b/src/proto_alpha/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_alpha/lib_plugin/dune b/src/proto_alpha/lib_plugin/dune index eaba3e58437ef30948c00f89396b4677d38306ab..ea6dc08c60a885a4f2abd07dec479e0367c90695 100644 --- a/src/proto_alpha/lib_plugin/dune +++ b/src/proto_alpha/lib_plugin/dune @@ -23,7 +23,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_alpha_registerer) diff --git a/src/proto_alpha/lib_protocol/test/helpers/dune b/src/proto_alpha/lib_protocol/test/helpers/dune index 9a67c96dbb94ad70efd7587845143c57ab15f110..e97e8678e8056e073086e9e4e7fd0804152e1079 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/dune +++ b/src/proto_alpha/lib_protocol/test/helpers/dune @@ -43,4 +43,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml b/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml index 9983d8ba88ebd947197ec4f0d3ba9fcad18211e2..0e2f77e32de6ad10e41f8eb56a0b0a1cb30b9d5f 100644 --- a/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml +++ b/src/proto_alpha/lib_protocol/test/helpers/operation_generator.ml @@ -167,8 +167,8 @@ let random_tz3 = let random_tz4 = let open QCheck2.Gen in - let+ str = string_size (pure Signature.Bls.Public_key_hash.size) in - (Bls (Signature.Bls.Public_key_hash.of_string_exn str) : public_key_hash) + let+ str = string_size (pure Signature.Bls_aug.Public_key_hash.size) in + (Bls (Signature.Bls_aug.Public_key_hash.of_string_exn str) : public_key_hash) let random_pkh = let open QCheck2.Gen in @@ -214,7 +214,7 @@ let random_signature = of_ed25519 Signature.Ed25519.zero; of_secp256k1 Signature.Secp256k1.zero; of_p256 Signature.P256.zero; - of_bls Signature.Bls.zero; + of_bls Signature.Bls_aug.zero; Unknown (Bytes.make 64 '\000'); ] () diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml index d1bc78724013ccf576c6c88247774ca093b8901e..4b34ea5ffcd4fd4cf5a7ad9c7946c560a679e3fd 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -295,7 +295,7 @@ let test_tz4_consensus_key ~allow_tz4_delegate_enable () = Environment.Ecoproto_error (Delegate_consensus_key.Invalid_consensus_key_update_tz4 pk); ] - when Signature.Bls.Public_key.(pk = tz4_pk) -> + when Signature.Bls_aug.Public_key.(pk = tz4_pk) -> return_unit | err -> failwith diff --git a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml index 61abdc28a029930bad35229c709f159c9c12d100..823913dfe20cdc6d174a56c4b052f9d1263fbaf1 100644 --- a/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_alpha/lib_protocol/test/integration/consensus/test_delegation.ml @@ -1583,7 +1583,7 @@ let test_bls_account_self_delegate ~allow_tz4_delegate_enable () = Environment.Ecoproto_error (Contract_delegate_storage.Forbidden_tz4_delegate pkh); ] - when Signature.Bls.Public_key_hash.(pkh = tz4_pkh) -> + when Signature.Bls_aug.Public_key_hash.(pkh = tz4_pkh) -> return_unit | err -> failwith diff --git a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml index 688e77036497a96d96480bcab7bceb6abffaa9e4..ff4731b53c0bab7ce5ecd28e134f998e0bef0d0b 100644 --- a/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_alpha/lib_protocol/test/unit/test_operation_repr.ml @@ -96,7 +96,7 @@ module Test_operation_repr = struct | Error _ -> return_unit let zero_bls = - match Signature.(split_signature (Bls Signature.Bls.zero)) with + match Signature.(split_signature (Bls Signature.Bls_aug.zero)) with | {prefix = None; _} -> assert false | {prefix = Some prefix; suffix} -> let prefix = diff --git a/src/proto_alpha/lib_sc_rollup_node/dune b/src/proto_alpha/lib_sc_rollup_node/dune index 556fb5d8266278d2d22ccbe7766c56f21fcfe21a..a341906fa2b36d2f8eafc37ed5861e0c8f4d2bb5 100644 --- a/src/proto_alpha/lib_sc_rollup_node/dune +++ b/src/proto_alpha/lib_sc_rollup_node/dune @@ -79,4 +79,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml index 8e8b1de49f4d057330e486c72705061d30c5e6e4..0ca3339ea0a680f1a220dad8b7b241fd1fe35169 100644 --- a/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml +++ b/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml @@ -119,7 +119,7 @@ let random_algo ~rng_state : Signature.algo = | _ -> assert false let gen_algo = - QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls] + QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls_aug] let gen_pkh = let open QCheck2.Gen in diff --git a/src/proto_next/lib_benchmark/michelson_samplers_base.ml b/src/proto_next/lib_benchmark/michelson_samplers_base.ml index 651a385016bf6beb466c9ba04d328fe2fb0d77d2..f9be340208357e1d54b8f064abe600d1c64dc167 100644 --- a/src/proto_next/lib_benchmark/michelson_samplers_base.ml +++ b/src/proto_next/lib_benchmark/michelson_samplers_base.ml @@ -101,7 +101,7 @@ end) : S = struct | 3 -> (* BLS checks that signatures are on the curve so we need to generate real ones by signing a message. *) - let open Tezos_crypto.Signature.Bls in + let open Tezos_crypto.Signature.Bls_aug in let msg = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let seed = Base_samplers.uniform_bytes ~nbytes:32 rng_state in let _, _, sk = generate_key ~seed () in diff --git a/src/proto_next/lib_benchmarks_proto/dune b/src/proto_next/lib_benchmarks_proto/dune index 12f19f8c36cb8701cd008991da03a72537edb4f4..ce84ef0e8974cd3bb81478472861ae4466d8bea5 100644 --- a/src/proto_next/lib_benchmarks_proto/dune +++ b/src/proto_next/lib_benchmarks_proto/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_benchmarks_proto/interpreter_workload.ml b/src/proto_next/lib_benchmarks_proto/interpreter_workload.ml index c7c16d355f913efd36cb3ce008a4efe196719529..d18e6316cbd66597ab7fadbd33e44948f3806d9d 100644 --- a/src/proto_next/lib_benchmarks_proto/interpreter_workload.ml +++ b/src/proto_next/lib_benchmarks_proto/interpreter_workload.ml @@ -1460,8 +1460,8 @@ let extract_ir_sized_step : let message = Size.bytes message in Instructions.check_signature_p256 pk signature message | Signature.Bls pk -> - let pk = Size.of_int (Signature.Bls.Public_key.size pk) in - let signature = Size.of_int Signature.Bls.size in + let pk = Size.of_int (Signature.Bls_aug.Public_key.size pk) in + let signature = Size.of_int Signature.Bls_aug.size in let message = Size.bytes message in Instructions.check_signature_bls pk signature message) | IHash_key (_, _), _ -> Instructions.hash_key diff --git a/src/proto_next/lib_client/dune b/src/proto_next/lib_client/dune index fc5b2b58855ffa15f86833160bda4249e02262a8..452c854b476d2341cfffdbb2d328a3b73b150e7d 100644 --- a/src/proto_next/lib_client/dune +++ b/src/proto_next/lib_client/dune @@ -48,4 +48,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_client/injection.ml b/src/proto_next/lib_client/injection.ml index 2cd1e3948871b282e91b8e320a2e621ebad844b0..0644eeeae20f42c647f508e29b291861616787e0 100644 --- a/src/proto_next/lib_client/injection.ml +++ b/src/proto_next/lib_client/injection.ml @@ -619,7 +619,7 @@ let signature_size_of_algo : Signature.algo -> int = function | Bls -> (* BLS signatures in operations are encoded with 2 extra bytes: a [ff] prefix and a tag [03]. *) - Signature.Bls.size + 2 + Signature.Bls_aug.size + 2 (* This value is used as a safety guard for gas limit. *) let default_safety_guard = Gas.Arith.(integral_of_int_exn 100) diff --git a/src/proto_next/lib_client_commands/dune b/src/proto_next/lib_client_commands/dune index 515ae070e15b560844d68ef640f621595e43ea06..551867baa18d2fca3dd30764836f699abd59f193 100644 --- a/src/proto_next/lib_client_commands/dune +++ b/src/proto_next/lib_client_commands/dune @@ -43,7 +43,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_next/lib_dal/dune b/src/proto_next/lib_dal/dune index 04cae27df5eb603dacad00d763f99f30b5034158..dbb5a19ff65871bc11ff625465ba98ca471f0f1c 100644 --- a/src/proto_next/lib_dal/dune +++ b/src/proto_next/lib_dal/dune @@ -42,4 +42,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_delegate/dune b/src/proto_next/lib_delegate/dune index 5c151d3aa36ecc46334f2f07f7773b7baff7609d..597ea9e0b59e80337c754c72aec813905e1544a9 100644 --- a/src/proto_next/lib_delegate/dune +++ b/src/proto_next/lib_delegate/dune @@ -58,7 +58,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (rule (targets client_keys.ml) diff --git a/src/proto_next/lib_delegate/test/tenderbrute/lib/dune b/src/proto_next/lib_delegate/test/tenderbrute/lib/dune index 041a19c241fd68e9dbfa91826da2f06e4de114ae..f28d801b692453dbab581ea13bc6ba5313c74e58 100644 --- a/src/proto_next/lib_delegate/test/tenderbrute/lib/dune +++ b/src/proto_next/lib_delegate/test/tenderbrute/lib/dune @@ -25,4 +25,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_injector/dune b/src/proto_next/lib_injector/dune index e6393948ef7e186597d2f88a9032c04e46da174b..63309c66e1e7b6e8483a724a43c41ebc47cafc0c 100644 --- a/src/proto_next/lib_injector/dune +++ b/src/proto_next/lib_injector/dune @@ -31,4 +31,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_parameters/dune b/src/proto_next/lib_parameters/dune index 18865fdeedcae376fd7961100665373bd6bb6fa3..3faa8f9c9617cd15f08a11c63248b2f4028c0b99 100644 --- a/src/proto_next/lib_parameters/dune +++ b/src/proto_next/lib_parameters/dune @@ -21,7 +21,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (executable (name gen) diff --git a/src/proto_next/lib_plugin/dune b/src/proto_next/lib_plugin/dune index d287a0c5dd5ef57d02e52bcb0f661215e90a9513..2ae6ee4626d23096645a2dd4358de7ba6a3c9dc7 100644 --- a/src/proto_next/lib_plugin/dune +++ b/src/proto_next/lib_plugin/dune @@ -23,7 +23,7 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) (library (name tezos_protocol_plugin_next_registerer) diff --git a/src/proto_next/lib_protocol/test/helpers/dune b/src/proto_next/lib_protocol/test/helpers/dune index 14242d70c6f4c23409381ba6329f11aa00dc6c07..3c80171f55a23e5ec92407ccf8b99308cb81d8ed 100644 --- a/src/proto_next/lib_protocol/test/helpers/dune +++ b/src/proto_next/lib_protocol/test/helpers/dune @@ -43,4 +43,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_protocol/test/helpers/operation_generator.ml b/src/proto_next/lib_protocol/test/helpers/operation_generator.ml index 9983d8ba88ebd947197ec4f0d3ba9fcad18211e2..0e2f77e32de6ad10e41f8eb56a0b0a1cb30b9d5f 100644 --- a/src/proto_next/lib_protocol/test/helpers/operation_generator.ml +++ b/src/proto_next/lib_protocol/test/helpers/operation_generator.ml @@ -167,8 +167,8 @@ let random_tz3 = let random_tz4 = let open QCheck2.Gen in - let+ str = string_size (pure Signature.Bls.Public_key_hash.size) in - (Bls (Signature.Bls.Public_key_hash.of_string_exn str) : public_key_hash) + let+ str = string_size (pure Signature.Bls_aug.Public_key_hash.size) in + (Bls (Signature.Bls_aug.Public_key_hash.of_string_exn str) : public_key_hash) let random_pkh = let open QCheck2.Gen in @@ -214,7 +214,7 @@ let random_signature = of_ed25519 Signature.Ed25519.zero; of_secp256k1 Signature.Secp256k1.zero; of_p256 Signature.P256.zero; - of_bls Signature.Bls.zero; + of_bls Signature.Bls_aug.zero; Unknown (Bytes.make 64 '\000'); ] () diff --git a/src/proto_next/lib_protocol/test/integration/consensus/test_consensus_key.ml b/src/proto_next/lib_protocol/test/integration/consensus/test_consensus_key.ml index e2217f93eb680308b729c2474703c52a6798b55c..56d72eabdc9b7e4f27aa8b574588dbcf81d86580 100644 --- a/src/proto_next/lib_protocol/test/integration/consensus/test_consensus_key.ml +++ b/src/proto_next/lib_protocol/test/integration/consensus/test_consensus_key.ml @@ -295,7 +295,7 @@ let test_tz4_consensus_key ~allow_tz4_delegate_enable () = Environment.Ecoproto_error (Delegate_consensus_key.Invalid_consensus_key_update_tz4 pk); ] - when Signature.Bls.Public_key.(pk = tz4_pk) -> + when Signature.Bls_aug.Public_key.(pk = tz4_pk) -> return_unit | err -> failwith diff --git a/src/proto_next/lib_protocol/test/integration/consensus/test_delegation.ml b/src/proto_next/lib_protocol/test/integration/consensus/test_delegation.ml index 321511b1a494c58339a19991ad021ee60d932eff..6ade0d05052e263b74cc29d837b8799cd802da54 100644 --- a/src/proto_next/lib_protocol/test/integration/consensus/test_delegation.ml +++ b/src/proto_next/lib_protocol/test/integration/consensus/test_delegation.ml @@ -1583,7 +1583,7 @@ let test_bls_account_self_delegate ~allow_tz4_delegate_enable () = Environment.Ecoproto_error (Contract_delegate_storage.Forbidden_tz4_delegate pkh); ] - when Signature.Bls.Public_key_hash.(pkh = tz4_pkh) -> + when Signature.Bls_aug.Public_key_hash.(pkh = tz4_pkh) -> return_unit | err -> failwith diff --git a/src/proto_next/lib_protocol/test/unit/test_operation_repr.ml b/src/proto_next/lib_protocol/test/unit/test_operation_repr.ml index 0af878d257bcf265d94975a4f5d128c3eb10bf40..437a9bf7d8ab014aabfe801e8e1815d69ce6b9d3 100644 --- a/src/proto_next/lib_protocol/test/unit/test_operation_repr.ml +++ b/src/proto_next/lib_protocol/test/unit/test_operation_repr.ml @@ -96,7 +96,7 @@ module Test_operation_repr = struct | Error _ -> return_unit let zero_bls = - match Signature.(split_signature (Bls Signature.Bls.zero)) with + match Signature.(split_signature (Bls Signature.Bls_aug.zero)) with | {prefix = None; _} -> assert false | {prefix = Some prefix; suffix} -> let prefix = diff --git a/src/proto_next/lib_sc_rollup_node/dune b/src/proto_next/lib_sc_rollup_node/dune index ba0ff371184b8fa550405c7844f8a04e4d29c23d..3e4d3b0674850bab86ac2b296f6d3063b065a905 100644 --- a/src/proto_next/lib_sc_rollup_node/dune +++ b/src/proto_next/lib_sc_rollup_node/dune @@ -79,4 +79,4 @@ (action (write-file %{targets} - " module Bls = Tezos_crypto.Signature.Bls\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) + " module Bls_aug = Tezos_crypto.Signature.Bls_aug\n module Ed25519 = Tezos_crypto.Signature.Ed25519\n module P256 = Tezos_crypto.Signature.P256\n module Secp256k1 = Tezos_crypto.Signature.Secp256k1\n include Tezos_crypto.Signature.V1"))) diff --git a/src/proto_next/lib_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_next/lib_sc_rollup_node/test/test_octez_conversions.ml index b29e542a3dc33daf4617772a7da1039d2e1b18e5..448ac8a148f0062f0daca6273f7b5da1d175af1a 100644 --- a/src/proto_next/lib_sc_rollup_node/test/test_octez_conversions.ml +++ b/src/proto_next/lib_sc_rollup_node/test/test_octez_conversions.ml @@ -119,7 +119,7 @@ let random_algo ~rng_state : Signature.algo = | _ -> assert false let gen_algo = - QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls] + QCheck2.Gen.oneofl [Tezos_crypto.Signature.Ed25519; Secp256k1; P256; Bls_aug] let gen_pkh = let open QCheck2.Gen in