29 #ifndef EL_GAMAL_HEADER_GUARD
30 #define EL_GAMAL_HEADER_GUARD
88 class ElGamal :
public CryptoProvider<ElGamalPublicKey, ElGamalPrivateKey, ElGamalCiphertext, ElGamalRandomizer> {
120 #ifdef ENABLE_CRYPTO_PROVIDER_HOMOMORPHIC_OPERATIONS
180 #endif//EL_GAMAL_HEADER_GUARD
ElGamalCiphertext Ciphertext
Provide public access to the T_Ciphertext type.
The private key container structure for the ElGamal cryptosystem.
DecryptionMap decryptionMap
Contains all possible values of , where , and it is required for decryption.
Definition of class ElGamalCiphertext.
Definition of class Config.
virtual size_t GetMessageSpaceSize() const
Returns the message space bit size.
ElGamalPrivateKey privateKey
Private key container.
ElGamal(const bool precomputeDecryptionMap=false)
Default constructor.
virtual Ciphertext EncryptIntegerNonrandom(const BigInteger &plaintext) const
Encrypt number without randomization.
virtual const BigInteger & GetMessageSpaceUpperBound() const
Returns the message space upper bound.
virtual Ciphertext RandomizeCiphertext(const Ciphertext &ciphertext) const
Randomize encrypted number with a self-generated random value.
BigInteger messageSpaceThreshold
bool precomputeDecryptionMap
If true, full decryptions are enabled and the decryption map is (pre)computed.
Implementation of the public-key ElGamal Cryptosystem.
virtual void validateParameters()
Do nothing for now.
BigInteger g
A generator of .
virtual BigInteger DecryptInteger(const Ciphertext &ciphertext) const
Decrypt number.
virtual Randomizer GetRandomizer() const
Compute the random factor required for the encryption operation.
virtual bool GenerateKeys()
ElGamal operator=(const ElGamal &)
Copy assignment operator - not implemented.
The randomizer type for Paillier.
ElGamalRandomizer Randomizer
Provide public access to the T_Randomizer type.
std::map< const BigInteger, BigInteger > DecryptionMap
std::map template specialization
Definition of template abstract class CryptoProvider.
ElGamalPublicKey publicKey
Public key container.
Template abstract base class for homomorphic encryption primitives.
virtual void doPrecomputations()
Precompute values for speedups.
The public key container structure for the ElGamal cryptosystem.
ElGamalRandomizer()
Default constructor.
bool IsEncryptedZero(const Ciphertext &ciphertext) const
Determines if ciphertext contains an encryption of 0 or not.