Class ElGamalPublicKey
java.lang.Object
edu.fiu.adwise.homomorphic_encryption.elgamal.ElGamalPublicKey
- All Implemented Interfaces:
ElGamal_Key,Serializable,Key,PublicKey
Represents the public key for the ElGamal encryption scheme.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanIndicates whether additive homomorphic encryption is enabled. -
Constructor Summary
ConstructorsConstructorDescriptionElGamalPublicKey(BigInteger p, BigInteger g, BigInteger h, boolean additive) Constructs an ElGamalPublicKey with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the algorithm name.byte[]Returns the encoded form of the key.Returns the format of the key.getP()Returns the prime modulus.voidset_additive(boolean additive) Sets whether the key is used for additive homomorphism.toString()Returns a string representation of the ElGamal public key.
-
Field Details
-
additive
public boolean additiveIndicates whether additive homomorphic encryption is enabled.
-
-
Constructor Details
-
ElGamalPublicKey
Constructs an ElGamalPublicKey with the specified parameters.- Parameters:
p- The prime modulus.g- The generator.h- The public key component.additive- Whether the key is used for additive homomorphism.
-
-
Method Details
-
set_additive
public void set_additive(boolean additive) Sets whether the key is used for additive homomorphism.- Specified by:
set_additivein interfaceElGamal_Key- Parameters:
additive- True if the key is additive, false otherwise.
-
getAlgorithm
Returns the algorithm name.- Specified by:
getAlgorithmin interfaceKey- Returns:
- The algorithm name ("ElGamal").
-
getFormat
Returns the format of the key. -
getEncoded
public byte[] getEncoded()Returns the encoded form of the key.- Specified by:
getEncodedin interfaceKey- Returns:
- The encoded form of the key (currently null).
-
getP
Returns the prime modulus.- Specified by:
getPin interfaceElGamal_Key- Returns:
- The prime modulus.
-
toString
Returns a string representation of the ElGamal public key.
-