SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
secure_extremum_selection_server.h
Go to the documentation of this file.
1 /*
2 SeComLib
3 Copyright 2012-2013 TU Delft, Information Security & Privacy Lab (http://isplab.tudelft.nl/)
4 
5 Contributors:
6 Inald Lagendijk (R.L.Lagendijk@TUDelft.nl)
7 Mihai Todor (todormihai@gmail.com)
8 Thijs Veugen (P.J.M.Veugen@tudelft.nl)
9 Zekeriya Erkin (z.erkin@tudelft.nl)
10 
11 Licensed under the Apache License, Version 2.0 (the "License");
12 you may not use this file except in compliance with the License.
13 You may obtain a copy of the License at
14 
15 http://www.apache.org/licenses/LICENSE-2.0
16 
17 Unless required by applicable law or agreed to in writing, software
18 distributed under the License is distributed on an "AS IS" BASIS,
19 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 See the License for the specific language governing permissions and
21 limitations under the License.
22 */
29 #ifndef SECURE_EXTREMUM_SELECTION_SERVER_HEADER_GUARD
30 #define SECURE_EXTREMUM_SELECTION_SERVER_HEADER_GUARD
31 
32 //include our headers
33 #include "utils/config.h"
34 #include "big_integer.h"
35 #include "random_provider.h"
36 #include "randomizer_cache.h"
37 #include "paillier.h"
38 #include "dgk.h"
40 
42 
43 namespace SeComLib {
44 namespace Core {
45  //forward-declare required classes
46  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
47  class SecureExtremumSelectionClient;
48 
54  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
55  class SecureExtremumSelectionServer {
56  public:
58  typedef std::vector<Paillier::Ciphertext> ItemContainer;
59 
61  SecureExtremumSelectionServer (const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath);
62 
65 
67  Paillier::Ciphertext GetMinimum (const ItemContainer &items) const;
68 
70  Paillier::Ciphertext GetMaximum (const ItemContainer &items) const;
71 
74 
76  const std::shared_ptr<T_SecureComparisonServer> &GetSecureComparisonServer () const;
77 
79  const std::shared_ptr<SecureMultiplicationServer<Paillier>> &GetSecureMultiplicationServer () const;
80 
81  private:
84 
87 
89  std::weak_ptr<const SecureExtremumSelectionClient<T_SecureComparisonServer, T_SecureComparisonClient>> secureExtremumSelectionClient;
90 
92  const std::shared_ptr<T_SecureComparisonServer> secureComparisonServer;
93 
95  const std::shared_ptr<SecureMultiplicationServer<Paillier>> secureMultiplicationServer;
96 
99 
102  };
103 }//namespace Core
104 }//namespace SeComLib
105 
106 //Separate the implementation from the declaration of template methods
108 
109 #endif//SECURE_EXTREMUM_SELECTION_SERVER_HEADER_GUARD
SecureExtremumSelectionServer(const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath)
Constructor.
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
Definition of class Dgk.
std::weak_ptr< const SecureExtremumSelectionClient< T_SecureComparisonServer, T_SecureComparisonClient > > secureExtremumSelectionClient
A reference to the SecureExtremumSelectionClient.
const Dgk & dgkCryptoProvider
Reference to the DGK crypto provider.
Paillier::Ciphertext GetMinimum(const ItemContainer &items) const
Interactive secure minimum selection.
Definition of template class RandomizerCache.
Defines BigInteger.
Definition of class Config.
const std::shared_ptr< T_SecureComparisonServer > & GetSecureComparisonServer() const
Getter for this->secureComparisonServer.
const std::shared_ptr< T_SecureComparisonServer > secureComparisonServer
A reference to the SecureComparisonServer.
void SetClient(const std::shared_ptr< SecureExtremumSelectionClient< T_SecureComparisonServer, T_SecureComparisonClient >> &secureExtremumSelectionClient)
Setter for this->secureExtremumSelectionClient.
Definition of template class SecureExtremumSelectionClient.
~SecureExtremumSelectionServer()
Destructor - void implementation.
SecureExtremumSelectionServer operator=(SecureExtremumSelectionServer const &)
Copy assignment operator - not implemented.
Definition of template class SecureMultiplicationServer.
Paillier::Ciphertext GetMaximum(const ItemContainer &items) const
Interactive secure maximum selection.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
const Paillier & paillierCryptoProvider
Reference to the Paillier crypto provider.
Defines RandomProvider.
Definition of class Paillier.
const std::shared_ptr< SecureMultiplicationServer< Paillier > > & GetSecureMultiplicationServer() const
Getter for this->secureMultiplicationServer.
const std::shared_ptr< SecureMultiplicationServer< Paillier > > secureMultiplicationServer
A reference to the SecureMultiplicationServer.
Implementation of template members from class SecureExtremumSelectionServer. To be included in secure...
std::vector< Paillier::Ciphertext > ItemContainer
Alias for the item container.