SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
privacy_service_provider.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 PRIVACY_SERVICE_PROVIDER_HEADER_GUARD
30 #define PRIVACY_SERVICE_PROVIDER_HEADER_GUARD
31 
32 //include our headers
33 #include "utils/config.h"
34 #include "core/big_integer.h"
35 #include "core/random_provider.h"
36 #include "core/paillier.h"
37 #include "core/dgk.h"
39 
41 
42 //include C++ libraries
43 #include <string>
44 #include <deque>
45 #include <stdexcept>
46 
47 namespace SeComLib {
48 
49 using namespace Core;
50 using namespace PrivateRecommendationsUtils;
51 
52 namespace PrivateRecommendations {
53  //forward-declare required classes
54  class ServiceProvider;
55 
60  public:
62  typedef std::deque<std::deque<Paillier::Ciphertext>> EncryptedRatings;
63 
66 
69 
71  BigInteger SecureDecryption (const Paillier::Ciphertext &input) const;
72 
74  void SetServiceProvider (const std::shared_ptr<const ServiceProvider> &serviceProvider);
75 
77  const std::shared_ptr<SecureComparisonClient> &GetSecureComparisonClient () const;
78 
80  const std::shared_ptr<SecureMultiplicationClient<Paillier>> &GetSecureMultiplicationClient () const;
81 
83  const PaillierPublicKey &GetPaillierPublicKey () const;
84 
86  const DgkPublicKey &GetDgkPublicKey () const;
87 
89  void DebugPaillierEncryption (const Paillier::Ciphertext &input) const;
90 
91  private:
94 
97 
99  std::shared_ptr<const ServiceProvider> serviceProvider;
100 
102  std::shared_ptr<SecureComparisonClient> secureComparisonClient;
103 
105  std::shared_ptr<SecureMultiplicationClient<Paillier>> secureMultiplicationClient;
106 
108  static const std::string configurationPath;
109 
112 
115  };
116 }//namespace PrivateRecommendations
117 }//namespace SeComLib
118 
119 #endif//PRIVACY_SERVICE_PROVIDER_HEADER_GUARD
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
Definition of class Dgk.
Defines BigInteger.
Definition of class Config.
The public key container structure for the Dgk cryptosystem.
Definition: dgk.h:47
std::shared_ptr< const ServiceProvider > serviceProvider
A reference to the ServiceProvider.
std::shared_ptr< SecureMultiplicationClient< Paillier > > secureMultiplicationClient
A reference to the SecureMultiplicationClient.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
std::shared_ptr< SecureComparisonClient > secureComparisonClient
A reference to the SecureComparisonClient.
Definition of template class SecureMultiplicationClient.
Definition of class SecureComparisonClient.
static const std::string configurationPath
Service Provider configuration path.
Defines RandomProvider.
Definition of class Paillier.
std::deque< std::deque< Paillier::Ciphertext > > EncryptedRatings
Container for encrypted user rating vectors.
Paillier paillierCryptoProvider
The Paillier crypto provider.
The public key container structure for the Paillier cryptosystem.
Definition: paillier.h:49