zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_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 USCS.
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 instantiates the protocol of \[DFGK14], by following
39 // extending, and optimizing the approach described in \[BCTV14].
40 //
41 //
42 // Acronyms:
43 //
44 // - "ppzkSNARK" = "Pre-Processing Zero-Knowledge Succinct Non-interactive ARgument of Knowledge"
45 // - "USCS" = "Unitary-Square Constraint Systems"
46 //
47 // References:
48 //
49 // \[BCTV14]:
50 // "Succinct Non-Interactive Zero Knowledge for a von Neumann Architecture",
51 // Eli Ben-Sasson, Alessandro Chiesa, Eran Tromer, Madars Virza,
52 // USENIX Security 2014,
53 // <http://eprint.iacr.org/2013/879>
54 //
55 // \[DFGK14]:
56 // "Square Span Programs with Applications to Succinct NIZK Arguments"
57 // George Danezis, Cedric Fournet, Jens Groth, Markulf Kohlweiss,
58 // ASIACRYPT 2014,
59 // <http://eprint.iacr.org/2014/718>
60 //---------------------------------------------------------------------------//
61 
62 #ifndef CRYPTO3_USCS_PPZKSNARK_TYPES_POLICY_HPP
63 #define CRYPTO3_USCS_PPZKSNARK_TYPES_POLICY_HPP
64 
67 #include <nil/crypto3/zk/snark/schemes/ppzksnark/uscs_ppzksnark/proving_key.hpp>
68 #include <nil/crypto3/zk/snark/schemes/ppzksnark/uscs_ppzksnark/verification_key.hpp>
69 #include <nil/crypto3/zk/snark/schemes/ppzksnark/uscs_ppzksnark/keypair.hpp>
70 #include <nil/crypto3/zk/snark/schemes/ppzksnark/uscs_ppzksnark/proof.hpp>
71 
72 namespace nil {
73  namespace crypto3 {
74  namespace zk {
75  namespace snark {
76  namespace detail {
77  template<typename CurveType>
79 
80  /******************************** Params ********************************/
81 
87 
89 
91 
92  /******************************** Proving key ********************************/
93 
98 
99  /******************************* Verification key ****************************/
100 
105 
106  /************************ Processed verification key *************************/
107 
116 
117  /********************************** Key pair *********************************/
118 
123 
124  /*********************************** Proof ***********************************/
125 
134  };
135  } // namespace detail
136  } // namespace snark
137  } // namespace zk
138  } // namespace crypto3
139 } // namespace nil
140 
141 #endif // CRYPTO3_USCS_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: systems/ppzksnark/uscs_ppzksnark/proving_key.hpp:39
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/verification_key.hpp:42
std::pair< ProvingKey, VerificationKey > uscs_ppzksnark_keypair
Definition: systems/ppzksnark/uscs_ppzksnark/keypair.hpp:36
std::vector< typename FieldType::value_type > uscs_auxiliary_input
Definition: uscs.hpp:70
std::vector< typename FieldType::value_type > uscs_primary_input
Definition: uscs.hpp:67
Definition: pair.hpp:31
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:78
uscs_ppzksnark_verification_key< CurveType > verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:104
uscs_auxiliary_input< typename CurveType::scalar_field_type > auxiliary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:90
uscs_primary_input< typename CurveType::scalar_field_type > primary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:88
uscs_ppzksnark_keypair< proving_key_type, verification_key_type > keypair_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:122
uscs_ppzksnark_proof< CurveType > proof_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:133
uscs_ppzksnark_proving_key< CurveType, constraint_system_type > proving_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:97
uscs_ppzksnark_processed_verification_key< CurveType > processed_verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:115
uscs_constraint_system< typename CurveType::scalar_field_type > constraint_system_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/uscs_ppzksnark/detail/basic_policy.hpp:86