Loading [MathJax]/extensions/tex2jax.js
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 SERVER_HEADER_GUARD
30 #define SERVER_HEADER_GUARD
31 
32 //include our headers
33 #include "utils/config.h"
34 #include "core/big_integer.h"
35 #include "core/paillier.h"
36 #include "core/dgk.h"
38 
39 //use the desired SecureComparisonServer implementation
41 //#include "secure_face_recognition_utils/secure_comparison_server.h"
42 
43 //include C++ headers
44 #include <iostream>
45 #include <vector>
46 #include <stdexcept>
47 
48 namespace SeComLib {
49 using namespace Core;
50 
51 //specify the namespace of the SecureComparisonServer
52 using namespace PrivateRecommendationsUtils;
53 //using namespace SecureFaceRecognitionUtils;
54 
55 namespace SecureExtremumSelection {
56  //forward-declare required classes
57  class Client;
58 
62  class Server {
63  public:
65  Server (const PaillierPublicKey &paillierPublicKey, const DgkPublicKey &dgkPublicKey);
66 
68  ~Server () {}
69 
71  Paillier::Ciphertext ComputeMinimum (std::vector<Paillier::Ciphertext> &input) const;
72 
74  Paillier::Ciphertext ComputeMaximum (std::vector<Paillier::Ciphertext> &input) const;
75 
77  void SetClient (const std::shared_ptr<const Client> &client);
78 
80  const std::shared_ptr<SecureExtremumSelectionServer<SecureComparisonServer, SecureComparisonClient>> &GetSecureExtremumSelectionServer () const;
81 
82  private:
84  std::weak_ptr<const Client> client;
85 
88 
91 
93  const std::shared_ptr<SecureExtremumSelectionServer<SecureComparisonServer, SecureComparisonClient>> secureExtremumSelectionServer;
94 
96  static const std::string configurationPath;
97 
99  Server (Server const &);
100 
102  Server operator= (Server const &);
103  };
104 }//namespace SecureExtremumSelection
105 }//namespace SeComLib
106 
107 #endif//SERVER_HEADER_GUARD
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
Definition of class Dgk.
const std::shared_ptr< SecureExtremumSelectionServer< SecureComparisonServer, SecureComparisonClient > > secureExtremumSelectionServer
A reference to the SecureExtremumSelectionServer.
Defines BigInteger.
Definition of class Config.
The public key container structure for the Dgk cryptosystem.
Definition: dgk.h:47
Definition of template class SecureExtremumSelectionServer.
std::weak_ptr< const Client > client
A reference to the Client.
Definition of class SecureComparisonServer.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
Definition of class Paillier.
static const std::string configurationPath
Service Provider configuration path.
Paillier paillierCryptoProvider
Paillier crypto provider.
The public key container structure for the Paillier cryptosystem.
Definition: paillier.h:49