prove.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2020-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_SNARK_ALGORITHMS_PROVE_HPP
28 #define CRYPTO3_ZK_SNARK_ALGORITHMS_PROVE_HPP
29 
30 namespace nil {
31  namespace crypto3 {
32  namespace zk {
33  namespace snark {
34  template<typename ProofSystemType>
35  typename ProofSystemType::proof_type
36  prove(const typename ProofSystemType::proving_key_type &pk,
37  const typename ProofSystemType::primary_input_type &primary_input,
38  const typename ProofSystemType::auxiliary_input_type &auxiliary_input) {
39 
40  return ProofSystemType::prove(pk, primary_input, auxiliary_input);
41  }
42 
43  template<typename ProofSystemType,
44  typename Hash,
45  typename InputTranscriptIncludeIterator,
46  typename InputProofIterator>
47  typename ProofSystemType::proof_type prove(const typename ProofSystemType::proving_srs_type &srs,
48  InputTranscriptIncludeIterator transcript_include_first,
49  InputTranscriptIncludeIterator transcript_include_last,
50  InputProofIterator proofs_first,
51  InputProofIterator proofs_last) {
52 
53  return ProofSystemType::template prove<Hash>(
54  srs, transcript_include_first, transcript_include_last, proofs_first, proofs_last);
55  }
56 
57  template<typename ProofSystemType, typename PublicKey, typename ScalarValue>
58  typename ProofSystemType::proof_type
59  prove(const typename ProofSystemType::proving_key_type &pk,
60  const PublicKey &pubkey,
61  const typename ProofSystemType::primary_input_type &primary_input,
62  const typename ProofSystemType::auxiliary_input_type &auxiliary_input,
63  const ScalarValue &r) {
64 
65  return ProofSystemType::prove(pk, pubkey, primary_input, auxiliary_input, r);
66  }
67  } // namespace snark
68  } // namespace zk
69  } // namespace crypto3
70 } // namespace nil
71 
72 #endif // CRYPTO3_ZK_SNARK_ALGORITHMS_HPP
boost::mpl::apply< AccumulatorSet, tag::pubkey< ProcessingMode > >::type::result_type pubkey(const AccumulatorSet &acc)
Definition: accumulators/pubkey.hpp:106
ProofSystemType::proof_type prove(const typename ProofSystemType::proving_key_type &pk, const typename ProofSystemType::primary_input_type &primary_input, const typename ProofSystemType::auxiliary_input_type &auxiliary_input)
Definition: prove.hpp:36
ProofSystemType::proof_type prove(const typename ProofSystemType::proving_key_type &pk, const PublicKey &pubkey, const typename ProofSystemType::primary_input_type &primary_input, const typename ProofSystemType::auxiliary_input_type &auxiliary_input, const ScalarValue &r)
Definition: prove.hpp:59
Definition: pair.hpp:31