verifiable_encryption.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2021 Mikhail Komarov <nemo@nil.foundation>
3 // Copyright (c) 2021 Ilias Khairullin <ilias@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 
26 #ifndef CRYPTO3_PUBKEY_VERIFIABLE_ENCRYPTION_MODE_HPP
27 #define CRYPTO3_PUBKEY_VERIFIABLE_ENCRYPTION_MODE_HPP
28 
29 #include <type_traits>
30 
33 
40 
41 namespace nil {
42  namespace crypto3 {
43  namespace pubkey {
44  namespace detail {
45  template<typename Scheme, template<typename, typename = void> class Operation>
47  typedef Scheme scheme_type;
48 
49  typedef Operation<scheme_type> op_type;
50  typedef typename op_type::internal_accumulator_type internal_accumulator_type;
51  typedef typename op_type::result_type result_type;
52 
53  template<typename... Args>
54  static inline internal_accumulator_type init_accumulator(Args &...args) {
55  return op_type::init_accumulator(args...);
56  }
57 
58  template<typename... Args>
59  inline static void update(Args &...args) {
60  op_type::update(args...);
61  }
62 
63  template<typename... Args>
64  static inline result_type process(Args &...args) {
65  return op_type::process(args...);
66  }
67  };
68  } // namespace detail
69 
70  namespace modes {
84  template<typename Scheme>
86  typedef Scheme scheme_type;
87 
97  };
98  } // namespace modes
99  } // namespace pubkey
100  } // namespace crypto3
101 } // namespace nil
102 
103 #endif // CRYPTO3_PUBKEY_VERIFIABLE_ENCRYPTION_MODE_HPP
boost::mpl::apply< AccumulatorSet, tag::pubkey< ProcessingMode > >::type::result_type pubkey(const AccumulatorSet &acc)
Definition: accumulators/pubkey.hpp:106
Definition: pair.hpp:31
Definition: verifiable_encryption.hpp:46
op_type::internal_accumulator_type internal_accumulator_type
Definition: verifiable_encryption.hpp:50
Scheme scheme_type
Definition: verifiable_encryption.hpp:47
static internal_accumulator_type init_accumulator(Args &...args)
Definition: verifiable_encryption.hpp:54
static void update(Args &...args)
Definition: verifiable_encryption.hpp:59
op_type::result_type result_type
Definition: verifiable_encryption.hpp:51
static result_type process(Args &...args)
Definition: verifiable_encryption.hpp:64
Operation< scheme_type > op_type
Definition: verifiable_encryption.hpp:49
Definition: verifiable_encryption.hpp:85
detail::verifiable_encryption< scheme_type, decrypt_op > decryption_policy
Definition: verifiable_encryption.hpp:90
detail::verifiable_encryption< scheme_type, encrypt_op > encryption_policy
Definition: verifiable_encryption.hpp:89
detail::verifiable_encryption< scheme_type, generate_keypair_op > keypair_generation_policy
Definition: verifiable_encryption.hpp:88
detail::verifiable_encryption< scheme_type, verify_decryption_op > decryption_verification_policy
Definition: verifiable_encryption.hpp:94
detail::verifiable_encryption< scheme_type, rerandomize_op > rerandomization_policy
Definition: verifiable_encryption.hpp:96
detail::verifiable_encryption< scheme_type, verify_encryption_op > encryption_verification_policy
Definition: verifiable_encryption.hpp:92
Scheme scheme_type
Definition: verifiable_encryption.hpp:86