SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
randomizer_cache.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 RANDOMIZER_CACHE_HEADER_GUARD
30 #define RANDOMIZER_CACHE_HEADER_GUARD
31 
32 //include our headers
33 #include "utils/config.h"
34 #include "big_integer.h"
35 
36 //include C++ libraries
37 #include <vector>
38 
39 namespace SeComLib {
40 namespace Core {
49  template <typename T_Container>
51  public:
53  RandomizerCache (const typename T_Container::CryptoProvider &cryptoProvider, const std::string &configurationPath);
54 
56  RandomizerCache (const typename T_Container::CryptoProvider &cryptoProvider, const typename T_Container::Parameters &parameters);
57 
60 
62  const T_Container &Pop ();
63 
64  private:
66  std::vector<T_Container> cache;
67 
69  const typename T_Container::CryptoProvider &cryptoProvider;
70 
72  const typename T_Container::Parameters parameters;
73 
75  size_t index;
76 
78  void initialize ();
79 
82 
85  };
86 }//namespace Core
87 }//namespace SeComLib
88 
89 //Separate the implementation from the declaration
90 #include "randomizer_cache.hpp"
91 
92 #endif//RANDOMIZER_CACHE_HEADER_GUARD
const T_Container::CryptoProvider & cryptoProvider
Reference to the crypto provider.
const T_Container & Pop()
Extracts one element.
Defines BigInteger.
Definition of class Config.
RandomizerCache(const typename T_Container::CryptoProvider &cryptoProvider, const std::string &configurationPath)
Constructor.
~RandomizerCache()
Destructor - void implementation.
RandomizerCache operator=(const RandomizerCache &)
Copy assignment operator - not implemented.
Implementation of template class RandomizerCache.
void initialize()
Populates the cache.
std::vector< T_Container > cache
Internal cache vector.
size_t index
The index of the next element that will be retrieved.
const T_Container::Parameters parameters
Parameters required to build the cache.