SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
private_recommendations/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 "utils/cpu_timer.h"
35 #include "core/paillier.h"
36 #include "core/randomizer_cache.h"
38 
40 #include "service_provider.h"
42 
43 //include C++ libraries
44 #include <string>
45 #include <deque>
46 #include <stdexcept>
47 
48 namespace SeComLib {
49 
50 using namespace Core;
51 using namespace PrivateRecommendationsUtils;
52 
53 //hackish way of computing everything for only a single user (see also service_provider.h)
54 #define FIRST_USER_ONLY
55 
56 namespace PrivateRecommendations {
60  class Client {
61  public:
62 
64  Client (const std::shared_ptr<ServiceProvider> &serviceProvider, const std::shared_ptr<PrivacyServiceProvider> &privacyServiceProvider, const PaillierPublicKey &publicKey);
65 
67  ~Client () {}
68 
70  void ComputeRecommendations ();
71 
72  private:
75 
77  const std::shared_ptr<ServiceProvider> serviceProvider;
78 
80  const std::shared_ptr<PrivacyServiceProvider> privacyServiceProvider;
81 
84 
87 
89  static const std::string configurationPath;
90 
92  size_t userCount;
93 
95  Client (Client const &);
96 
98  Client operator= (Client const &);
99  };
100 }//namespace PrivateRecommendations
101 }//namespace SeComLib
102 
103 #endif//CLIENT_HEADER_GUARD
Definition of template class RandomizerCache.
Definition of class PrivacyServiceProvider.
Paillier paillierCryptoProvider
Paillier crypto provider.
Definition of struct BlindingFactorCacheParameters.
Definition of class Config.
size_t userCount
Number of users who need recommendations.
const std::shared_ptr< ServiceProvider > serviceProvider
A reference to the ServiceProvider.
Definition of struct DecryptionBlindingFactorContainer.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
Definition of class CpuTimer.
static const std::string configurationPath
Service Provider configuration path.
Definition of class Paillier.
DecryptionBlindingFactorContainer< Paillier, BlindingFactorCacheParameters > BlindingFactorContainer
Alias for the blinding factor container.
Definition of class ServiceProvider.
RandomizerCache< BlindingFactorContainer > blindingFactorCache
Blinding factor cache instance.
const std::shared_ptr< PrivacyServiceProvider > privacyServiceProvider
A reference to the PrivacyServiceProvider.
The public key container structure for the Paillier cryptosystem.
Definition: paillier.h:49