SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
private_recommendations_data_packing/comparison_blinding_factor_container.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 COMPARISON_BLINDING_FACTOR_CONTAINER_HEADER_GUARD
30 #define COMPARISON_BLINDING_FACTOR_CONTAINER_HEADER_GUARD
31 
32 //include our headers
33 #include "utils/config.h"
34 #include "core/big_integer.h"
35 
36 //include C++ libraries
37 #include <string>
38 #include <deque>
39 #include <stdexcept>
40 
41 namespace SeComLib {
42 using namespace Core;
43 
44 namespace PrivateRecommendationsDataPacking {
51  template <typename T_CryptoProvider, typename T_Parameters>
53  public:
55  typedef T_CryptoProvider CryptoProvider;
56 
58  typedef T_Parameters Parameters;
59 
61  BigInteger r;
62 
64  std::deque<BigInteger> ri;
65 
67  typename T_CryptoProvider::Ciphertext encryptedR;
68 
70  ComparisonBlindingFactorContainer (const T_CryptoProvider &cryptoProvider, const T_Parameters &parameters);
71  };
72 
79  template <typename T_CryptoProvider>
81  public:
86  public:
88  std::deque<BigInteger> ri;
89 
91  typename T_CryptoProvider::Ciphertext encryptedR;
92 
94  BlindingFactorContainer (const BigInteger &r, const std::deque<BigInteger> &emptyBuckets, const T_CryptoProvider &cryptoProvider);
95  };
96 
98  ComparisonBlindingFactorCache (const T_CryptoProvider &cryptoProvider, const size_t bucketSize, const size_t maxPackedBuckets, const std::deque<BigInteger> &emptyBuckets, const std::string &configurationPath);
99 
102 
105 
106  private:
108  std::vector<BlindingFactorContainer> cache;
109 
111  const T_CryptoProvider &cryptoProvider;
112 
114  unsigned long index;
115 
117  unsigned long capacity;
118 
120  size_t kappa;
121 
124 
127  };
128 }//namespace PrivateRecommendationsDataPacking
129 }//namespace SeComLib
130 
131 //Separate the implementation from the declaration
133 
134 #endif//COMPARISON_BLINDING_FACTOR_CONTAINER_HEADER_GUARD
Defines BigInteger.
Definition of class Config.
Implementation of struct ComparisonBlindingFactorContainer.