SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
private_recommendations_utils/dgk_comparison_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 DGK_COMPARISON_CLIENT_HEADER_GUARD
30 #define DGK_COMPARISON_CLIENT_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"
38 
39 namespace SeComLib {
40 using namespace Core;
41 
42 namespace PrivateRecommendationsUtils {
43  //forward-declare required classes
44  class DgkComparisonServer;
45 
50  public:
52  DgkComparisonClient (const Paillier &paillierCryptoProvider, const Dgk &dgkCryptoProvider);
53 
56 
58  void SetZModTwoPowL (const BigInteger &zModTwoPowL);
59 
61  Dgk::Ciphertext GetTb (const Dgk::Ciphertext &tau, const size_t i) const;
62 
64  Dgk::Ciphertext GetBi (const size_t i) const;
65 
67  Paillier::Ciphertext ConvertToPaillier (const Dgk::Ciphertext &dgkCiphertext) const;
68 
70  Paillier::Ciphertext ComputeDiPSP (const Dgk::Ciphertext &CiPSP) const;
71 
73  void SetServer (const std::shared_ptr<DgkComparisonServer> &dgkComparisonServer);
74 
76  void DebugDgkEncryption (const Dgk::Ciphertext &input) const;
77 
78  private:
81 
84 
86  BigInteger b;
87 
89  std::shared_ptr<const DgkComparisonServer> dgkComparisonServer;
90 
93 
95  DgkComparisonClient operator= (DgkComparisonClient const &);
96  };
97 }//namespace PrivateRecommendationsUtils
98 }//namespace SeComLib
99 
100 #endif//DGK_COMPARISON_CLIENT_HEADER_GUARD
DgkCiphertext Ciphertext
Provide public access to the T_Ciphertext type.
Implementation of the public-key DGK Cryptosystem.
Definition: dgk.h:104
Definition of class Dgk.
Defines BigInteger.
Definition of class Config.
const Paillier & paillierCryptoProvider
Reference to the Paillier crypto provider.
Implementation of the public-key Paillier Cryptosystem.
Definition: paillier.h:103
std::shared_ptr< const DgkComparisonServer > dgkComparisonServer
A reference to the DgkComparisonServer.
Defines RandomProvider.
Definition of class Paillier.