From ed6400390592543d21e4198cd74601cddca6cb3b Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 5 Feb 2025 17:00:18 +0100 Subject: [PATCH 1/5] Crypto: rename bls file in bls_aug --- src/lib_crypto/aggregate_signature.ml | 107 +++++++++++++----------- src/lib_crypto/aggregate_signature.mli | 8 +- src/lib_crypto/{bls.ml => bls_aug.ml} | 0 src/lib_crypto/{bls.mli => bls_aug.mli} | 0 src/lib_crypto/signature_v1.ml | 96 ++++++++++----------- src/lib_crypto/signature_v1.mli | 10 +-- src/lib_crypto/signature_v2.ml | 96 ++++++++++----------- src/lib_crypto/signature_v2.mli | 10 +-- src/lib_crypto/tezos_crypto.ml | 2 +- 9 files changed, 169 insertions(+), 160 deletions(-) rename src/lib_crypto/{bls.ml => bls_aug.ml} (100%) rename src/lib_crypto/{bls.mli => bls_aug.mli} (100%) diff --git a/src/lib_crypto/aggregate_signature.ml b/src/lib_crypto/aggregate_signature.ml index ad5ea65917cf..e48bb3ed2926 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 cd1baeef5d5f..026ecf765d51 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_v1.ml b/src/lib_crypto/signature_v1.ml index a6313b5a6c4c..402cbeff72f1 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 22f1856bc0bc..d58cdbba7ca5 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 4375503a3332..6ca886874e90 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 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 @@ -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 of Bls_aug.Public_key_hash.t let name = "Signature.Public_key_hash" @@ -79,7 +79,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); ] @@ -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 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 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 -> ( @@ -160,7 +160,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 @@ -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 (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 x, Bls 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 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 pk -> Public_key_hash.Bls (Bls_aug.Public_key.hash pk) include Compare.Make (struct type nonrec t = t @@ -275,7 +275,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 @@ -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 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 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 @@ -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 pk)) | _ -> None include Helpers.MakeEncoder (struct @@ -379,7 +380,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); ] @@ -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 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 sk -> Public_key.Bls (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 x, Bls 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 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 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 @@ -505,7 +506,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); ] @@ -528,7 +529,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 @@ -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 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 @@ -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 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 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 = @@ -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); ] @@ -723,7 +725,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} @@ -736,7 +738,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 @@ -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 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 @@ -784,8 +786,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 @@ -794,7 +796,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 = @@ -961,7 +963,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 () = @@ -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 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_v2.mli b/src/lib_crypto/signature_v2.mli index cc9217248cda..15f4738d653d 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 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 @@ -37,7 +37,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 @@ -79,7 +79,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/tezos_crypto.ml b/src/lib_crypto/tezos_crypto.ml index 12b7bdce7d25..55aa38bbe1da 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 = Bls_aug module Ed25519 = Ed25519 module P256 = P256 module Secp256k1 = Secp256k1 -- GitLab From aa7d49f777baf9a710adee1a03064f396ec8b9f6 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 5 Feb 2025 17:26:41 +0100 Subject: [PATCH 2/5] Crypto: explicitly call Bls Bls_aug --- src/lib_client_base/client_keys.ml | 12 +-- src/lib_crypto/signature.ml | 16 ++-- src/lib_crypto/signature_v2.ml | 108 +++++++++++++-------------- src/lib_crypto/signature_v2.mli | 8 +- src/lib_signer_backends/encrypted.ml | 6 +- 5 files changed, 75 insertions(+), 75 deletions(-) diff --git a/src/lib_client_base/client_keys.ml b/src/lib_client_base/client_keys.ml index bb8213e143aa..fd4412e80c00 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_crypto/signature.ml b/src/lib_crypto/signature.ml index ccac7d958a26..f6644977c3ca 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_v2.ml b/src/lib_crypto/signature_v2.ml index 6ca886874e90..bddcf890d72f 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_aug.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_aug.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_aug.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_aug.Public_key_hash.t + | Bls_aug of Bls_aug.Public_key_hash.t let name = "Signature.Public_key_hash" @@ -80,8 +80,8 @@ module Public_key_hash = struct (Tag 3) ~title:"Bls" Bls_aug.Public_key_hash.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + (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_aug.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_aug.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_aug.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_aug.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 -> ( @@ -161,7 +161,7 @@ module Public_key_hash = struct | None -> None) | "bls" :: q -> ( match Bls_aug.Public_key_hash.of_path q with - | Some pkh -> Some (Bls pkh) + | 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_aug.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 *) @@ -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_aug.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_aug.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_aug.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_aug.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_aug.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_aug.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_aug.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 @@ -344,7 +344,7 @@ module Public_key = struct | 3 -> Option.bind (Bls_aug.Public_key.of_bytes_without_validation b) - (fun pk -> Some (Bls pk)) + (fun pk -> Some (Bls_aug pk)) | _ -> None include Helpers.MakeEncoder (struct @@ -381,8 +381,8 @@ module Public_key = struct ~title:"Bls" (Tag 3) Bls_aug.Public_key.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + (function Bls_aug x -> Some x | _ -> None) + (function x -> Bls_aug x); ] let of_b58check = of_b58check @@ -406,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_aug.Secret_key.t + | Bls_aug of Bls_aug.Secret_key.t let name = "Signature.Secret_key" @@ -417,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_aug.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 @@ -427,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_aug.Secret_key.compare x y + | Bls_aug x, Bls_aug y -> Bls_aug.Secret_key.compare x y | _ -> Stdlib.compare a b end) @@ -447,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_aug.Secret_key.Data sk) -> Some (Bls sk) + | Some (Bls_aug.Secret_key.Data sk) -> Some (Bls_aug sk) | _ -> None let of_b58check_exn s = @@ -465,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_aug.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_aug.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 @@ -507,8 +507,8 @@ module Secret_key = struct (Tag 3) ~title:"Bls" Bls_aug.Secret_key.encoding - (function Bls x -> Some x | _ -> None) - (function x -> Bls x); + (function Bls_aug x -> Some x | _ -> None) + (function x -> Bls_aug x); ] let of_b58check = of_b58check @@ -529,7 +529,7 @@ type signature = | Ed25519 of Ed25519.t | Secp256k1 of Secp256k1.t | P256 of P256.t - | Bls of Bls_aug.t + | Bls_aug of Bls_aug.t | Unknown of Bytes.t type prefix = Bls_prefix of Bytes.t @@ -546,13 +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_aug.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_aug.size then - Option.map (fun b -> Bls b) (Bls_aug.of_bytes_opt s) + Option.map (fun b -> Bls_aug b) (Bls_aug.of_bytes_opt s) else if len = Ed25519.size then Some (Unknown s) else None @@ -602,7 +602,7 @@ let 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_aug.b58check_encoding.encoded_prefix s - then Option.map (fun x -> Bls x) (Bls_aug.of_b58check_opt s) + then Option.map (fun x -> Bls_aug x) (Bls_aug.of_b58check_opt s) else Option.map (fun x -> Unknown x) @@ -622,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_aug.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_aug.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 = @@ -696,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 @@ -724,7 +724,7 @@ let prefix_encoding = let split_signature = function | (Ed25519 _ | Secp256k1 _ | P256 _) as s -> {prefix = None; suffix = to_bytes s} - | Bls s -> + | 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 @@ -739,7 +739,7 @@ let of_splitted {prefix; suffix} = | None -> of_bytes_opt suffix | Some (Bls_prefix prefix) -> let+ s = Bls_aug.of_bytes_opt (Bytes.cat prefix suffix) in - Bls s + Bls_aug s let bytes_of_watermark = function | Block_header chain_id -> @@ -768,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_aug.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 @@ -785,7 +785,7 @@ 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 -> ( + | 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) @@ -795,7 +795,7 @@ 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 -> + | Public_key.Bls_aug pk, Bls_aug signature -> Bls_aug.check ?watermark pk signature message | _ -> false @@ -858,7 +858,7 @@ let algo_of_pk (pk : Public_key.t) = | Ed25519 _ -> Ed25519 | Secp256k1 _ -> Secp256k1 | P256 _ -> P256 - | Bls _ -> Bls + | Bls_aug _ -> Bls let fast_fake_sign ?watermark:_ sk _msg = let pk = Secret_key.to_public_key sk in @@ -964,7 +964,7 @@ let generate_key ?(algo = Ed25519) ?seed () = (Public_key_hash.P256 pkh, Public_key.P256 pk, Secret_key.P256 sk) | Bls -> let pkh, pk, sk = Bls_aug.generate_key ?seed () in - (Public_key_hash.Bls pkh, Public_key.Bls pk, Secret_key.Bls sk) + (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 @@ -983,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_aug.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_aug.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 = @@ -1022,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 15f4738d653d..b82652c31521 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_aug.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_aug.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_aug.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_aug.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 diff --git a/src/lib_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index 5ac98b89f231..d40d19a605b4 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -83,7 +83,7 @@ module Raw = struct Data_encoding.Binary.to_bytes_exn Signature.P256.Secret_key.encoding sk - | Decrypted_sk (Bls sk) -> + | Decrypted_sk (Bls_aug sk) -> Data_encoding.Binary.to_bytes_exn Signature.Bls.Secret_key.encoding sk in Bytes.cat salt (Tezos_crypto.Crypto_box.Secretbox.secretbox key msg nonce) @@ -143,7 +143,7 @@ module Raw = struct 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 \ @@ -369,7 +369,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 -- GitLab From b88d0ca12585a64e33912f8087933d6a638d89ef Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 5 Feb 2025 17:47:55 +0100 Subject: [PATCH 3/5] Crypto: explicitly call Bls algo Bls_aug --- .../yes_wallet/test/bench_signature_perf.ml | 12 ++++++------ .../client_keys_commands.ml | 2 +- src/lib_crypto/signature_v2.ml | 18 +++++++++--------- src/lib_crypto/signature_v2.mli | 2 +- src/lib_crypto/test/test_prop_signature.ml | 2 +- src/lib_crypto/test/test_signature.ml | 4 ++-- .../encoding_benchmarks.ml | 4 ++-- src/lib_signer_backends/encrypted.ml | 4 ++-- src/lib_signer_backends/test/test_encrypted.ml | 2 +- src/proto_016_PtMumbai/lib_client/injection.ml | 4 ++-- .../test/test_octez_conversions.ml | 2 +- .../test/test_octez_conversions.ml | 2 +- .../test/test_octez_conversions.ml | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/devtools/yes_wallet/test/bench_signature_perf.ml b/devtools/yes_wallet/test/bench_signature_perf.ml index d1d354de60ee..1af12fa4ea5c 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/src/lib_client_commands/client_keys_commands.ml b/src/lib_client_commands/client_keys_commands.ml index 8ccfb8fd88ba..e40f59fac8ca 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/signature_v2.ml b/src/lib_crypto/signature_v2.ml index bddcf890d72f..4b7d8cda8101 100644 --- a/src/lib_crypto/signature_v2.ml +++ b/src/lib_crypto/signature_v2.ml @@ -810,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 @@ -827,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" @@ -837,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" @@ -849,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_aug _ -> Bls + | Bls_aug _ -> Bls_aug let fast_fake_sign ?watermark:_ sk _msg = let pk = Secret_key.to_public_key sk in @@ -937,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 = @@ -962,7 +962,7 @@ 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 -> + | 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) diff --git a/src/lib_crypto/signature_v2.mli b/src/lib_crypto/signature_v2.mli index b82652c31521..e8d03eefe4b6 100644 --- a/src/lib_crypto/signature_v2.mli +++ b/src/lib_crypto/signature_v2.mli @@ -82,7 +82,7 @@ val of_p256 : P256.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 1e709784c83f..571f12d43163 100644 --- a/src/lib_crypto/test/test_prop_signature.ml +++ b/src/lib_crypto/test/test_prop_signature.ml @@ -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 aae0fda75a2e..b430a05d41aa 100644 --- a/src/lib_crypto/test/test_signature.ml +++ b/src/lib_crypto/test/test_signature.ml @@ -61,7 +61,7 @@ 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 = @@ -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_shell_benchmarks/encoding_benchmarks.ml b/src/lib_shell_benchmarks/encoding_benchmarks.ml index b96d81471940..560064490c32 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 d40d19a605b4..41c9a0a92251 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -135,7 +135,7 @@ 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 @@ -303,7 +303,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 diff --git a/src/lib_signer_backends/test/test_encrypted.ml b/src/lib_signer_backends/test/test_encrypted.ml index 78411f6ca325..4a8975e23871 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/injection.ml b/src/proto_016_PtMumbai/lib_client/injection.ml index 5f7f769a2b89..d3259b1377b9 100644 --- a/src/proto_016_PtMumbai/lib_client/injection.ml +++ b/src/proto_016_PtMumbai/lib_client/injection.ml @@ -635,7 +635,7 @@ 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 @@ -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_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 ba6e0c7c646a..f2dded7bdef8 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_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_alpha/lib_sc_rollup_node/test/test_octez_conversions.ml index 8e8b1de49f4d..0ca3339ea0a6 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_sc_rollup_node/test/test_octez_conversions.ml b/src/proto_next/lib_sc_rollup_node/test/test_octez_conversions.ml index b29e542a3dc3..448ac8a148f0 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 -- GitLab From bc29edbfd6d05edda7a5f409b5173d91b2386172 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Wed, 5 Feb 2025 18:26:04 +0100 Subject: [PATCH 4/5] Everywhere: use bls_aug instead of bls --- manifest/product_octez.ml | 2 +- src/lib_crypto/test/test_prop_signature.ml | 2 +- src/lib_crypto/test/test_signature.ml | 2 +- src/lib_crypto/test/test_signature_encodings.ml | 2 +- src/lib_crypto/tezos_crypto.ml | 2 +- src/lib_protocol_environment/environment_V10.ml | 8 ++++---- src/lib_protocol_environment/environment_V10.mli | 6 +++--- src/lib_protocol_environment/environment_V11.ml | 8 ++++---- src/lib_protocol_environment/environment_V11.mli | 6 +++--- src/lib_protocol_environment/environment_V12.ml | 8 ++++---- src/lib_protocol_environment/environment_V12.mli | 6 +++--- src/lib_protocol_environment/environment_V13.ml | 8 ++++---- src/lib_protocol_environment/environment_V13.mli | 6 +++--- src/lib_protocol_environment/environment_V14.ml | 8 ++++---- src/lib_protocol_environment/environment_V14.mli | 6 +++--- src/lib_protocol_environment/environment_V15.ml | 8 ++++---- src/lib_protocol_environment/environment_V15.mli | 6 +++--- src/lib_protocol_environment/environment_V7.ml | 8 ++++---- src/lib_protocol_environment/environment_V7.mli | 6 +++--- src/lib_protocol_environment/environment_V8.ml | 8 ++++---- src/lib_protocol_environment/environment_V8.mli | 6 +++--- src/lib_protocol_environment/environment_V9.ml | 8 ++++---- src/lib_protocol_environment/environment_V9.mli | 6 +++--- src/lib_signer_backends/encrypted.ml | 6 ++++-- src/proto_016_PtMumbai/lib_client/dune | 2 +- src/proto_016_PtMumbai/lib_client/injection.ml | 2 +- src/proto_016_PtMumbai/lib_client_commands/dune | 2 +- src/proto_016_PtMumbai/lib_parameters/dune | 2 +- src/proto_016_PtMumbai/lib_plugin/dune | 2 +- src/proto_017_PtNairob/lib_client/dune | 2 +- src/proto_017_PtNairob/lib_client/injection.ml | 2 +- src/proto_017_PtNairob/lib_client_commands/dune | 2 +- src/proto_017_PtNairob/lib_parameters/dune | 2 +- src/proto_017_PtNairob/lib_plugin/dune | 2 +- src/proto_017_PtNairob/lib_sc_rollup_node/dune | 2 +- src/proto_018_Proxford/lib_client/dune | 2 +- src/proto_018_Proxford/lib_client/injection.ml | 2 +- src/proto_018_Proxford/lib_client_commands/dune | 2 +- src/proto_018_Proxford/lib_parameters/dune | 2 +- src/proto_018_Proxford/lib_plugin/dune | 2 +- src/proto_018_Proxford/lib_sc_rollup_node/dune | 2 +- src/proto_019_PtParisB/lib_client/dune | 2 +- src/proto_019_PtParisB/lib_client/injection.ml | 2 +- src/proto_019_PtParisB/lib_client_commands/dune | 2 +- src/proto_019_PtParisB/lib_parameters/dune | 2 +- src/proto_019_PtParisB/lib_plugin/dune | 2 +- src/proto_019_PtParisB/lib_sc_rollup_node/dune | 2 +- src/proto_020_PsParisC/lib_client/dune | 2 +- src/proto_020_PsParisC/lib_client/injection.ml | 2 +- src/proto_020_PsParisC/lib_client_commands/dune | 2 +- src/proto_020_PsParisC/lib_parameters/dune | 2 +- src/proto_020_PsParisC/lib_plugin/dune | 2 +- src/proto_020_PsParisC/lib_sc_rollup_node/dune | 2 +- .../lib_benchmark/michelson_samplers_base.ml | 2 +- src/proto_021_PsQuebec/lib_benchmarks_proto/dune | 2 +- .../lib_benchmarks_proto/interpreter_workload.ml | 4 ++-- src/proto_021_PsQuebec/lib_client/dune | 2 +- src/proto_021_PsQuebec/lib_client/injection.ml | 2 +- src/proto_021_PsQuebec/lib_client_commands/dune | 2 +- src/proto_021_PsQuebec/lib_dal/dune | 2 +- src/proto_021_PsQuebec/lib_delegate/dune | 2 +- .../lib_delegate/test/tenderbrute/lib/dune | 2 +- src/proto_021_PsQuebec/lib_injector/dune | 2 +- src/proto_021_PsQuebec/lib_parameters/dune | 2 +- src/proto_021_PsQuebec/lib_plugin/dune | 2 +- src/proto_021_PsQuebec/lib_protocol/test/helpers/dune | 2 +- .../lib_protocol/test/helpers/operation_generator.ml | 6 +++--- .../test/integration/consensus/test_consensus_key.ml | 2 +- .../test/integration/consensus/test_delegation.ml | 2 +- .../lib_protocol/test/unit/test_operation_repr.ml | 2 +- src/proto_021_PsQuebec/lib_sc_rollup_node/dune | 2 +- src/proto_alpha/lib_benchmark/michelson_samplers_base.ml | 2 +- src/proto_alpha/lib_benchmarks_proto/dune | 2 +- .../lib_benchmarks_proto/interpreter_workload.ml | 4 ++-- src/proto_alpha/lib_client/dune | 2 +- src/proto_alpha/lib_client/injection.ml | 2 +- src/proto_alpha/lib_client_commands/dune | 2 +- src/proto_alpha/lib_dal/dune | 2 +- src/proto_alpha/lib_delegate/dune | 2 +- src/proto_alpha/lib_delegate/test/tenderbrute/lib/dune | 2 +- src/proto_alpha/lib_injector/dune | 2 +- src/proto_alpha/lib_parameters/dune | 2 +- src/proto_alpha/lib_plugin/dune | 2 +- src/proto_alpha/lib_protocol/test/helpers/dune | 2 +- .../lib_protocol/test/helpers/operation_generator.ml | 6 +++--- .../test/integration/consensus/test_consensus_key.ml | 2 +- .../test/integration/consensus/test_delegation.ml | 2 +- .../lib_protocol/test/unit/test_operation_repr.ml | 2 +- src/proto_alpha/lib_sc_rollup_node/dune | 2 +- src/proto_next/lib_benchmark/michelson_samplers_base.ml | 2 +- src/proto_next/lib_benchmarks_proto/dune | 2 +- .../lib_benchmarks_proto/interpreter_workload.ml | 4 ++-- src/proto_next/lib_client/dune | 2 +- src/proto_next/lib_client/injection.ml | 2 +- src/proto_next/lib_client_commands/dune | 2 +- src/proto_next/lib_dal/dune | 2 +- src/proto_next/lib_delegate/dune | 2 +- src/proto_next/lib_delegate/test/tenderbrute/lib/dune | 2 +- src/proto_next/lib_injector/dune | 2 +- src/proto_next/lib_parameters/dune | 2 +- src/proto_next/lib_plugin/dune | 2 +- src/proto_next/lib_protocol/test/helpers/dune | 2 +- .../lib_protocol/test/helpers/operation_generator.ml | 6 +++--- .../test/integration/consensus/test_consensus_key.ml | 2 +- .../test/integration/consensus/test_delegation.ml | 2 +- .../lib_protocol/test/unit/test_operation_repr.ml | 2 +- src/proto_next/lib_sc_rollup_node/dune | 2 +- 107 files changed, 164 insertions(+), 162 deletions(-) diff --git a/manifest/product_octez.ml b/manifest/product_octez.ml index c6c2ea7b0cf8..de5c5229f014 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_crypto/test/test_prop_signature.ml b/src/lib_crypto/test/test_prop_signature.ml index 571f12d43163..aae3382090fb 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) diff --git a/src/lib_crypto/test/test_signature.ml b/src/lib_crypto/test/test_signature.ml index b430a05d41aa..fe36293842e9 100644 --- a/src/lib_crypto/test/test_signature.ml +++ b/src/lib_crypto/test/test_signature.ml @@ -67,7 +67,7 @@ let test_size () = 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)) diff --git a/src/lib_crypto/test/test_signature_encodings.ml b/src/lib_crypto/test/test_signature_encodings.ml index 8fa39525b79d..1a0cf11a7222 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 55aa38bbe1da..d02b83e8d467 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_aug + 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 120d968900a7..a87734895402 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 32b0dc749be6..2226d0edef61 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 8849bb66fdff..126296665e05 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 a1037ceff962..560035ef8e62 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 f9b7148342b0..d80961067407 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 ceea2e31398f..6f0515bfd31a 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 a7c3daf2b9fb..35b32c23ea13 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 00f49fe41431..502b3530423f 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 6ac9746abda4..ecb37bd8fd34 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 87f305f7bd32..af589f379dcf 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 51e7db2003e1..82594d3516df 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 e1defb4f4d8e..2ec09e3d877b 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 2c63f1ae1256..cefce9fd12b6 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 80f90cbc2f2c..a65363d8ffc0 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 86cd8a5ab81b..76434bb63a00 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 073f9f8d5cee..ad28c7b6d445 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 c15c642c026b..ee212ac1b75b 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 ec62ed951ed0..ab97818d7449 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_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index 41c9a0a92251..9c137f51a4b7 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -84,7 +84,9 @@ module Raw = struct Signature.P256.Secret_key.encoding sk | Decrypted_sk (Bls_aug sk) -> - Data_encoding.Binary.to_bytes_exn Signature.Bls.Secret_key.encoding 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) @@ -138,7 +140,7 @@ module Raw = struct | 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 -> diff --git a/src/proto_016_PtMumbai/lib_client/dune b/src/proto_016_PtMumbai/lib_client/dune index 5ae1fe251a59..0818c6e40515 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 d3259b1377b9..b0e5b7284796 100644 --- a/src/proto_016_PtMumbai/lib_client/injection.ml +++ b/src/proto_016_PtMumbai/lib_client/injection.ml @@ -638,7 +638,7 @@ let signature_size_of_algo : Tezos_crypto.Signature.algo -> int = function | 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) diff --git a/src/proto_016_PtMumbai/lib_client_commands/dune b/src/proto_016_PtMumbai/lib_client_commands/dune index 2eb84a3959c7..1eab35b023c2 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 82dcf16996a0..0b678d82f962 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 827678002475..690af8553c3d 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 8151f63434a5..8ce4c99d57aa 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 414721d1e925..f409d0e437ae 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 ad8ebfc541ee..957288e26e0e 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 084f13d2bce5..a995a2c38621 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 f385fd162cb2..b6f02352382f 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 f12335716415..1f30849f8fd4 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 d1c056a7b12a..b29ecb9755ec 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 96bbaa97fe06..6c3bc1504408 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 9897cb663f3e..6877dab73c0a 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 4d645024d982..4e2bec31d960 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 63d7d4e6f0db..ad055b64fcbe 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 66bbc57edddd..5432088338cf 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 d7ae5a34a628..d7ceb82931d8 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 2fa804d9bea3..219621b83880 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 a87368b989d4..cf7ff05b4ccb 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 16ee09d2ecb7..a98e6a8628cc 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 379c5deee4d8..9030b66bc940 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 126a91072841..cad0b5fb31e4 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 880f420f3f47..e108b1737340 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 2fa804d9bea3..219621b83880 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 8fda293b9f41..829ccdbf5515 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 944c599acf9c..ee5a59f68890 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 4111fad4ab52..731efa6baf08 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 6ab5832a816f..feafb2e0d345 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 651a385016bf..f9be34020835 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 d8ea8515999d..4431ecf07dcd 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 c7c16d355f91..d18e6316cbd6 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 761ef6a9a5e0..159cf54aac8b 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 2cd1e3948871..0644eeeae20f 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 516dbb13792a..211a85a63407 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 e274b9397341..7a485c425783 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 264a9f9b1bec..039dd9df8323 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 5b97211d170f..7738914199b6 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 caa994288e29..d875b554b155 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 8e522ecf12f9..a4b104936f05 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 365cb65412b9..9b5b4cd4233b 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 9f062a78655e..f777ee746f9b 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 587f3f109276..e8c60d98401d 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 4e94607cb0a6..863b96d44668 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 9b04edc2bf67..7c4e225d7d54 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 5785fa0c5406..420014cf08fc 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 1c4c6b4d119d..eb0eb5146a8a 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_alpha/lib_benchmark/michelson_samplers_base.ml b/src/proto_alpha/lib_benchmark/michelson_samplers_base.ml index 651a385016bf..f9be34020835 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 1f7fd4dd2cd4..49c990be9ef0 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 c7c16d355f91..d18e6316cbd6 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 b609baa80d62..a6f90f08bf78 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 2cd1e3948871..0644eeeae20f 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 5f6379ca6229..75ff918c1fe0 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 93d502ab07d8..23cc3edbe6ee 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 1f629c21bad3..5ee936b1de7c 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 1754a62aeb67..a9dd124d7e93 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 b25f426e0187..c787cbcc0990 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 d16d636f906c..1d511b572382 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 eaba3e58437e..ea6dc08c60a8 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 9a67c96dbb94..e97e8678e805 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 9983d8ba88eb..0e2f77e32de6 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 d1bc78724013..4b34ea5ffcd4 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 61abdc28a029..823913dfe20c 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 688e77036497..ff4731b53c0b 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 556fb5d82662..a341906fa2b3 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_next/lib_benchmark/michelson_samplers_base.ml b/src/proto_next/lib_benchmark/michelson_samplers_base.ml index 651a385016bf..f9be34020835 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 12f19f8c36cb..ce84ef0e8974 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 c7c16d355f91..d18e6316cbd6 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 fc5b2b58855f..452c854b476d 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 2cd1e3948871..0644eeeae20f 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 515ae070e15b..551867baa18d 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 04cae27df5eb..dbb5a19ff658 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 5c151d3aa36e..597ea9e0b59e 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 041a19c241fd..f28d801b6924 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 e6393948ef7e..63309c66e1e7 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 18865fdeedca..3faa8f9c9617 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 d287a0c5dd5e..2ae6ee4626d2 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 14242d70c6f4..3c80171f55a2 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 9983d8ba88eb..0e2f77e32de6 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 e2217f93eb68..56d72eabdc9b 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 321511b1a494..6ade0d05052e 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 0af878d257bc..437a9bf7d8ab 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 ba0ff371184b..3e4d3b067485 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"))) -- GitLab From cc862dd352633dc11d69db1124efd20930494133 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 11 Feb 2025 13:29:16 +0100 Subject: [PATCH 5/5] Changes: add an entry for bls renaming into bls_aug --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 93747c111eca..f0138399f03c 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`). -- GitLab