diff --git a/src/lib_protocol_environment/environment_V6.ml b/src/lib_protocol_environment/environment_V6.ml index 329598f1357b05c58350f40be1c91ee060629ba4..e3534dac5d7dce17188525f3e8200a24bf325aad 100644 --- a/src/lib_protocol_environment/environment_V6.ml +++ b/src/lib_protocol_environment/environment_V6.ml @@ -98,11 +98,6 @@ module type T = sig and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t and type Bls12_381.Fr.t = Bls12_381.Fr.t - and type Plonk.transcript = - Tezos_protocol_environment_structs.V6.Plonk.transcript - and type Plonk.proof = Tezos_protocol_environment_structs.V6.Plonk.proof - and type Plonk.verifier_public_parameters = - Tezos_protocol_environment_structs.V6.Plonk.verifier_public_parameters type error += Ecoproto_error of Error_monad.error @@ -1504,5 +1499,4 @@ struct end module Equality_witness = Environment_context.Equality_witness - module Plonk = Tezos_protocol_environment_structs.V6.Plonk end diff --git a/src/lib_protocol_environment/environment_V6.mli b/src/lib_protocol_environment/environment_V6.mli index 88ec5f31074a42ae36bed75b9657b53428f03ac8..4ab46ce7473f7ee81d3b92f25577b19beddbffe9 100644 --- a/src/lib_protocol_environment/environment_V6.mli +++ b/src/lib_protocol_environment/environment_V6.mli @@ -99,11 +99,6 @@ module type T = sig and type Bls_signature.signature = Bls12_381_signature.MinPk.signature and type ('a, 'b) Either.t = ('a, 'b) Stdlib.Either.t and type Bls12_381.Fr.t = Bls12_381.Fr.t - and type Plonk.transcript = - Tezos_protocol_environment_structs.V6.Plonk.transcript - and type Plonk.proof = Tezos_protocol_environment_structs.V6.Plonk.proof - and type Plonk.verifier_public_parameters = - Tezos_protocol_environment_structs.V6.Plonk.verifier_public_parameters (** An [Ecoproto_error e] is a shell error that carry a protocol error. diff --git a/src/lib_protocol_environment/sigs/v6.in.ml b/src/lib_protocol_environment/sigs/v6.in.ml index 3d345550a8c70fc2b6f136dc080c3767febc5d8a..da8b54d9faf6598d50c25159de499bc6e2734a60 100644 --- a/src/lib_protocol_environment/sigs/v6.in.ml +++ b/src/lib_protocol_environment/sigs/v6.in.ml @@ -128,6 +128,4 @@ module type T = sig module RPC_context : [%sig "v6/RPC_context.mli"] module Wasm_2_0_0 : [%sig "v6/wasm_2_0_0.mli"] - - module Plonk : [%sig "v6/plonk.mli"] end diff --git a/src/lib_protocol_environment/sigs/v6.ml b/src/lib_protocol_environment/sigs/v6.ml index 682cca121978b43b1a99e8eb80a482a1f2c88e47..604c60c97c72b8dfc1698769d8b20bcfc206a817 100644 --- a/src/lib_protocol_environment/sigs/v6.ml +++ b/src/lib_protocol_environment/sigs/v6.ml @@ -11090,89 +11090,4 @@ end end # 130 "v6.in.ml" - - module Plonk : sig -# 1 "v6/plonk.mli" -(*****************************************************************************) -(* *) -(* Open Source License *) -(* 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. *) -(* *) -(*****************************************************************************) - -type scalar := Bls12_381.Fr.t - -module Array : sig - val concat : 'a array list -> 'a array - - val length : 'a array -> int - - val to_list : 'a array -> 'a list -end - -type transcript - -type verifier_public_parameters - -type proof - -val verifier_public_parameters_encoding : - verifier_public_parameters Data_encoding.t - -val proof_encoding : proof Data_encoding.t - -val transcript_encoding : transcript Data_encoding.t - -val scalar_encoding : scalar Data_encoding.t - -(** Verifier function: checks proof - Inputs: - - transcript: transcript initialized with SRS - - public_parameters: output of setup - - public_inputs (scalar array): the first values of private_inputs that are public - - proof: output of prove - Outputs: - - bool -*) -val verify : - verifier_public_parameters * transcript -> - public_inputs:scalar array -> - proof -> - bool - -(** Verifier function: checks a bunch of proofs for several circuits - Inputs: - - transcript: transcript initialized with SRS - - public_parameters: output of setup_multi_circuits for the circuits being checked - - public_inputs: StringMap where the lists of public inputs are binded with the circuit to which they correspond - - proof: the unique proof that correspond to all inputs - Outputs: - - bool -*) -val verify_multi_circuits : - verifier_public_parameters * transcript -> - public_inputs:(string * scalar array list) list -> - proof -> - bool -end -# 132 "v6.in.ml" - end diff --git a/src/lib_protocol_environment/sigs/v6/plonk.mli b/src/lib_protocol_environment/sigs/v6/plonk.mli deleted file mode 100644 index 678d012f584f879142c4f276cf38300858d6f888..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/sigs/v6/plonk.mli +++ /dev/null @@ -1,79 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* 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. *) -(* *) -(*****************************************************************************) - -type scalar := Bls12_381.Fr.t - -module Array : sig - val concat : 'a array list -> 'a array - - val length : 'a array -> int - - val to_list : 'a array -> 'a list -end - -type transcript - -type verifier_public_parameters - -type proof - -val verifier_public_parameters_encoding : - verifier_public_parameters Data_encoding.t - -val proof_encoding : proof Data_encoding.t - -val transcript_encoding : transcript Data_encoding.t - -val scalar_encoding : scalar Data_encoding.t - -(** Verifier function: checks proof - Inputs: - - transcript: transcript initialized with SRS - - public_parameters: output of setup - - public_inputs (scalar array): the first values of private_inputs that are public - - proof: output of prove - Outputs: - - bool -*) -val verify : - verifier_public_parameters * transcript -> - public_inputs:scalar array -> - proof -> - bool - -(** Verifier function: checks a bunch of proofs for several circuits - Inputs: - - transcript: transcript initialized with SRS - - public_parameters: output of setup_multi_circuits for the circuits being checked - - public_inputs: StringMap where the lists of public inputs are binded with the circuit to which they correspond - - proof: the unique proof that correspond to all inputs - Outputs: - - bool -*) -val verify_multi_circuits : - verifier_public_parameters * transcript -> - public_inputs:(string * scalar array list) list -> - proof -> - bool diff --git a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml index dee2a27d0959ee511aa0c21b34bd1930d8d470c5..2acdbf869f0727ab51ded9ee9446a883656cb2cd 100644 --- a/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml +++ b/src/lib_protocol_environment/structs/tezos_protocol_environment_structs.ml @@ -100,7 +100,6 @@ end module V6 = struct module Data_encoding = V5_data_encoding module Error_monad_infix_globals = V0_error_monad_infix_globals - module Plonk = V6_plonk module Bounded = V5_bounded module RPC_directory = V0_RPC_directory end diff --git a/src/lib_protocol_environment/structs/v6_plonk.ml b/src/lib_protocol_environment/structs/v6_plonk.ml deleted file mode 100644 index 4259eadc9fb9e2f8e42459cc2c9e535c095d25cd..0000000000000000000000000000000000000000 --- a/src/lib_protocol_environment/structs/v6_plonk.ml +++ /dev/null @@ -1,48 +0,0 @@ -(*****************************************************************************) -(* *) -(* Open Source License *) -(* 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. *) -(* *) -(*****************************************************************************) - -include Plonk.Main_protocol - -module Array = struct - let concat = Stdlib.Array.concat - - let length = Stdlib.Array.length - - let to_list = Stdlib.Array.to_list -end - -let verify pp ~public_inputs proof = - Result.fold ~ok:Fun.id ~error:(Fun.const false) - @@ Tezos_lwt_result_stdlib.Lwtreslib.Bare.Result.catch (fun () -> - fst @@ verify pp ~public_inputs proof) - -let verify_multi_circuits pp ~public_inputs proof = - Result.fold ~ok:Fun.id ~error:(Fun.const false) - @@ Tezos_lwt_result_stdlib.Lwtreslib.Bare.Result.catch (fun () -> - fst - @@ verify_multi_circuits - pp - ~public_inputs:(SMap.of_list public_inputs) - proof)