diff --git a/src/lib_client_base/client_keys.ml b/src/lib_client_base/client_keys.ml index 6c0f200bcb7d2ac6a80a6e2b04349793ad6d4ebf..d770eb261bee40f5d3f10d1a686e25b1dd48665e 100644 --- a/src/lib_client_base/client_keys.ml +++ b/src/lib_client_base/client_keys.ml @@ -148,15 +148,6 @@ let make_sapling_uri (x : Uri.t) : sapling_uri tzresult = | None -> tzfail (Exn (Failure "SAPLING_URI needs a scheme")) | Some _ -> return x -type pvss_sk_uri = Uri.t - -let make_pvss_sk_uri (x : Uri.t) : pvss_sk_uri tzresult = - let open Result_syntax in - match Uri.scheme x with - | None -> - tzfail (Exn (Failure "Error while parsing URI: PVSS_URI needs a scheme")) - | Some _ -> return x - type aggregate_pk_uri = Uri.t type aggregate_sk_uri = Uri.t @@ -330,30 +321,6 @@ module Sapling_key = Client_aliases.Alias (struct Lwt.return_ok @@ Json.to_string (Json.construct encoding k) end) -module PVSS_public_key = Client_aliases.Alias (struct - include Pvss_secp256k1.Public_key (* t, Compare, encoding *) - - let name = "PVSS public key" - - let of_source s = Lwt.return (Pvss_secp256k1.Public_key.of_b58check s) - - let to_source t = Lwt.return_ok (Pvss_secp256k1.Public_key.to_b58check t) -end) - -module PVSS_secret_key = Client_aliases.Alias (struct - let name = "PVSS secret key" - - type t = pvss_sk_uri - - include CompareUri - - let encoding = uri_encoding - - let of_source s = Lwt.return (make_pvss_sk_uri @@ Uri.of_string s) - - let to_source t = Lwt.return_ok (Uri.to_string t) -end) - module Aggregate_alias = struct module Public_key_hash = struct include Client_aliases.Alias (struct diff --git a/src/lib_client_base/client_keys.mli b/src/lib_client_base/client_keys.mli index 317026c8c0248254aa7560b33595717c9fa53ad8..8ced7730cd6489f065cb051dde5c97d2a1445d29 100644 --- a/src/lib_client_base/client_keys.mli +++ b/src/lib_client_base/client_keys.mli @@ -33,8 +33,6 @@ type sk_uri = private Uri.t type sapling_uri = private Uri.t -type pvss_sk_uri = private Uri.t - type aggregate_pk_uri = private Uri.t type aggregate_sk_uri = private Uri.t @@ -85,11 +83,6 @@ type sapling_key = { module Sapling_key : Client_aliases.Alias with type t = sapling_key -module PVSS_public_key : - Client_aliases.Alias with type t = Pvss_secp256k1.Public_key.t - -module PVSS_secret_key : Client_aliases.Alias with type t = pvss_sk_uri - (** [Aggregate_alias] contains the implementation needed for the wallet to have the correspondence between aliases and keys. It has three sub-module [Public_key] [Public_key_hash] [Secret_key]. The reason of a sub-module @@ -394,8 +387,6 @@ val make_aggregate_sk_uri : Uri.t -> aggregate_sk_uri tzresult val make_sapling_uri : Uri.t -> sapling_uri tzresult -val make_pvss_sk_uri : Uri.t -> pvss_sk_uri tzresult - (** Mnemonic of 24 common english words from which a key can be derived. The mnemonic follows the BIP-39 spec. *) module Mnemonic : sig diff --git a/src/lib_client_commands/client_keys_commands.ml b/src/lib_client_commands/client_keys_commands.ml index c57821e24202b98d4d6354f17195f568e9206ea4..48f6447d26b38e20df11ff9779a8d8b8d7309ba5 100644 --- a/src/lib_client_commands/client_keys_commands.ml +++ b/src/lib_client_commands/client_keys_commands.ml @@ -901,71 +901,6 @@ let commands network : Client_context.full Clic.command list = pkh in return_unit); - command - ~group - ~desc:"Generate a pair of PVSS keys." - (args1 (Secret_key.force_switch ())) - (prefixes ["pvss"; "gen"; "keys"] - @@ PVSS_secret_key.fresh_alias_param @@ stop) - (fun force name (cctxt : Client_context.full) -> - let* name = PVSS_secret_key.of_fresh cctxt force name in - let pk, sk = Pvss_secp256k1.generate_keys () in - let* () = PVSS_public_key.add ~force cctxt name pk in - let* sk_uri = - Tezos_signer_backends.Encrypted.encrypt_pvss_key cctxt sk - in - PVSS_secret_key.add ~force cctxt name sk_uri); - command - ~group - ~desc:"List PVSS keys." - no_options - (prefixes ["pvss"; "list"; "keys"] @@ stop) - (fun () (cctxt : #Client_context.full) -> - let* keys = PVSS_public_key.load cctxt in - List.iter_es - (fun (s, pk) -> - let*! () = - cctxt#message "%s: %a" s Pvss_secp256k1.Public_key.pp pk - in - return_unit) - (List.sort (fun (s1, _) (s2, _) -> String.compare s1 s2) keys)); - command - ~group - ~desc:"Forget one pair of PVSS keys." - (args1 - (Clic.switch - ~long:"force" - ~short:'f' - ~doc:"you got to use the force for that" - ())) - (prefixes ["pvss"; "forget"; "keys"] - @@ PVSS_public_key.alias_param @@ stop) - (fun force (name, _key) (cctxt : #Client_context.full) -> - let* () = - fail_unless - force - (error_of_fmt "this can only be used with option --force") - in - let* () = PVSS_public_key.del cctxt name in - PVSS_secret_key.del cctxt name); - command - ~group - ~desc:"Forget all PVSS keys." - (args1 - (Clic.switch - ~long:"force" - ~short:'f' - ~doc:"you got to use the force for that" - ())) - (prefixes ["pvss"; "forget"; "all"; "keys"] @@ stop) - (fun force (cctxt : #Client_context.full) -> - let* () = - fail_unless - force - (error_of_fmt "this can only be used with option --force") - in - let* () = PVSS_public_key.set cctxt [] in - PVSS_secret_key.set cctxt []); (let desc = "Generate a pair of BLS keys." in let force_switch = Aggregate_alias.Secret_key.force_switch in let cmd = diff --git a/src/lib_crypto/pvss.ml b/src/lib_crypto/pvss.ml deleted file mode 100644 index dc9c769afd2222e51ce3594e7a4df1b6f187ec5f..0000000000000000000000000000000000000000 --- a/src/lib_crypto/pvss.ml +++ /dev/null @@ -1,454 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(* We reshadow the List module with Stdlib's because there are many safe uses of - double-list traversors *) -module List = Stdlib.List -module H = Blake2B - -(** Polynomial ring (ℤ/qℤ)[X] *) -module PZ_q (Z_q : Znz.ZN) : sig - type t - - module Z_q : Znz.ZN - - (** Evaluates the polynomial p at point x *) - val eval : p:t -> x:Z_q.t -> Z_q.t - - (** Builds the polynomial from a list of coefficient, ordered by power. - That is, of_list [a₀; a₁; a₂; …] = a₀ + a₁ x + a₂ x² + … *) - val of_list : Z_q.t list -> t -end -with type Z_q.t = Z_q.t = struct - module Z_q = Z_q - - type t = Z_q.t list - - let eval ~p ~x = List.fold_right (fun c y -> Z_q.((y * x) + c)) p Z_q.zero - - let of_list l = l -end - -(** Functor type for an Cyclic group *) -module type CYCLIC_GROUP = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include S.RAW_DATA with type t := t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - - val name : string - - module Z_m : Znz.ZN - - val e : t - - val g1 : t - - val g2 : t - - val ( * ) : t -> t -> t - - val pow : t -> Z_m.t -> t - - val to_bits : t -> String.t - - val of_bits : String.t -> t option -end - -(** Type of a module that handles proofs for the discrete logarithm - equality equation. *) -module type DLEQ = sig - (** A DLEQ equation. *) - type equation - - (** A non-interactive zero-knowledge proof-of-knowledge of an - exponent solving the equation. *) - type proof - - val proof_encoding : proof Data_encoding.t - - (** Group element. *) - type element - - (** Exponent, i.e. an integer modulo the group's order. *) - type exponent - - (** Sets up a equation of the form - ∀ i, ∃ x(i), b₁ˣ⁽ⁱ⁾ = h₁ᵢ and b₂ᵢˣ⁽ⁱ⁾ = h₂ᵢ. The arguments - are given as b₁, h₁ᵢ, b₂ᵢ, h₂ᵢ *) - val setup_equation : - element -> element list -> element list -> element list -> equation - - (** Creates a zero-knowledge proof of knowledge of the exponent list *) - val make_proof : equation -> exponent list -> proof - - (** Checks the proof created by make_proof for a given equation *) - val check_proof : equation -> proof -> bool -end - -(** Functor for creating a module handling proofs for the discrete logarithm - equality in cyclic group G *) -module MakeDleq (G : CYCLIC_GROUP) : - DLEQ with type element = G.t and type exponent = G.Z_m.t = struct - type element = G.t - - type exponent = G.Z_m.t - - type equation = element * element list * element list * element list - - type proof = exponent * exponent list - - let proof_encoding = Data_encoding.(tup2 G.Z_m.encoding (list G.Z_m.encoding)) - - (* Fiat-Shamir heuristic to derive a random element of ℤ/mℤ from the - hash of a list of group elements *) - let fiat_shamir ?(exponents = []) elements = - String.concat - "||" - (("tezosftw" :: List.map G.to_bits elements) - @ List.map G.Z_m.to_bits exponents) - |> (fun x -> H.hash_string [x]) - |> H.to_string |> G.Z_m.of_bits_exn - - let setup_equation b1 h1_n b2_n h2_n = (b1, h1_n, b2_n, h2_n) - - let make_proof (b1, h1_n, b2_n, h2_n) x_n = - (* First, draw blinding factors. Normally these should be picked randomly. To maximize - reproducibility and avoid weak random number generation, we generate the blinding - factor deterministically from the problem parameters and the secret x_n. - TODO: review with cryptographer - *) - let pseudo_seed = - fiat_shamir (b1 :: List.concat [h1_n; b2_n; h2_n]) ~exponents:x_n - in - let w_n = - List.mapi - (fun i __ -> fiat_shamir [] ~exponents:[pseudo_seed; G.Z_m.of_int i]) - h1_n - in - let a1_n = List.map (G.pow b1) w_n and a2_n = List.map2 G.pow b2_n w_n in - let (* Pick the challenge, c, following the Fiat-Shamir heuristic. *) - c = - fiat_shamir (List.concat [h1_n; h2_n; a1_n; a2_n]) - in - let (* rᵢ = wᵢ - c * xᵢ *) - r_n = - List.map2 (fun w x -> G.Z_m.(w - (c * x))) w_n x_n - in - (c, r_n) - - let check_proof (b1, h1_n, b2_n, h2_n) (c, r_n) = - (* First check that the lists have the same sizes. *) - let same_sizes = - (Compare.Int.equal 0 @@ List.compare_lengths h1_n b2_n) - && (Compare.Int.equal 0 @@ List.compare_lengths b2_n h2_n) - && (Compare.Int.equal 0 @@ List.compare_lengths h2_n r_n) - in - if not same_sizes then false - else - let a1_n = - (* Original, non-optimized form - List.map2 - G.( * ) - (List.map (G.pow b1) r_n) - (List.map (fun h1 -> G.pow h1 c) h1_n) - *) - List.map2 - (fun r h1 -> - let open G in - pow b1 r * pow h1 c) - r_n - h1_n - and a2_n = - (* Original, non-optimized form - List.map2 - G.( * ) - (List.map2 G.pow b2_n r_n) - (List.map (fun h2 -> G.pow h2 c) h2_n) - *) - let rec map3 f xs ys zs = - match (xs, ys, zs) with - | [], [], [] -> [] - | x :: xs, y :: ys, z :: zs -> - let r = f x y z in - r :: map3 f xs ys zs - | _ -> invalid_arg "Pvss: List.map3" - in - map3 - (fun b2 r h2 -> - let open G in - pow b2 r * pow h2 c) - b2_n - r_n - h2_n - in - G.Z_m.(c = fiat_shamir (List.concat [h1_n; h2_n; a1_n; a2_n])) -end - -module type PVSS = sig - module type ENCODED = sig - type t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - end - - module Commitment : ENCODED - - module Encrypted_share : ENCODED - - module Clear_share : ENCODED - - module Public_key : sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include S.RAW_DATA with type t := t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - end - - module Secret_key : sig - include ENCODED - - val to_public_key : t -> Public_key.t - end - - type proof - - val proof_encoding : proof Data_encoding.t - - val dealer_shares_and_proof : - secret:Secret_key.t -> - threshold:int -> - public_keys:Public_key.t list -> - Encrypted_share.t list * Commitment.t list * proof - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val reveal_share : - Encrypted_share.t -> - secret_key:Secret_key.t -> - public_key:Public_key.t -> - Clear_share.t * proof - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end - -module MakePvss (G : CYCLIC_GROUP) : PVSS = struct - module type ENCODED = sig - type t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - end - - (* Module to make discrete logarithm equality proofs *) - module Dleq = MakeDleq (G) - - type proof = Dleq.proof - - (* Polynomials over ℤ/mℤ *) - module PZ_m = PZ_q (G.Z_m) - - (* A public key is a group element *) - module Public_key = G - - module Secret_key = struct - include G.Z_m - - let to_public_key x = G.(pow g2 x) - end - - module Encrypted_share = G - module Clear_share = G - module Commitment = G - - let proof_encoding = Dleq.proof_encoding - - (* generate a "random": polynomial of degree t to hide secret `secret` *) - let random_polynomial secret t = - (* the t-1 coefficients are computed deterministically from - the secret and mapped to G.Z_m *) - let nonce = - [String.concat "||" [G.Z_m.to_bits secret]] - |> H.hash_string |> H.to_string - in - (* TODO: guard against buffer overflow *) - let rec make_coefs = function - | 0 -> [] - | k -> - let h = - H.hash_string [string_of_int k; "||"; nonce] - |> H.to_string |> G.Z_m.of_bits_exn - in - h :: make_coefs (k - 1) - in - let coefs = secret :: make_coefs (t - 1) in - (* let coefs = secret :: List_Utils.list_init ~f:G.Z_m.random ~n:(t-1) in *) - let poly = PZ_m.of_list coefs in - (coefs, poly) - - (* Hides secret s in a random polynomial of degree t = threshold, publishes t - commitments to the polynomial coefficients and n encrypted shares for the - holders of the public keys *) - let dealer_shares_and_proof ~secret ~threshold ~public_keys = - let coefs, poly = random_polynomial secret threshold in - let - (* Cⱼ represents the commitment to the coefficients of the polynomial - Cⱼ = g₁^(aⱼ) for j in 0 to t-1 *) - cC_j = - List.map G.(pow g1) coefs - and - (* pᵢ = p(i) for i in 1…n, with i ∈ ℤ/mℤ: points of the polynomial. *) - p_i = - List.mapi - (fun i _ -> PZ_m.eval ~p:poly ~x:(i + 1 |> G.Z_m.of_int)) - public_keys - in - let - (* yᵢ = pkᵢᵖ⁽ⁱ⁾ for i ∈ 1…n: the value of p(i) encrypted with pkᵢ, - the public key of the party receiving the iᵗʰ party. The public - keys use the g₂ generator of G. Thus pkᵢ = g₂ˢᵏⁱ *) - y_i = - List.map2 G.pow public_keys p_i - and (* xᵢ = g₁ᵖ⁽ⁱ⁾ for in in 1…n: commitment to polynomial points *) - x_i = - List.map G.(pow g1) p_i - in - let equation = Dleq.setup_equation G.g1 x_i public_keys y_i in - let proof = Dleq.make_proof equation p_i in - (y_i, cC_j, proof) - - let check_dealer_proof y_i cC_j ~proof ~public_keys = - (* Reconstruct Xᵢ from Cⱼ *) - let x_i = - (* prod_C_j_to_the__i_to_the_j = i ↦ Πⱼ₌₀ᵗ⁻¹ Cⱼ^(iʲ) *) - let prod_C_j_to_the__i_to_the_j i = - (* Original, non-optimized form - List.mapi (fun j cC -> G.pow cC (G.Z_m.pow i (Z.of_int j))) cC_j - |> List.fold_left G.( * ) G.e - *) - List.fold_left - (fun (power, acc) cC -> - let open G in - (Z_m.( * ) power i, acc * pow cC power)) - (G.Z_m.one, G.e) - cC_j - |> snd - in - List.mapi - (fun i _ -> prod_C_j_to_the__i_to_the_j (i + 1 |> G.Z_m.of_int)) - y_i - in - let equation = Dleq.setup_equation G.g1 x_i public_keys y_i in - Dleq.check_proof equation proof - - (* reveal a share *) - let reveal_share y ~secret_key ~public_key = - match G.Z_m.inv secret_key with - | None -> failwith "Invalid secret key" - | Some inverse_key -> - let reveal = G.(pow y inverse_key) in - (* y = g₂^(private_key) and public_key = reveal^(private_key) *) - let equation = Dleq.setup_equation G.g2 [public_key] [reveal] [y] in - let proof = Dleq.make_proof equation [secret_key] in - (reveal, proof) - - (* check the validity of a revealed share *) - let check_revealed_share share reveal ~public_key proof = - let equation = Dleq.setup_equation G.g2 [public_key] [reveal] [share] in - Dleq.check_proof equation proof - - (* reconstruct the secret *) - let reconstruct reveals int_indices = - (* check that there enough reveals *) - let indices = List.map (fun x -> G.Z_m.of_int (1 + x)) int_indices in - let lagrange i = - (* Original, non-optimized form - List.fold_left - G.Z_m.( * ) - G.Z_m.one - (List.map - (fun j -> - if G.Z_m.(j = i) then G.Z_m.one - else - match G.Z_m.(inv (j - i)) with - | None -> - failwith "Unexpected error inverting scalar." - | Some inverse -> - G.Z_m.(j * inverse)) - indices) - *) - List.fold_left - (fun acc indice -> - if G.Z_m.( = ) indice i then acc - else - match G.Z_m.(inv (indice - i)) with - | None -> failwith "Unexpected error inverting scalar." - | Some inverse -> - let open G.Z_m in - acc * indice * inverse) - G.Z_m.one - indices - in - (* Original, non-optimized form - let lagrange = List.map lagrange indices in - List.fold_left G.( * ) G.e (List.map2 G.pow reveals lagrange) - *) - List.fold_left2 - (fun acc reveal indice -> - let open G in - acc * pow reveal (lagrange indice)) - G.e - reveals - indices -end diff --git a/src/lib_crypto/pvss.mli b/src/lib_crypto/pvss.mli deleted file mode 100644 index 0e75218d56a46f3f8313517ecd4de473d468cbb5..0000000000000000000000000000000000000000 --- a/src/lib_crypto/pvss.mli +++ /dev/null @@ -1,152 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** PVSS protocol, following - - see Schoenmakers, B., 1999: - A simple publicly verifiable secret sharing scheme - and its application to electronic voting. Lecture Notes in Computer Science, - pp.148-164. - - see https://www.win.tue.nl/~berry/papers/crypto99.pdf - - The protocol is expressed as a functor parametrized by a cyclic group - of prime order. Algebraic properties are enforced at the type level, - whenever reasonably possible. - -*) - -module type CYCLIC_GROUP = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include S.RAW_DATA with type t := t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - - val name : string - - module Z_m : Znz.ZN - - val e : t - - val g1 : t - - val g2 : t - - val ( * ) : t -> t -> t - - val pow : t -> Z_m.t -> t - - (** Binary representation *) - val to_bits : t -> String.t - - val of_bits : String.t -> t option -end - -(** PVSS construction, based on a cyclic group G of prime order *) -module type PVSS = sig - module type ENCODED = sig - type t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - end - - module Commitment : ENCODED - - module Encrypted_share : ENCODED - - module Clear_share : ENCODED - - module Public_key : sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include S.RAW_DATA with type t := t - - include S.B58_DATA with type t := t - - include S.ENCODER with type t := t - end - - module Secret_key : sig - include ENCODED - - val to_public_key : t -> Public_key.t - end - - type proof - - val proof_encoding : proof Data_encoding.t - - (** Lets a dealer share a secret with a set of participant by breaking it into - pieces, encrypting it with the participant's public keys, and publishing - these encrypted shares. Any t = threshold participants can reconstruct the - secret. A zero-knowledge proof is produced showing that the dealer - correctly followed the protocol, making the protocol publicly verifiable. *) - val dealer_shares_and_proof : - secret:Secret_key.t -> - threshold:int -> - public_keys:Public_key.t list -> - Encrypted_share.t list * Commitment.t list * proof - - (** Checks the proof produced by the dealer, given the encrypted shares, - the commitment list, the proof, and the participant's public keys. *) - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - (** Lets a participant provably decrypt an encrypted share. *) - val reveal_share : - Encrypted_share.t -> - secret_key:Secret_key.t -> - public_key:Public_key.t -> - Clear_share.t * proof - - (** Checks that the participant honestly decrypted its share. *) - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end - -module MakePvss (G : CYCLIC_GROUP) : PVSS diff --git a/src/lib_crypto/pvss_secp256k1.ml b/src/lib_crypto/pvss_secp256k1.ml deleted file mode 100644 index fe7240b4a290e2a794b5376b83527106053b1370..0000000000000000000000000000000000000000 --- a/src/lib_crypto/pvss_secp256k1.ml +++ /dev/null @@ -1,82 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -open Secp256k1_group - -module G : Pvss.CYCLIC_GROUP = struct - module Z_m = struct - include Group.Scalar - - let n = Group.order - - let ( + ) = Group.Scalar.add - - let ( * ) = Group.Scalar.mul - - let ( - ) = Group.Scalar.sub - - let ( = ) = Group.Scalar.equal - - let inv = Group.Scalar.inverse - end - - include Group - - let name = "secp256k1" - - (* This pvss algorithm assumes the public keys of the participants receiving - shares are based on g2, so we set g2 to Group.g to match regular Secp256k1 - public keys. - *) - let g1 = Group.h - - let g2 = Group.g - - (* We use a multiplicative notation in the pvss module, but - secp256k1 usually uses an additive notation. *) - let ( * ) = Group.(( + )) - - let pow x n = Group.mul n x - - let of_bits b = Option.catch (fun () -> Group.of_bits_exn b) -end - -include Pvss.MakePvss (G) - -let convert_encoding de1 de2 x = - Data_encoding.Binary.of_bytes_exn - de2 - (Data_encoding.Binary.to_bytes_exn de1 x) - -let generate_keys ?(seed = Hacl.Rand.gen 32) () = - let s = - Secp256k1_group.Group.Scalar.of_bits_exn - (Bigstring.of_bytes seed |> Bigstring.to_string) - in - let sk = - convert_encoding Secp256k1_group.Group.Scalar.encoding Secret_key.encoding s - in - let pk = Secret_key.to_public_key sk in - (pk, sk) diff --git a/src/lib_crypto/pvss_secp256k1.mli b/src/lib_crypto/pvss_secp256k1.mli deleted file mode 100644 index c6d74700aecf36209b30edc8768df627dfccabb9..0000000000000000000000000000000000000000 --- a/src/lib_crypto/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -include Pvss.PVSS - -val generate_keys : ?seed:Bytes.t -> unit -> Public_key.t * Secret_key.t diff --git a/src/lib_crypto/test/test_pvss.ml b/src/lib_crypto/test/test_pvss.ml deleted file mode 100644 index e9fbb00551ebfda241f4e7a0b940e53413061fb6..0000000000000000000000000000000000000000 --- a/src/lib_crypto/test/test_pvss.ml +++ /dev/null @@ -1,383 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2018 Dynamic Ledger Solutions, Inc. *) -(* Copyright (c) 2022 Nomadic Labs, *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Testing - ------- - Component: Crypto - Invocation: dune build @src/lib_crypto/runtest - Subject: On Publicly Verifiable Secret Sharing [Schoenmakers, 1999] -*) - -(* We reshadow the List module with Stdlib's because there are many safe uses of - double-list traversors *) -module List = Stdlib.List -module Pvss = Pvss_secp256k1 -module Sp = Secp256k1_group - -module Setup : sig - val shares : Pvss.Encrypted_share.t list - - val commitments : Pvss.Commitment.t list - - val proof : Pvss.proof - - val secret_scalar : Sp.Group.Scalar.t - - val secret : Pvss.Secret_key.t - - val public_secret : Pvss.Public_key.t - - val other_shares : Pvss.Encrypted_share.t list - - val other_commitments : Pvss.Commitment.t list - - val other_proof : Pvss.proof - - val other_secret : Pvss.Secret_key.t - - type keypair = { - secret_key : Pvss.Secret_key.t; - public_key : Pvss.Public_key.t; - } - - val public_keys : Pvss.Public_key.t list - - val keypairs : keypair list - - val random_keypairs : int -> keypair list - - val reveals : - (Pvss.Encrypted_share.t * (Pvss.Clear_share.t * Pvss.proof)) list - - val convert_encoding : 'a Data_encoding.t -> 'b Data_encoding.t -> 'a -> 'b - - val group_encoding : Sp.Group.t Data_encoding.t -end = struct - type keypair = { - secret_key : Pvss.Secret_key.t; - public_key : Pvss.Public_key.t; - } - - let group_encoding = - Data_encoding.(conv Sp.Group.to_bits Sp.Group.of_bits_exn string) - - let scalar_encoding = - Data_encoding.( - conv Sp.Group.Scalar.to_bits Sp.Group.Scalar.of_bits_exn string) - - let convert_encoding de1 de2 x = - Data_encoding.Binary.of_bytes_exn - de2 - (Data_encoding.Binary.to_bytes_exn de1 x) - - (** Random value of Z in the range [0,2^256] *) - let rand_Z () = - [Random.int64 Int64.max_int |> Z.of_int64 |> Z.to_bits] - |> Blake2B.hash_string |> Blake2B.to_string |> Z.of_bits - - (** Generates n random keypairs *) - let random_keypairs n = - List.init n (fun _ -> - let s = Sp.Group.Scalar.of_Z (rand_Z ()) in - let secret_key = - convert_encoding scalar_encoding Pvss.Secret_key.encoding s - in - {secret_key; public_key = Pvss.Secret_key.to_public_key secret_key}) - - let threshold = 5 - - let n = 8 - - let random_scalar () = Sp.Group.Scalar.of_Z (rand_Z ()) - - let secret_of_scalar s = - convert_encoding scalar_encoding Pvss.Secret_key.encoding s - - let secret_scalar = random_scalar () - - let secret = secret_of_scalar secret_scalar - - let public_secret = Pvss.Secret_key.to_public_key secret - - let other_secret = secret_of_scalar (random_scalar ()) - - let keypairs = random_keypairs n - - let public_keys = List.map (fun {public_key; _} -> public_key) keypairs - - let ( (shares, commitments, proof), - (other_shares, other_commitments, other_proof) ) = - ( Pvss.dealer_shares_and_proof ~secret ~threshold ~public_keys, - Pvss.dealer_shares_and_proof ~secret:other_secret ~threshold ~public_keys - ) - - let reveals = - List.map2 - (fun share keypair -> - ( share, - Pvss.reveal_share - share - ~secret_key:keypair.secret_key - ~public_key:keypair.public_key )) - shares - keypairs -end - -(** Checks the dealer's proof of validity of encrypted shares. *) -let test_dealer_proof () = - let shr = (Setup.shares, Setup.other_shares) - and cmt = (Setup.commitments, Setup.other_commitments) - and prf = (Setup.proof, Setup.other_proof) in - for i = 0 to 1 do - for j = 0 to 1 do - for k = 0 to 1 do - let pick = function 0 -> fst | _ -> snd in - assert ( - Pvss.check_dealer_proof - (pick i shr) - (pick j cmt) - ~proof:(pick k prf) - ~public_keys:Setup.public_keys - = (i = j && j = k)) - done - done - done - -module Proof = struct - module G = Sp.Group - - type exponent = G.Scalar.t - - type proof = exponent * exponent list - - type t = proof - - let encoding = Data_encoding.(tup2 G.Scalar.encoding (list G.Scalar.encoding)) - - let mangle : t -> t = fun (e, es) -> (G.Scalar.(mul e e), es) -end - -(** A dealer's proof which is meant to be invalid by falsifying it - with [mangle]. -*) -let test_invalid_dealer_proof () = - let proof : Proof.t = - Setup.convert_encoding Pvss.proof_encoding Proof.encoding Setup.proof - in - let mangled = - Proof.mangle proof - |> Setup.convert_encoding Proof.encoding Pvss.proof_encoding - in - assert ( - not - (Pvss.check_dealer_proof - Setup.shares - Setup.commitments - ~proof:mangled - ~public_keys:Setup.public_keys)) - -(** Checks revealing shares, i.e. each participant honestly decrypts - its share. -*) -let test_share_reveal () = - let shares_valid = - List.map2 - (fun (share, (reveal, proof)) public_key -> - Pvss.check_revealed_share share reveal ~public_key proof) - Setup.reveals - Setup.public_keys - in - List.iteri - (fun i b -> - print_endline (string_of_int i) ; - assert b) - shares_valid - -module Encrypted_share = struct - include Sp.Group - - let mangle : t -> t = fun share -> Sp.Group.(share + share) -end - -(** A dishonestly-revealed share can be checked. *) -let test_invalid_share_reveal () = - let mangle_share : Pvss.Encrypted_share.t -> Pvss.Encrypted_share.t = - fun share -> - let share : Encrypted_share.t = - Setup.convert_encoding - Pvss.Encrypted_share.encoding - Encrypted_share.encoding - share - in - Encrypted_share.mangle share - |> Setup.convert_encoding - Encrypted_share.encoding - Pvss.Encrypted_share.encoding - in - (* check invalid reveal shares *) - let shares_valid = - List.map2 - (fun (share, (reveal, proof)) public_key -> - let share = mangle_share share in - Pvss.check_revealed_share share reveal ~public_key proof) - Setup.reveals - Setup.public_keys - in - List.iteri - (fun i b -> - print_endline (string_of_int i) ; - assert (not b)) - shares_valid - -(** Reconstruct the shared secret. *) -let test_reconstruct () = - let indices = [0; 1; 2; 3; 4] in - let reconstructed = - Pvss.reconstruct - (List.map - (fun n -> - let _, (r, _) = List.nth Setup.reveals n in - r) - indices) - indices - in - assert ( - Sp.Group.(( = )) - (Setup.convert_encoding - Pvss.Public_key.encoding - Setup.group_encoding - reconstructed) - (Setup.convert_encoding - Pvss.Public_key.encoding - Setup.group_encoding - Setup.public_secret)) - -(** Try to reconstruct with n < threshold. *) -let test_invalid_reconstruct () = - let indices = [0; 1; 2; 3] in - let reconstructed = - Pvss.reconstruct - (List.map - (fun n -> - let _, (r, _) = List.nth Setup.reveals n in - r) - indices) - indices - in - assert ( - Setup.convert_encoding - Pvss.Public_key.encoding - Setup.group_encoding - reconstructed - != Setup.convert_encoding - Pvss.Public_key.encoding - Setup.group_encoding - Setup.public_secret) - -(** Test: - This test covers a scenario of using PVSS for randomness generation in the - Tezos protocol given in 3 steps. -*) -let test_randomness_commitment_protocol () = - (* 1st step: cycle `n - 2` *) - let threshold = 3 in - (* 30 bakers *) - let bakers = Setup.random_keypairs 30 in - (* 10 endorsers *) - let endorsers = [0; 1; 2; 3; 4; 5; 6; 7; 8; 9] in - let endorsers_public_keys = - List.map - (fun endorser -> (List.nth bakers endorser).Setup.public_key) - endorsers - in - (* Client: A baker creates a randomness commitment *) - let secret_nonce, public_nonce = - Setup.random_keypairs 1 |> List.hd |> fun Setup.{secret_key; public_key} -> - (secret_key, public_key) - in - (* Client: A baker creates shares for block endorsers, a list of commitments - of length equal to the threshold and a proof *) - let shares, commitments, proof = - Pvss.dealer_shares_and_proof - ~secret:secret_nonce - ~threshold - ~public_keys:endorsers_public_keys - in - (* Protocol: The protocol verifies the shares and commitments with the proof, - the number of commitments and stores them together with the public nonce. *) - assert ( - Pvss.check_dealer_proof - shares - commitments - ~proof - ~public_keys:endorsers_public_keys) ; - assert (Compare.List_length_with.(commitments = threshold)) ; - (* 2nd step: first half of cycle `n - 1` *) - (* Protocol: The revealed nonce, if any, is checked by converting it to public - key and comparing it with the secret nonce. *) - let revealed_nonce = Pvss.Secret_key.to_public_key secret_nonce in - assert (Pvss.Public_key.(public_nonce = revealed_nonce)) ; - (* 3rd step: second half of cycle `n - 1` *) - let revealed_shares = [1; 4; 8] in - assert (Compare.List_length_with.(revealed_shares >= threshold)) ; - let clear_shares = - List.map - (fun index -> - let encrypted_share = List.nth shares index in - let Setup.{secret_key; public_key} = List.nth bakers index in - (* Client: Endorsers may reveal their shares *) - let clear_share, proof = - Pvss.reveal_share encrypted_share ~secret_key ~public_key - in - (* Protocol: The revealed shares are verified with the proof *) - assert ( - Pvss.check_revealed_share - encrypted_share - clear_share - ~public_key - proof) ; - clear_share) - revealed_shares - in - (* Protocol: The protocol may reconstruct the nonce from the revealed shares *) - let reconstructed_nonce = Pvss.reconstruct clear_shares revealed_shares in - assert (Pvss.Public_key.(public_nonce = reconstructed_nonce)) - -let tests = - [ - ( "pvss", - [ - ("dealer proof", `Quick, test_dealer_proof); - ("invalid dealer proof", `Quick, test_invalid_dealer_proof); - ("reveal", `Quick, test_share_reveal); - ("invalid reveal", `Quick, test_invalid_share_reveal); - ("reconstruct", `Quick, test_reconstruct); - ("invalid reconstruct", `Quick, test_invalid_reconstruct); - ( "randomness commitment protocol", - `Quick, - test_randomness_commitment_protocol ); - ] ); - ] diff --git a/src/lib_crypto/test/test_run.ml b/src/lib_crypto/test/test_run.ml index 7ea3778c837c941e21690ac070ac6e4925a5fe68..b344c6c9b82485a761347a03233347e9c73af356 100644 --- a/src/lib_crypto/test/test_run.ml +++ b/src/lib_crypto/test/test_run.ml @@ -27,7 +27,6 @@ runtest (module Test_ed25519); (module Test_merkle); (module Test_p256); - (module Test_pvss); (module Test_signature); (module Test_timelock); (module Test_context_hash); diff --git a/src/lib_protocol_environment/environment_V1.ml b/src/lib_protocol_environment/environment_V1.ml index 085d0ede03c0953133daadcc91ed16eb69c46ce6..09cbd61ca346eb76e2d123b1f341416e8ed34551 100644 --- a/src/lib_protocol_environment/environment_V1.ml +++ b/src/lib_protocol_environment/environment_V1.ml @@ -63,12 +63,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node @@ -166,7 +160,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module S = struct module type T = Tezos_base.S.T @@ -458,70 +451,6 @@ struct val pairing : G1.t -> G2.t -> Gt.t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V1.mli b/src/lib_protocol_environment/environment_V1.mli index 261027f3973bdd35e47b6409c85056abd45c95ee..ee844d329ebefd4e84752fcd30439644526dad3e 100644 --- a/src/lib_protocol_environment/environment_V1.mli +++ b/src/lib_protocol_environment/environment_V1.mli @@ -62,12 +62,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node diff --git a/src/lib_protocol_environment/environment_V2.ml b/src/lib_protocol_environment/environment_V2.ml index 7eed8d436ae4794df5df3ee54c42497f783ca062..bb000236537c996d9163779090ecd0126307f792 100644 --- a/src/lib_protocol_environment/environment_V2.ml +++ b/src/lib_protocol_environment/environment_V2.ml @@ -63,12 +63,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node @@ -172,7 +166,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module S = struct module type T = Tezos_base.S.T @@ -466,70 +459,6 @@ struct val pairing : G1.t -> G2.t -> Gt.t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V2.mli b/src/lib_protocol_environment/environment_V2.mli index 97de47e51e7bac20222f9204e1d147ee189409ea..a1504d373db7ba7ab5a3791c067471e42ffaf420 100644 --- a/src/lib_protocol_environment/environment_V2.mli +++ b/src/lib_protocol_environment/environment_V2.mli @@ -62,12 +62,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node diff --git a/src/lib_protocol_environment/environment_V3.ml b/src/lib_protocol_environment/environment_V3.ml index 74ac6ececda1fe5229f6ff9776b9243261f71a72..c88ffabe3040812857d6749cce01f001f6c6cc4f 100644 --- a/src/lib_protocol_environment/environment_V3.ml +++ b/src/lib_protocol_environment/environment_V3.ml @@ -66,12 +66,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node @@ -275,7 +269,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module Timelock = Timelock module S = struct @@ -558,70 +551,6 @@ struct val pairing : G1.t -> G2.t -> Gt.t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V3.mli b/src/lib_protocol_environment/environment_V3.mli index 163f8ac743d1acb07f0dc6b94d76a8fd523b24bd..c67f6d016b95c2f2274f528f6fa7d236ab329335 100644 --- a/src/lib_protocol_environment/environment_V3.mli +++ b/src/lib_protocol_environment/environment_V3.mli @@ -65,12 +65,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t and type ('a, 'b) Micheline.node = ('a, 'b) Micheline.node diff --git a/src/lib_protocol_environment/environment_V4.ml b/src/lib_protocol_environment/environment_V4.ml index 90cb9a248958ea82444ecb74927014d96afd4012..83e69daf352932d156e1eb78a0c0b479c4ee8743 100644 --- a/src/lib_protocol_environment/environment_V4.ml +++ b/src/lib_protocol_environment/environment_V4.ml @@ -70,12 +70,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t @@ -309,7 +303,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module Timelock = Timelock module S = struct @@ -578,70 +571,6 @@ struct (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V4.mli b/src/lib_protocol_environment/environment_V4.mli index f37d475da3ddc05be52f870498bddb6f845679f2..86bb09abed9b0dad6aa2a0b8b09ae9359b4fe778 100644 --- a/src/lib_protocol_environment/environment_V4.mli +++ b/src/lib_protocol_environment/environment_V4.mli @@ -65,12 +65,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t diff --git a/src/lib_protocol_environment/environment_V5.ml b/src/lib_protocol_environment/environment_V5.ml index 371ca9d9762707bd2bf45cb41d6f27451fe8a2f2..d4da242e9ddaf0caa7a8c5f6bee29f3197e2f076 100644 --- a/src/lib_protocol_environment/environment_V5.ml +++ b/src/lib_protocol_environment/environment_V5.ml @@ -75,12 +75,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t @@ -274,7 +268,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module Timelock = Timelock module S = struct @@ -549,70 +542,6 @@ struct (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V5.mli b/src/lib_protocol_environment/environment_V5.mli index de76e0cef942be2b9c65209851d0ad2b6cf73625..9f6b75249fb0477aaae257b5f7900d696993145e 100644 --- a/src/lib_protocol_environment/environment_V5.mli +++ b/src/lib_protocol_environment/environment_V5.mli @@ -76,12 +76,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t diff --git a/src/lib_protocol_environment/environment_V6.ml b/src/lib_protocol_environment/environment_V6.ml index 4fd7eaab2e4770d2fdd9c182861a8cbde532e044..902e538a6733da99b5290aa2a7d62cfb89fcfb5e 100644 --- a/src/lib_protocol_environment/environment_V6.ml +++ b/src/lib_protocol_environment/environment_V6.ml @@ -75,12 +75,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t @@ -279,7 +273,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module Timelock = Timelock module Vdf = Class_group_vdf.Vdf_self_contained @@ -555,70 +548,6 @@ struct (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V6.mli b/src/lib_protocol_environment/environment_V6.mli index 2768b599c2df1869b7f320aabd1f8b550d6f42d1..8a5936075483b01bba05be78f2d6140373d8aa69 100644 --- a/src/lib_protocol_environment/environment_V6.mli +++ b/src/lib_protocol_environment/environment_V6.mli @@ -76,12 +76,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t diff --git a/src/lib_protocol_environment/environment_V7.ml b/src/lib_protocol_environment/environment_V7.ml index b014ffa624f60b91512201f870b9a820d201a7ca..4530ec20f80d1ee8cadfb82bfa3975987ac8b5a0 100644 --- a/src/lib_protocol_environment/environment_V7.ml +++ b/src/lib_protocol_environment/environment_V7.ml @@ -75,12 +75,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t @@ -283,7 +277,6 @@ struct module Secp256k1 = Secp256k1 module P256 = P256 module Signature = Signature - module Pvss_secp256k1 = Pvss_secp256k1 module Timelock = Timelock module Vdf = Class_group_vdf.Vdf_self_contained @@ -559,70 +552,6 @@ struct (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - - module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t - end - - module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key - end - - module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t - end end module Error_core = struct diff --git a/src/lib_protocol_environment/environment_V7.mli b/src/lib_protocol_environment/environment_V7.mli index 0a32edac794ef0aec4e08cad7f57ab18b446826b..2606546d63ffc9d24efcd2aea688c5044ce3059a 100644 --- a/src/lib_protocol_environment/environment_V7.mli +++ b/src/lib_protocol_environment/environment_V7.mli @@ -75,12 +75,6 @@ module type T = sig and type Signature.public_key = Signature.public_key and type Signature.t = Signature.t and type Signature.watermark = Signature.watermark - and type Pvss_secp256k1.Commitment.t = Pvss_secp256k1.Commitment.t - and type Pvss_secp256k1.Encrypted_share.t = - Pvss_secp256k1.Encrypted_share.t - and type Pvss_secp256k1.Clear_share.t = Pvss_secp256k1.Clear_share.t - and type Pvss_secp256k1.Public_key.t = Pvss_secp256k1.Public_key.t - and type Pvss_secp256k1.Secret_key.t = Pvss_secp256k1.Secret_key.t and type Micheline.canonical_location = Micheline.canonical_location and type 'a Micheline.canonical = 'a Micheline.canonical and type Z.t = Z.t diff --git a/src/lib_protocol_environment/sigs/v1.in.ml b/src/lib_protocol_environment/sigs/v1.in.ml index 12545aa8e3155db988beed29a496532c709bfbf0..c5ac72cb6ed1a8a14a0f9e70624de0c6467a7053 100644 --- a/src/lib_protocol_environment/sigs/v1.in.ml +++ b/src/lib_protocol_environment/sigs/v1.in.ml @@ -93,8 +93,6 @@ module type T = sig module Context_hash : [%sig "v1/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v1/pvss_secp256k1.mli"] - module Sapling : [%sig "v1/sapling.mli"] module Micheline : [%sig "v1/micheline.mli"] diff --git a/src/lib_protocol_environment/sigs/v1.ml b/src/lib_protocol_environment/sigs/v1.ml index 901bc8de39a4d9acea8078959e8e143cd30e7c76..2f2ebff8378c9c020fb03528762cab8ff7345847 100644 --- a/src/lib_protocol_environment/sigs/v1.ml +++ b/src/lib_protocol_environment/sigs/v1.ml @@ -5747,70 +5747,6 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 64 "v1.in.ml" @@ -6444,40 +6380,6 @@ end # 94 "v1.in.ml" - module Pvss_secp256k1 : sig -# 1 "v1/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 96 "v1.in.ml" - - module Sapling : sig # 1 "v1/sapling.mli" (* The MIT License (MIT) @@ -6606,7 +6508,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 98 "v1.in.ml" +# 96 "v1.in.ml" module Micheline : sig @@ -6679,7 +6581,7 @@ val extract_locations : val inject_locations : (canonical_location -> 'l) -> 'p canonical -> ('l, 'p) node end -# 100 "v1.in.ml" +# 98 "v1.in.ml" module Block_header : sig @@ -6730,7 +6632,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 102 "v1.in.ml" +# 100 "v1.in.ml" module Fitness : sig @@ -6764,7 +6666,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 104 "v1.in.ml" +# 102 "v1.in.ml" module Operation : sig @@ -6808,7 +6710,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 106 "v1.in.ml" +# 104 "v1.in.ml" module Context : sig @@ -6875,7 +6777,7 @@ val register_resolver : val complete : t -> string -> string list Lwt.t end -# 108 "v1.in.ml" +# 106 "v1.in.ml" module Updater : sig @@ -7116,7 +7018,7 @@ val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t val fork_test_chain : Context.t -> protocol:Protocol_hash.t -> expiration:Time.t -> Context.t Lwt.t end -# 110 "v1.in.ml" +# 108 "v1.in.ml" module RPC_context : sig @@ -7271,6 +7173,6 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 112 "v1.in.ml" +# 110 "v1.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v1/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v1/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v1/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v1/s.mli b/src/lib_protocol_environment/sigs/v1/s.mli index f5986016a833c3c275376233d665ac1ed514f84b..c0cc3e7ebda469975ef1e651a3e857a41f899fb4 100644 --- a/src/lib_protocol_environment/sigs/v1/s.mli +++ b/src/lib_protocol_environment/sigs/v1/s.mli @@ -727,67 +727,3 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v2.in.ml b/src/lib_protocol_environment/sigs/v2.in.ml index 9a87fbc2f4ccab5cc8f158c9b6dc5ce8e1076fbc..093c3210998e674be9a6c49182a38f88dfae569c 100644 --- a/src/lib_protocol_environment/sigs/v2.in.ml +++ b/src/lib_protocol_environment/sigs/v2.in.ml @@ -97,8 +97,6 @@ module type T = sig module Context_hash : [%sig "v2/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v2/pvss_secp256k1.mli"] - module Sapling : [%sig "v2/sapling.mli"] module Micheline : [%sig "v2/micheline.mli"] diff --git a/src/lib_protocol_environment/sigs/v2.ml b/src/lib_protocol_environment/sigs/v2.ml index 630c378cf88a60d7fe3f2ec718422dd33276887d..809854d9fefbb21e1f733b81aef78c3a5f7c3468 100644 --- a/src/lib_protocol_environment/sigs/v2.ml +++ b/src/lib_protocol_environment/sigs/v2.ml @@ -5812,70 +5812,6 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 68 "v2.in.ml" @@ -6509,40 +6445,6 @@ end # 98 "v2.in.ml" - module Pvss_secp256k1 : sig -# 1 "v2/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 100 "v2.in.ml" - - module Sapling : sig # 1 "v2/sapling.mli" (* The MIT License (MIT) @@ -6671,7 +6573,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 102 "v2.in.ml" +# 100 "v2.in.ml" module Micheline : sig @@ -6744,7 +6646,7 @@ val extract_locations : val inject_locations : (canonical_location -> 'l) -> 'p canonical -> ('l, 'p) node end -# 104 "v2.in.ml" +# 102 "v2.in.ml" module Block_header : sig @@ -6795,7 +6697,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 106 "v2.in.ml" +# 104 "v2.in.ml" module Fitness : sig @@ -6829,7 +6731,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 108 "v2.in.ml" +# 106 "v2.in.ml" module Operation : sig @@ -6873,7 +6775,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 110 "v2.in.ml" +# 108 "v2.in.ml" module Context : sig @@ -7056,7 +6958,7 @@ val register_resolver : val complete : t -> string -> string list Lwt.t end -# 112 "v2.in.ml" +# 110 "v2.in.ml" module Updater : sig @@ -7297,7 +7199,7 @@ val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t val fork_test_chain : Context.t -> protocol:Protocol_hash.t -> expiration:Time.t -> Context.t Lwt.t end -# 114 "v2.in.ml" +# 112 "v2.in.ml" module RPC_context : sig @@ -7452,7 +7354,7 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 116 "v2.in.ml" +# 114 "v2.in.ml" module Equality_witness : sig @@ -7520,6 +7422,6 @@ val eq : 'a t -> 'b t -> ('a, 'b) eq option (** [hash id] returns a hash for [id]. *) val hash : 'a t -> int end -# 118 "v2.in.ml" +# 116 "v2.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v2/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v2/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v2/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v2/s.mli b/src/lib_protocol_environment/sigs/v2/s.mli index 42757d4d91768e68adde49849a15fc44a5650d82..bcd35301d6696361809adeda1020fc13a87dd071 100644 --- a/src/lib_protocol_environment/sigs/v2/s.mli +++ b/src/lib_protocol_environment/sigs/v2/s.mli @@ -729,67 +729,3 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v3.in.ml b/src/lib_protocol_environment/sigs/v3.in.ml index 7b03d980612761c64039a78b0a7618ab8809a8a6..a01f8a201147b6ff7ff2a654804c79e958c36a43 100644 --- a/src/lib_protocol_environment/sigs/v3.in.ml +++ b/src/lib_protocol_environment/sigs/v3.in.ml @@ -101,8 +101,6 @@ module type T = sig module Context_hash : [%sig "v3/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v3/pvss_secp256k1.mli"] - module Sapling : [%sig "v3/sapling.mli"] module Timelock : [%sig "v3/timelock.mli"] diff --git a/src/lib_protocol_environment/sigs/v3.ml b/src/lib_protocol_environment/sigs/v3.ml index c29ea5aeb23ddd9519eb7304d04541f02c2d91a2..5a1f2d41f12b79064e80ffb674012e3e482188b6 100644 --- a/src/lib_protocol_environment/sigs/v3.ml +++ b/src/lib_protocol_environment/sigs/v3.ml @@ -6722,70 +6722,6 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 76 "v3.in.ml" @@ -7298,40 +7234,6 @@ end # 102 "v3.in.ml" - module Pvss_secp256k1 : sig -# 1 "v3/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 104 "v3.in.ml" - - module Sapling : sig # 1 "v3/sapling.mli" (* The MIT License (MIT) @@ -7460,7 +7362,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 106 "v3.in.ml" +# 104 "v3.in.ml" module Timelock : sig @@ -7519,7 +7421,7 @@ val open_chest : chest -> chest_key -> time:int -> opening_result Used for gas accounting*) val get_plaintext_size : chest -> int end -# 108 "v3.in.ml" +# 106 "v3.in.ml" module Micheline : sig @@ -7592,7 +7494,7 @@ val extract_locations : val inject_locations : (canonical_location -> 'l) -> 'p canonical -> ('l, 'p) node end -# 110 "v3.in.ml" +# 108 "v3.in.ml" module Block_header : sig @@ -7643,7 +7545,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 112 "v3.in.ml" +# 110 "v3.in.ml" module Fitness : sig @@ -7677,7 +7579,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 114 "v3.in.ml" +# 112 "v3.in.ml" module Operation : sig @@ -7721,7 +7623,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 116 "v3.in.ml" +# 114 "v3.in.ml" module Context : sig @@ -8046,7 +7948,7 @@ module Cache : and type key = cache_key and type value = cache_value end -# 118 "v3.in.ml" +# 116 "v3.in.ml" module Updater : sig @@ -8345,7 +8247,7 @@ end not complete until [init] in invoked. *) val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t end -# 120 "v3.in.ml" +# 118 "v3.in.ml" module RPC_context : sig @@ -8500,6 +8402,6 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 122 "v3.in.ml" +# 120 "v3.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v3/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v3/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v3/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v3/s.mli b/src/lib_protocol_environment/sigs/v3/s.mli index 9f28370538e090f627bc0b8c31b5b9b05a7cc066..217848dcc1b442ab732b0a0efab762022f450b5c 100644 --- a/src/lib_protocol_environment/sigs/v3/s.mli +++ b/src/lib_protocol_environment/sigs/v3/s.mli @@ -354,67 +354,3 @@ module type PAIRING = sig val pairing : G1.t -> G2.t -> Gt.t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v4.in.ml b/src/lib_protocol_environment/sigs/v4.in.ml index 07afe4d2032dbb9134f85e049a51ae14c54398b7..88c1eab3e9b6343a63001feea9b422fcfacf7fa3 100644 --- a/src/lib_protocol_environment/sigs/v4.in.ml +++ b/src/lib_protocol_environment/sigs/v4.in.ml @@ -103,8 +103,6 @@ module type T = sig module Context_hash : [%sig "v4/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v4/pvss_secp256k1.mli"] - module Sapling : [%sig "v4/sapling.mli"] module Timelock : [%sig "v4/timelock.mli"] diff --git a/src/lib_protocol_environment/sigs/v4.ml b/src/lib_protocol_environment/sigs/v4.ml index eb28f77518fab8ee7b59012ced89f5c4bb722942..62fecfd9637709f101370e6e2c170a6ce1c37708 100644 --- a/src/lib_protocol_environment/sigs/v4.ml +++ b/src/lib_protocol_environment/sigs/v4.ml @@ -6825,70 +6825,6 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 76 "v4.in.ml" @@ -7467,40 +7403,6 @@ end # 104 "v4.in.ml" - module Pvss_secp256k1 : sig -# 1 "v4/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 106 "v4.in.ml" - - module Sapling : sig # 1 "v4/sapling.mli" (* The MIT License (MIT) @@ -7629,7 +7531,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 108 "v4.in.ml" +# 106 "v4.in.ml" module Timelock : sig @@ -7688,7 +7590,7 @@ val open_chest : chest -> chest_key -> time:int -> opening_result Used for gas accounting*) val get_plaintext_size : chest -> int end -# 110 "v4.in.ml" +# 108 "v4.in.ml" module Micheline : sig @@ -7748,7 +7650,7 @@ val annotations : ('l, 'p) node -> string list val strip_locations : (_, 'p) node -> 'p canonical end -# 112 "v4.in.ml" +# 110 "v4.in.ml" module Block_header : sig @@ -7799,7 +7701,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 114 "v4.in.ml" +# 112 "v4.in.ml" module Fitness : sig @@ -7833,7 +7735,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 116 "v4.in.ml" +# 114 "v4.in.ml" module Operation : sig @@ -7877,7 +7779,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 118 "v4.in.ml" +# 116 "v4.in.ml" module Context : sig @@ -8207,7 +8109,7 @@ module Cache : and type key = cache_key and type value = cache_value end -# 120 "v4.in.ml" +# 118 "v4.in.ml" module Updater : sig @@ -8508,7 +8410,7 @@ end not complete until [init] in invoked. *) val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t end -# 122 "v4.in.ml" +# 120 "v4.in.ml" module RPC_context : sig @@ -8663,6 +8565,6 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 124 "v4.in.ml" +# 122 "v4.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v4/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v4/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v4/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v4/s.mli b/src/lib_protocol_environment/sigs/v4/s.mli index 3bca106e31cbbc74635a6dd2071c7de96cfe3673..bc90eb890abb05aeb05a92157465e60d1548cba4 100644 --- a/src/lib_protocol_environment/sigs/v4/s.mli +++ b/src/lib_protocol_environment/sigs/v4/s.mli @@ -340,67 +340,3 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v5.in.ml b/src/lib_protocol_environment/sigs/v5.in.ml index 26a308b3df45591a9d408df43d34338fa45012a7..895f6d525d4dfbbf5484d7b0c8eb144d2e1b903f 100644 --- a/src/lib_protocol_environment/sigs/v5.in.ml +++ b/src/lib_protocol_environment/sigs/v5.in.ml @@ -105,8 +105,6 @@ module type T = sig module Context_hash : [%sig "v5/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v5/pvss_secp256k1.mli"] - module Sapling : [%sig "v5/sapling.mli"] module Timelock : [%sig "v5/timelock.mli"] diff --git a/src/lib_protocol_environment/sigs/v5.ml b/src/lib_protocol_environment/sigs/v5.ml index 12ee6b4383ffa989cfa7abd4c1192d971f8aa2db..ec1cede6ef50475620898cbd0845af4cde0930d0 100644 --- a/src/lib_protocol_environment/sigs/v5.ml +++ b/src/lib_protocol_environment/sigs/v5.ml @@ -8766,70 +8766,6 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 78 "v5.in.ml" @@ -9437,40 +9373,6 @@ end # 106 "v5.in.ml" - module Pvss_secp256k1 : sig -# 1 "v5/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 108 "v5.in.ml" - - module Sapling : sig # 1 "v5/sapling.mli" (* The MIT License (MIT) @@ -9616,7 +9518,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 110 "v5.in.ml" +# 108 "v5.in.ml" module Timelock : sig @@ -9675,7 +9577,7 @@ val open_chest : chest -> chest_key -> time:int -> opening_result Used for gas accounting*) val get_plaintext_size : chest -> int end -# 112 "v5.in.ml" +# 110 "v5.in.ml" module Micheline : sig @@ -9735,7 +9637,7 @@ val annotations : ('l, 'p) node -> string list val strip_locations : (_, 'p) node -> 'p canonical end -# 114 "v5.in.ml" +# 112 "v5.in.ml" module Block_header : sig @@ -9792,7 +9694,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 116 "v5.in.ml" +# 114 "v5.in.ml" module Bounded : sig @@ -9868,7 +9770,7 @@ module Int32 : sig module Make (_ : BOUNDS) : S end end -# 118 "v5.in.ml" +# 116 "v5.in.ml" module Fitness : sig @@ -9902,7 +9804,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 120 "v5.in.ml" +# 118 "v5.in.ml" module Operation : sig @@ -9946,7 +9848,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 122 "v5.in.ml" +# 120 "v5.in.ml" module Context : sig @@ -10583,7 +10485,7 @@ module Cache : and type key = cache_key and type value = cache_value end -# 124 "v5.in.ml" +# 122 "v5.in.ml" module Updater : sig @@ -10884,7 +10786,7 @@ end not complete until [init] in invoked. *) val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t end -# 126 "v5.in.ml" +# 124 "v5.in.ml" module RPC_context : sig @@ -11039,6 +10941,6 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 128 "v5.in.ml" +# 126 "v5.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v5/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v5/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v5/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v5/s.mli b/src/lib_protocol_environment/sigs/v5/s.mli index 48aa94450dc0294a8ba4355f4f45d2d90aebed19..9ebc0bc05202634bea446ac632474a99da2f0388 100644 --- a/src/lib_protocol_environment/sigs/v5/s.mli +++ b/src/lib_protocol_environment/sigs/v5/s.mli @@ -346,67 +346,3 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v6.in.ml b/src/lib_protocol_environment/sigs/v6.in.ml index 6941e8c0e19299e53f39525408b5010f67e6ccea..3d345550a8c70fc2b6f136dc080c3767febc5d8a 100644 --- a/src/lib_protocol_environment/sigs/v6.in.ml +++ b/src/lib_protocol_environment/sigs/v6.in.ml @@ -105,8 +105,6 @@ module type T = sig module Context_hash : [%sig "v6/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v6/pvss_secp256k1.mli"] - module Sapling : [%sig "v6/sapling.mli"] module Timelock : [%sig "v6/timelock.mli"] diff --git a/src/lib_protocol_environment/sigs/v6.ml b/src/lib_protocol_environment/sigs/v6.ml index 894282b169e2e47ba9650850bf5fc0b5bee83d20..682cca121978b43b1a99e8eb80a482a1f2c88e47 100644 --- a/src/lib_protocol_environment/sigs/v6.ml +++ b/src/lib_protocol_environment/sigs/v6.ml @@ -8766,70 +8766,6 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 78 "v6.in.ml" @@ -9437,40 +9373,6 @@ end # 106 "v6.in.ml" - module Pvss_secp256k1 : sig -# 1 "v6/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 108 "v6.in.ml" - - module Sapling : sig # 1 "v6/sapling.mli" (* The MIT License (MIT) @@ -9616,7 +9518,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 110 "v6.in.ml" +# 108 "v6.in.ml" module Timelock : sig @@ -9675,7 +9577,7 @@ val open_chest : chest -> chest_key -> time:int -> opening_result Used for gas accounting*) val get_plaintext_size : chest -> int end -# 112 "v6.in.ml" +# 110 "v6.in.ml" module Vdf : sig @@ -9763,7 +9665,7 @@ val prove : discriminant -> challenge -> difficulty -> result * proof @raise Invalid_argument when inputs are invalid *) val verify : discriminant -> challenge -> difficulty -> result -> proof -> bool end -# 114 "v6.in.ml" +# 112 "v6.in.ml" module Micheline : sig @@ -9823,7 +9725,7 @@ val annotations : ('l, 'p) node -> string list val strip_locations : (_, 'p) node -> 'p canonical end -# 116 "v6.in.ml" +# 114 "v6.in.ml" module Block_header : sig @@ -9880,7 +9782,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 118 "v6.in.ml" +# 116 "v6.in.ml" module Bounded : sig @@ -9958,7 +9860,7 @@ module Int32 : sig module NonNegative : S end end -# 120 "v6.in.ml" +# 118 "v6.in.ml" module Fitness : sig @@ -9992,7 +9894,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 122 "v6.in.ml" +# 120 "v6.in.ml" module Operation : sig @@ -10036,7 +9938,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 124 "v6.in.ml" +# 122 "v6.in.ml" module Context : sig @@ -10673,7 +10575,7 @@ module Cache : and type key = cache_key and type value = cache_value end -# 126 "v6.in.ml" +# 124 "v6.in.ml" module Updater : sig @@ -10978,7 +10880,7 @@ end not complete until [init] in invoked. *) val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t end -# 128 "v6.in.ml" +# 126 "v6.in.ml" module RPC_context : sig @@ -11133,7 +11035,7 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 130 "v6.in.ml" +# 128 "v6.in.ml" module Wasm_2_0_0 : sig @@ -11186,7 +11088,7 @@ module Make val get_info : Tree.tree -> info Lwt.t end end -# 132 "v6.in.ml" +# 130 "v6.in.ml" module Plonk : sig @@ -11271,6 +11173,6 @@ val verify_multi_circuits : proof -> bool end -# 134 "v6.in.ml" +# 132 "v6.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v6/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v6/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v6/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v6/s.mli b/src/lib_protocol_environment/sigs/v6/s.mli index 48aa94450dc0294a8ba4355f4f45d2d90aebed19..9ebc0bc05202634bea446ac632474a99da2f0388 100644 --- a/src/lib_protocol_environment/sigs/v6/s.mli +++ b/src/lib_protocol_environment/sigs/v6/s.mli @@ -346,67 +346,3 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_protocol_environment/sigs/v7.in.ml b/src/lib_protocol_environment/sigs/v7.in.ml index 0b091a3b9cefc93cdae48f08153dda54db3e79e1..1e080e8f75973b711985be5e1b3b37cfeedac2e5 100644 --- a/src/lib_protocol_environment/sigs/v7.in.ml +++ b/src/lib_protocol_environment/sigs/v7.in.ml @@ -109,8 +109,6 @@ module type T = sig module Context_hash : [%sig "v7/context_hash.mli"] - module Pvss_secp256k1 : [%sig "v7/pvss_secp256k1.mli"] - module Sapling : [%sig "v7/sapling.mli"] module Timelock : [%sig "v7/timelock.mli"] diff --git a/src/lib_protocol_environment/sigs/v7.ml b/src/lib_protocol_environment/sigs/v7.ml index 38e596ae410775a8ca87eddd56d3bf213a287c51..770ab6ab253718e057863e395094ef52b41e2ea5 100644 --- a/src/lib_protocol_environment/sigs/v7.ml +++ b/src/lib_protocol_environment/sigs/v7.ml @@ -9232,70 +9232,6 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end end # 82 "v7.in.ml" @@ -9903,40 +9839,6 @@ end # 110 "v7.in.ml" - module Pvss_secp256k1 : sig -# 1 "v7/pvss_secp256k1.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS -end -# 112 "v7.in.ml" - - module Sapling : sig # 1 "v7/sapling.mli" (* The MIT License (MIT) @@ -10082,7 +9984,7 @@ module Verification : sig val final_check : t -> UTXO.transaction -> string -> bool end end -# 114 "v7.in.ml" +# 112 "v7.in.ml" module Timelock : sig @@ -10141,7 +10043,7 @@ val open_chest : chest -> chest_key -> time:int -> opening_result Used for gas accounting*) val get_plaintext_size : chest -> int end -# 116 "v7.in.ml" +# 114 "v7.in.ml" module Vdf : sig @@ -10229,7 +10131,7 @@ val prove : discriminant -> challenge -> difficulty -> result * proof @raise Invalid_argument when inputs are invalid *) val verify : discriminant -> challenge -> difficulty -> result -> proof -> bool end -# 118 "v7.in.ml" +# 116 "v7.in.ml" module Micheline : sig @@ -10289,7 +10191,7 @@ val annotations : ('l, 'p) node -> string list val strip_locations : (_, 'p) node -> 'p canonical end -# 120 "v7.in.ml" +# 118 "v7.in.ml" module Block_header : sig @@ -10346,7 +10248,7 @@ type t = {shell : shell_header; protocol_data : bytes} include S.HASHABLE with type t := t and type hash := Block_hash.t end -# 122 "v7.in.ml" +# 120 "v7.in.ml" module Bounded : sig @@ -10495,7 +10397,7 @@ module Int8 (B : BOUNDS with type ocaml_type := int) : module Uint8 (B : BOUNDS with type ocaml_type := int) : S with type ocaml_type := int end -# 124 "v7.in.ml" +# 122 "v7.in.ml" module Fitness : sig @@ -10529,7 +10431,7 @@ end compared in a lexicographical order (longer list are greater). *) include S.T with type t = bytes list end -# 126 "v7.in.ml" +# 124 "v7.in.ml" module Operation : sig @@ -10573,7 +10475,7 @@ type t = {shell : shell_header; proto : bytes} include S.HASHABLE with type t := t and type hash := Operation_hash.t end -# 128 "v7.in.ml" +# 126 "v7.in.ml" module Context : sig @@ -11210,7 +11112,7 @@ module Cache : and type key = cache_key and type value = cache_value end -# 130 "v7.in.ml" +# 128 "v7.in.ml" module Updater : sig @@ -11522,7 +11424,7 @@ end not complete until [init] in invoked. *) val activate : Context.t -> Protocol_hash.t -> Context.t Lwt.t end -# 132 "v7.in.ml" +# 130 "v7.in.ml" module RPC_context : sig @@ -11677,7 +11579,7 @@ val make_opt_call3 : 'i -> 'o option shell_tzresult Lwt.t end -# 134 "v7.in.ml" +# 132 "v7.in.ml" module Wasm_2_0_0 : sig @@ -11730,7 +11632,7 @@ module Make val get_info : Tree.tree -> info Lwt.t end end -# 136 "v7.in.ml" +# 134 "v7.in.ml" module Plonk : sig @@ -11798,7 +11700,7 @@ val verify_multi_circuits : proof -> bool end -# 138 "v7.in.ml" +# 136 "v7.in.ml" module Dal : sig @@ -11904,6 +11806,6 @@ val verify_segment : [> `Degree_exceeds_srs_length of string | `Segment_index_out_of_range] ) Result.t end -# 140 "v7.in.ml" +# 138 "v7.in.ml" end diff --git a/src/lib_protocol_environment/sigs/v7/pvss_secp256k1.mli b/src/lib_protocol_environment/sigs/v7/pvss_secp256k1.mli deleted file mode 100644 index 49f1026bd6cbae1d25ca0be40a88327fc8a5bd8b..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v7/pvss_secp256k1.mli +++ /dev/null @@ -1,28 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* Copyright (c) 2020 Metastate AG *) -(* *) -(* Permission is hereby granted, free of charge, to any person obtaining a *) -(* copy of this software and associated documentation files (the "Software"),*) -(* to deal in the Software without restriction, including without limitation *) -(* the rights to use, copy, modify, merge, publish, distribute, sublicense, *) -(* and/or sell copies of the Software, and to permit persons to whom the *) -(* Software is furnished to do so, subject to the following conditions: *) -(* *) -(* The above copyright notice and this permission notice shall be included *) -(* in all copies or substantial portions of the Software. *) -(* *) -(* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR*) -(* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *) -(* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL *) -(* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER*) -(* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING *) -(* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER *) -(* DEALINGS IN THE SOFTWARE. *) -(* *) -(*****************************************************************************) - -(** Tezos - PVSS Secp256k1 cryptography *) - -include S.PVSS diff --git a/src/lib_protocol_environment/sigs/v7/s.mli b/src/lib_protocol_environment/sigs/v7/s.mli index 48aa94450dc0294a8ba4355f4f45d2d90aebed19..9ebc0bc05202634bea446ac632474a99da2f0388 100644 --- a/src/lib_protocol_environment/sigs/v7/s.mli +++ b/src/lib_protocol_environment/sigs/v7/s.mli @@ -346,67 +346,3 @@ module type CURVE = sig (** Multiply an element by a scalar *) val mul : t -> Scalar.t -> t end - -module type PVSS_ELEMENT = sig - type t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_PUBLIC_KEY = sig - type t - - val pp : Format.formatter -> t -> unit - - include Compare.S with type t := t - - include RAW_DATA with type t := t - - include B58_DATA with type t := t - - include ENCODER with type t := t -end - -module type PVSS_SECRET_KEY = sig - type public_key - - type t - - include ENCODER with type t := t - - val to_public_key : t -> public_key -end - -module type PVSS = sig - type proof - - module Clear_share : PVSS_ELEMENT - - module Commitment : PVSS_ELEMENT - - module Encrypted_share : PVSS_ELEMENT - - module Public_key : PVSS_PUBLIC_KEY - - module Secret_key : PVSS_SECRET_KEY with type public_key := Public_key.t - - val proof_encoding : proof Data_encoding.t - - val check_dealer_proof : - Encrypted_share.t list -> - Commitment.t list -> - proof:proof -> - public_keys:Public_key.t list -> - bool - - val check_revealed_share : - Encrypted_share.t -> - Clear_share.t -> - public_key:Public_key.t -> - proof -> - bool - - val reconstruct : Clear_share.t list -> int list -> Public_key.t -end diff --git a/src/lib_signer_backends/encrypted.ml b/src/lib_signer_backends/encrypted.ml index 200a4db78c1939df735e637280fe907c353baaf9..baa7341a9ce14503e987868b80343a8c5dada9b1 100644 --- a/src/lib_signer_backends/encrypted.ml +++ b/src/lib_signer_backends/encrypted.ml @@ -75,14 +75,6 @@ module Raw = struct in Bytes.cat salt (Crypto_box.Secretbox.secretbox key msg nonce) - let encrypt_pvss ~password sk = - let salt = Hacl.Rand.gen salt_len in - let key = Crypto_box.Secretbox.unsafe_of_bytes (pbkdf ~salt ~password) in - let msg = - Data_encoding.Binary.to_bytes_exn Pvss_secp256k1.Secret_key.encoding sk - in - Bytes.cat salt (Crypto_box.Secretbox.secretbox key msg nonce) - let decrypt algo ~password ~encrypted_sk = let open Lwt_result_syntax in let salt = Bytes.sub encrypted_sk 0 salt_len in @@ -565,12 +557,3 @@ struct let* sk = decrypt_aggregate C.cctxt sk_uri in return (Aggregate_signature.sign sk buf) end - -let encrypt_pvss_key cctxt sk = - let open Lwt_result_syntax in - let* password = read_password cctxt in - let payload = Raw.encrypt_pvss ~password sk in - let encoding = Encodings.secp256k1_scalar in - let path = Base58.simple_encode encoding payload in - let*? v = Client_keys.make_pvss_sk_uri (Uri.make ~scheme ~path ()) in - return v diff --git a/src/lib_signer_backends/encrypted.mli b/src/lib_signer_backends/encrypted.mli index 816aa173c3d2a9bc34754eb549b419dc9c5a1572..b0c37d4266bb2932c058b5a46ab79b6a91655549 100644 --- a/src/lib_signer_backends/encrypted.mli +++ b/src/lib_signer_backends/encrypted.mli @@ -75,8 +75,3 @@ val decrypt_sapling_key : #Client_context.io -> Client_keys.sapling_uri -> Tezos_sapling.Core.Wallet.Spending_key.t tzresult Lwt.t - -val encrypt_pvss_key : - #Client_context.io -> - Pvss_secp256k1.Secret_key.t -> - Client_keys.pvss_sk_uri tzresult Lwt.t