SeComLib
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Macros Pages
el_gamal_ciphertext.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 EL_GAMAL_CIPHERTEXT_HEADER_GUARD
30 #define EL_GAMAL_CIPHERTEXT_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  public:
48  struct Data {
49  public:
51  BigInteger x;
52 
54  BigInteger y;
55 
57  Data ();
58 
60  Data (const BigInteger &x, const BigInteger &y);
61  };
62 
65 
68 
70  ElGamalCiphertext (const std::shared_ptr<BigInteger> &encryptionModulus);
71 
73  ElGamalCiphertext (const BigInteger &x, const BigInteger &y, const std::shared_ptr<BigInteger> &encryptionModulus);
74 
77 
80 
83 
85  template <typename T_DataType>
86  ElGamalCiphertext operator* (const T_DataType &input) const;
87 
88  private:
90  std::shared_ptr<BigInteger> encryptionModulus;
91  };
92 
93 }//namespace Core
94 }//namespace SeComLib
95 
96 //Separate the implementation from the declaration
97 #include "el_gamal_ciphertext.hpp"
98 
99 #endif//EL_GAMAL_CIPHERTEXT_HEADER_GUARD
ElGamalCiphertext operator*(const T_DataType &input) const
Homomorphic multiplication binary operator.
Data data
Cipertext container.
ElGamalCiphertext()
Default constructor.
ElGamalCiphertext operator+(const ElGamalCiphertext &input) const
Homomorphic addition binary operator.
ElGamalCiphertext operator-() const
Homomorphic negation unary operator.
Defines BigInteger.
std::shared_ptr< BigInteger > encryptionModulus
The encryption modulus.
ElGamal cipertext container structure.
Implementation of template methods from class ElGamalCiphertext. To be included in el_gamal_ciphertex...