SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
secure_extremum_selection_client.hpp
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_CLIENT_IMPLEMENTATION_GUARD
30 #define SECURE_EXTREMUM_SELECTION_CLIENT_IMPLEMENTATION_GUARD
31 
32 namespace SeComLib {
33 namespace Core {
39  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
40  SecureExtremumSelectionClient<T_SecureComparisonServer, T_SecureComparisonClient>::SecureExtremumSelectionClient (const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath) :
41  paillierCryptoProvider(paillierCryptoProvider),
42  dgkCryptoProvider(dgkCryptoProvider),
43  secureComparisonClient(std::make_shared<T_SecureComparisonClient>(paillierCryptoProvider, dgkCryptoProvider, configurationPath)),
44  secureMultiplicationClient(std::make_shared<SecureMultiplicationClient<Paillier>>(paillierCryptoProvider)) {
45  }
46 
50  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
52  this->secureExtremumSelectionServer = secureExtremumSelectionServer;
53  this->secureComparisonClient->SetServer(secureExtremumSelectionServer->GetSecureComparisonServer());
54  this->secureMultiplicationClient->SetServer(secureExtremumSelectionServer->GetSecureMultiplicationServer());
55  }
56 
60  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
62  return this->secureComparisonClient;
63  }
64 
68  template <typename T_SecureComparisonServer, typename T_SecureComparisonClient>
70  return this->secureMultiplicationClient;
71  }
72 
73 }//namespace Core
74 }//namespace SeComLib
75 
76 #endif//SECURE_EXTREMUM_SELECTION_CLIENT_IMPLEMENTATION_GUARD
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
const std::shared_ptr< T_SecureComparisonClient > & GetSecureComparisonClient() const
Getter for this->secureComparisonClient.
SecureExtremumSelectionClient(const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider, const std::string &configurationPath)
Constructor.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
const std::shared_ptr< SecureMultiplicationClient< Paillier > > & GetSecureMultiplicationClient() const
Getter for this->secureMultiplicationClient.
void SetServer(const std::shared_ptr< SecureExtremumSelectionServer< T_SecureComparisonServer, T_SecureComparisonClient >> &secureExtremumSelectionServer)
Setter for this->secureExtremumSelectionServer.