r1cs_gg_ppzksnark/encrypted_input/generator.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 // Copyright (c) 2020-2021 Ilias Khairullin <ilias@nil.foundation>
5 //
6 // MIT License
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 //---------------------------------------------------------------------------//
26 
27 #ifndef CRYPTO3_ZK_R1CS_GG_PPZKSNARK_ENCRYPTED_INPUT_GENERATOR_HPP
28 #define CRYPTO3_ZK_R1CS_GG_PPZKSNARK_ENCRYPTED_INPUT_GENERATOR_HPP
29 
31 
32 namespace nil {
33  namespace crypto3 {
34  namespace zk {
35  namespace snark {
36  template<typename CurveType>
38 
41 
42  typedef typename CurveType::scalar_field_type scalar_field_type;
43  typedef typename CurveType::template g1_type<> g1_type;
44  typedef typename CurveType::template g2_type<> g2_type;
45  typedef typename CurveType::gt_type gt_type;
46 
47  public:
51 
54 
57 
58  template<typename KeyPairType,
59  typename DistributionType =
60  boost::random::uniform_int_distribution<typename scalar_field_type::integral_type>,
61  typename GeneratorType = boost::random::mt19937>
62  static inline
63  typename std::enable_if<std::is_same<keypair_type, KeyPairType>::value, KeyPairType>::type
64  process(const constraint_system_type &constraint_system) {
65 
66  return basic_generator_type::template process<keypair_type, DistributionType, GeneratorType>(
67  constraint_system);
68  }
69  };
70  } // namespace snark
71  } // namespace zk
72  } // namespace crypto3
73 } // namespace nil
74 
75 #endif // CRYPTO3_ZK_R1CS_GG_PPZKSNARK_ENCRYPTED_INPUT_GENERATOR_HPP
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_gg_ppzksnark/detail/basic_policy.hpp:248
basic_policy::primary_input_type primary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_gg_ppzksnark/detail/basic_policy.hpp:263
basic_policy::extended_keypair_type keypair_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_gg_ppzksnark/detail/basic_policy.hpp:288
basic_policy::auxiliary_input_type auxiliary_input_type
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_gg_ppzksnark/detail/basic_policy.hpp:265
policy_type::primary_input_type primary_input_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:49
policy_type::constraint_system_type constraint_system_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:48
policy_type::auxiliary_input_type auxiliary_input_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:50
policy_type::proving_key_type proving_key_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:52
policy_type::keypair_type keypair_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:55
static std::enable_if< std::is_same< keypair_type, KeyPairType >::value, KeyPairType >::type process(const constraint_system_type &constraint_system)
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:64
policy_type::verification_key_type verification_key_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:53
policy_type::proof_type proof_type
Definition: r1cs_gg_ppzksnark/encrypted_input/generator.hpp:56
Definition: r1cs_gg_ppzksnark/generator.hpp:49
ProvingMode
Definition: modes.hpp:33
Definition: pair.hpp:31
Definition: zk/include/nil/crypto3/zk/snark/systems/ppzksnark/r1cs_gg_ppzksnark/verification_key.hpp:121
Definition: snark/systems/ppzksnark/r1cs_gg_ppzksnark/proof.hpp:40
Definition: systems/ppzksnark/r1cs_gg_ppzksnark/proving_key.hpp:39