zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2018-2021 Mikhail Komarov <nemo@nil.foundation>
3 // Copyright (c) 2020-2021 Nikita Kaskov <nbering@nil.foundation>
4 //
5 // MIT License
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in all
15 // copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 // SOFTWARE.
24 //---------------------------------------------------------------------------//
25 // @file Declaration of interfaces for a ppzkSNARK for TBCS.
26 //
27 // This includes:
28 // - class for proving key
29 // - class for verification key
30 // - class for processed verification key
31 // - class for key pair (proving key & verification key)
32 // - class for proof
33 // - generator algorithm
34 // - prover algorithm
35 // - verifier algorithm (with strong or weak input consistency)
36 // - online verifier algorithm (with strong or weak input consistency)
37 //
38 // The implementation is a straightforward combination of:
39 // (1) a TBCS-to-USCS reduction, and
40 // (2) a ppzkSNARK for USCS.
41 //
42 //
43 // Acronyms:
44 //
45 // - TBCS = "Two-input Boolean Circuit Satisfiability"
46 // - USCS = "Unitary-Square Constraint System"
47 // - ppzkSNARK = "PreProcessing Zero-Knowledge Succinct Non-interactive ARgument of Knowledge"
48 //---------------------------------------------------------------------------//
49 
50 #ifndef CRYPTO3_ZK_TBCS_PPZKSNARK_TYPES_POLICY_HPP
51 #define CRYPTO3_ZK_TBCS_PPZKSNARK_TYPES_POLICY_HPP
52 
53 #include <nil/crypto3/zk/snark/schemes/ppzksnark/tbcs_ppzksnark/proving_key.hpp>
54 #include <nil/crypto3/zk/snark/schemes/ppzksnark/tbcs_ppzksnark/keypair.hpp>
55 
58 
59 namespace nil {
60  namespace crypto3 {
61  namespace zk {
62  namespace snark {
63  namespace detail {
64 
65  template<typename CurveType>
67 
68  /******************************** Params ********************************/
69 
75 
77 
79 
80  /******************************** Proving key ********************************/
81 
86 
87  /******************************* Verification key ****************************/
88 
93 
94  /************************ Processed verification key *************************/
95 
105 
106  /********************************** Key pair *********************************/
107 
112 
113  /*********************************** Proof ***********************************/
114 
119  };
120  } // namespace detail
121  } // namespace snark
122  } // namespace zk
123  } // namespace crypto3
124 } // namespace nil
125 
126 #endif // CRYPTO3_ZK_TBCS_PPZKSNARK_TYPES_POLICY_HPP
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/verification_key.hpp:87
Definition: snark/systems/ppzksnark/uscs_ppzksnark/proof.hpp:41
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/verification_key.hpp:42
std::pair< ProvingKey, VerificationKey > tbcs_ppzksnark_keypair
Definition: systems/ppzksnark/tbcs_ppzksnark/keypair.hpp:39
tbcs_variable_assignment tbcs_primary_input
Definition: tbcs.hpp:140
tbcs_variable_assignment tbcs_auxiliary_input
Definition: tbcs.hpp:145
Definition: pair.hpp:31
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:66
tbcs_auxiliary_input auxiliary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:78
uscs_ppzksnark< CurveType >::verification_key_type verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:92
tbcs_primary_input primary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:76
uscs_ppzksnark< CurveType >::processed_verification_key_type processed_verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:104
uscs_ppzksnark< CurveType >::proof_type proof_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:118
tbcs_circuit circuit_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:74
tbcs_ppzksnark_proving_key< CurveType, circuit_type > proving_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:85
tbcs_ppzksnark_keypair< proving_key_type, verification_key_type > keypair_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/tbcs_ppzksnark/detail/basic_policy.hpp:111
Definition: systems/ppzksnark/tbcs_ppzksnark/proving_key.hpp:39