Class GMKeyPairGenerator

java.lang.Object
java.security.KeyPairGeneratorSpi
edu.fiu.adwise.homomorphic_encryption.gm.GMKeyPairGenerator
All Implemented Interfaces:
CipherConstants

public class GMKeyPairGenerator extends KeyPairGeneratorSpi implements 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.
  • Constructor Details

    • GMKeyPairGenerator

      public GMKeyPairGenerator()
  • Method Details

    • initialize

      public void initialize(int key_size, SecureRandom random)
      Initializes the key pair generator with the specified key size and random number generator.
      Specified by:
      initialize in class KeyPairGeneratorSpi
      Parameters:
      key_size - The size of the key to generate (in bits). Must be at least KEY_SIZE.
      random - The secure random number generator to use (currently unused in this implementation).
      Throws:
      IllegalArgumentException - If the key size is less than KEY_SIZE.
    • generateKeyPair

      public KeyPair generateKeyPair()
      Generates a key pair for the Goldwasser-Micali encryption scheme.
      Specified by:
      generateKeyPair in class KeyPairGeneratorSpi
      Returns:
      A KeyPair containing the public and private keys.