SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
ciphertext_base.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 CIPHERTEXT_BASE_HEADER_GUARD
30 #define CIPHERTEXT_BASE_HEADER_GUARD
31 
32 #include "big_integer.h"
33 
34 //include C++ headers
35 #include <memory>
36 #include <stdexcept>
37 
38 namespace SeComLib {
39 namespace Core {
44  template <typename T_CiphertextImpl>
46  public:
48  BigInteger data;
49 
51  CiphertextBase ();
52 
54  CiphertextBase (const std::shared_ptr<BigInteger> &encryptionModulus);
55 
57  CiphertextBase (const BigInteger &data, const std::shared_ptr<BigInteger> &encryptionModulus);
58 
60  T_CiphertextImpl operator- () const;
61 
63  T_CiphertextImpl operator+ (const T_CiphertextImpl &input) const;
64 
66  T_CiphertextImpl operator- (const T_CiphertextImpl &input) const;
67 
69  template <typename T_DataType>
70  T_CiphertextImpl operator* (const T_DataType &input) const;
71 
72  private:
74  std::shared_ptr<BigInteger> encryptionModulus;
75  };
76 }//namespace Core
77 }//namespace SeComLib
78 
79 //Separate the implementation from the declaration
80 #include "ciphertext_base.hpp"
81 
82 #endif//CIPHERTEXT_BASE_HEADER_GUARD
T_CiphertextImpl operator-() const
Homomorphic negation unary operator.
Defines BigInteger.
std::shared_ptr< BigInteger > encryptionModulus
The encryption modulus.
BigInteger data
The ciphertext data.
T_CiphertextImpl operator+(const T_CiphertextImpl &input) const
Homomorphic addition binary operator.
Implementation of template class CiphertextBase. To be included in ciphertext_base.h.
CiphertextBase template class.
T_CiphertextImpl operator*(const T_DataType &input) const
Homomorphic multiplication binary operator.
CiphertextBase()
Default constructor.