zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_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 BACS.
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 BACS-to-R1CS reduction, and
40 // (2) a ppzkSNARK for R1CS.
41 //
42 //
43 // Acronyms:
44 //
45 // - BACS = "Bilinear Arithmetic Circuit Satisfiability"
46 // - R1CS = "Rank-1 Constraint System"
47 // - ppzkSNARK = "PreProcessing Zero-Knowledge Succinct Non-interactive ARgument of Knowledge"
48 //---------------------------------------------------------------------------//
49 
50 #ifndef CRYPTO3_ZK_BACS_PPZKSNARK_TYPES_POLICY_HPP
51 #define CRYPTO3_ZK_BACS_PPZKSNARK_TYPES_POLICY_HPP
52 
53 #include <nil/crypto3/zk/snark/schemes/ppzksnark/bacs_ppzksnark/proving_key.hpp>
54 #include <nil/crypto3/zk/snark/schemes/ppzksnark/bacs_ppzksnark/keypair.hpp>
55 
56 namespace nil {
57  namespace crypto3 {
58  namespace zk {
59  namespace snark {
60  namespace detail {
61 
62  template<typename CurveType>
64  typedef CurveType curve_type;
65 
66  /******************************** Params ********************************/
67 
73 
75 
77 
78  /******************************** Proving key ********************************/
79 
84 
85  /******************************* Verification key ****************************/
86 
91 
92  /************************ Processed verification key *************************/
93 
103 
104  /********************************** Key pair *********************************/
105 
110 
111  /*********************************** Proof ***********************************/
112 
117  };
118  } // namespace detail
119  } // namespace snark
120  } // namespace zk
121  } // namespace crypto3
122 } // namespace nil
123 
124 #endif // CRYPTO3_ZK_BACS_PPZKSNARK_TYPES_POLICY_HPP
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_ppzksnark/verification_key.hpp:102
Definition: snark/systems/ppzksnark/r1cs_ppzksnark/proof.hpp:43
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_ppzksnark/verification_key.hpp:42
bacs_variable_assignment< FieldType > bacs_auxiliary_input
Definition: bacs.hpp:95
std::pair< ProvingKey, VerificationKey > bacs_ppzksnark_keypair
Definition: systems/ppzksnark/bacs_ppzksnark/keypair.hpp:36
bacs_variable_assignment< FieldType > bacs_primary_input
Definition: bacs.hpp:89
Definition: pair.hpp:31
Definition: systems/ppzksnark/bacs_ppzksnark/proving_key.hpp:37
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:63
bacs_circuit< typename curve_type::scalar_field_type > circuit_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:72
bacs_primary_input< typename curve_type::scalar_field_type > primary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:74
bacs_ppzksnark_proving_key< curve_type, circuit_type > proving_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:83
bacs_ppzksnark_keypair< proving_key_type, verification_key_type > keypair_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:109
r1cs_ppzksnark< CurveType >::proof_type proof_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:116
r1cs_ppzksnark< CurveType >::processed_verification_key_type processed_verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:102
bacs_auxiliary_input< typename curve_type::scalar_field_type > auxiliary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:76
CurveType curve_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:64
r1cs_ppzksnark< curve_type >::verification_key_type verification_key_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/bacs_ppzksnark/detail/basic_policy.hpp:90