Class GMKeyPairGenerator
java.lang.Object
java.security.KeyPairGeneratorSpi
edu.fiu.adwise.homomorphic_encryption.gm.GMKeyPairGenerator
- All Implemented Interfaces:
CipherConstants
This class is responsible for generating key pairs for the Goldwasser-Micali (GM) encryption scheme.
It extends the
KeyPairGeneratorSpi and implements the CipherConstants interface.-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a key pair for the Goldwasser-Micali encryption scheme.voidinitialize(int key_size, SecureRandom random) Initializes the key pair generator with the specified key size and random number generator.Methods inherited from class java.security.KeyPairGeneratorSpi
initialize
-
Constructor Details
-
GMKeyPairGenerator
public GMKeyPairGenerator()
-
-
Method Details
-
initialize
Initializes the key pair generator with the specified key size and random number generator.- Specified by:
initializein classKeyPairGeneratorSpi- Parameters:
key_size- The size of the key to generate (in bits). Must be at leastKEY_SIZE.random- The secure random number generator to use (currently unused in this implementation).- Throws:
IllegalArgumentException- If the key size is less thanKEY_SIZE.
-
generateKeyPair
Generates a key pair for the Goldwasser-Micali encryption scheme.- Specified by:
generateKeyPairin classKeyPairGeneratorSpi- Returns:
- A
KeyPaircontaining the public and private keys.
-