SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
secure_extremum_selection/client.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 CLIENT_HEADER_GUARD
30 #define CLIENT_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 SecureComparisonClient implementation
41 //#include "secure_face_recognition_utils/secure_comparison_client.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 SecureComparisonClient
52 using namespace PrivateRecommendationsUtils;
53 //using namespace SecureFaceRecognitionUtils;
54 
55 namespace SecureExtremumSelection {
56  //forward-declare required classes
57  class Server;
58 
62  class Client {
63  public:
66 
69 
71  Client ();
72 
74  ~Client () {}
75 
77  void StartSimulation ();
78 
80  void SetServer (const std::shared_ptr<const Server> &server);
81 
83  const std::shared_ptr<SecureExtremumSelectionClient<SecureComparisonServer, SecureComparisonClient>> &GetSecureExtremumSelectionClient () const;
84 
86  void DebugPaillierEncryption (const Paillier::Ciphertext &input) const;
87 
88  private:
90  std::shared_ptr<const Server> server;
91 
93  const size_t testVectorLength;
94 
96  const size_t l;
97 
99  std::vector<Paillier::Ciphertext> testVector;
100 
102  std::shared_ptr<SecureExtremumSelectionClient<SecureComparisonServer, SecureComparisonClient>> secureExtremumSelectionClient;
103 
105  static const std::string configurationPath;
106 
108  Client (Client const &);
109 
111  Client operator= (Client const &);
112  };
113 }//namespace SecureExtremumSelection
114 }//namespace SeComLib
115 
116 #endif//CLIENT_HEADER_GUARD
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
Definition of class Dgk.
const size_t l
Bitsize of test vector elements.
Defines BigInteger.
Definition of class Config.
static const std::string configurationPath
Service Provider configuration path.
Definition of template class SecureExtremumSelectionClient.
std::shared_ptr< SecureExtremumSelectionClient< SecureComparisonServer, SecureComparisonClient > > secureExtremumSelectionClient
A reference to the SecureExtremumSelectionClient.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
Definition of class SecureComparisonClient.
Paillier paillierCryptoProvider
The Paillier crypto provider.
Definition of class Paillier.
const size_t testVectorLength
The length of the test vector.
std::vector< Paillier::Ciphertext > testVector
The test vector.
std::shared_ptr< const Server > server
A reference to the Server.