Class socialist_millionaires

java.lang.Object
edu.fiu.adwise.homomorphic_encryption.socialistmillionaire.socialist_millionaires
All Implemented Interfaces:
CipherConstants
Direct Known Subclasses:
alice, bob

public abstract class socialist_millionaires extends Object implements CipherConstants
Abstract class representing the Socialist Millionaires' Problem (SMP) protocol. This class provides the base implementation for secure multi-party computation using homomorphic encryption techniques.

It includes methods for managing cryptographic keys, performing I/O operations, and utility functions for encrypted data manipulation.

  • Constructor Details

    • socialist_millionaires

      public socialist_millionaires()
  • Method Details

    • setDGKMode

      public void setDGKMode(boolean isDGK)
      Sets the DGK encryption mode.
      Parameters:
      isDGK - true to enable DGK mode, false otherwise.
    • isDGK

      public boolean isDGK()
      Checks if DGK encryption mode is enabled.
      Returns:
      true if DGK mode is enabled, false otherwise.
    • setPaillierPublicKey

      public void setPaillierPublicKey(PaillierPublicKey paillier_public)
      Sets the Paillier public key.
      Parameters:
      paillier_public - the Paillier public key.
    • setDGKPublicKey

      public void setDGKPublicKey(DGKPublicKey dgk_public)
      Sets the DGK public key and precomputes 2^l.
      Parameters:
      dgk_public - the DGK public key.
    • setElGamalPublicKey

      public void setElGamalPublicKey(ElGamalPublicKey el_gamal_public)
      Sets the ElGamal public key.
      Parameters:
      el_gamal_public - the ElGamal public key.
    • getPaillierPublicKey

      public PaillierPublicKey getPaillierPublicKey()
      Retrieves the Paillier public key.
      Returns:
      the Paillier public key.
    • getDGKPublicKey

      public DGKPublicKey getDGKPublicKey()
      Retrieves the DGK public key.
      Returns:
      the DGK public key.
    • getElGamalPublicKey

      public ElGamalPublicKey getElGamalPublicKey()
      Retrieves the ElGamal public key.
      Returns:
      the ElGamal public key.
    • get_bytes_sent

      public long get_bytes_sent()
      Retrieves the total number of bytes sent during communication.
      Returns:
      the total bytes sent.
    • readBoolean

      public boolean readBoolean() throws IOException
      Reads a boolean value from the input stream.
      Returns:
      the boolean value read.
      Throws:
      IOException - if an I/O error occurs.
    • writeBoolean

      public void writeBoolean(boolean value) throws IOException
      Writes a boolean value to the output stream.
      Parameters:
      value - the boolean value to write.
      Throws:
      IOException - if an I/O error occurs.
    • readInt

      public int readInt() throws IOException
      Reads an integer value from the input stream.
      Returns:
      the integer value read.
      Throws:
      IOException - if an I/O error occurs.
    • writeInt

      public void writeInt(int value) throws IOException
      Writes an integer value to the output stream.
      Parameters:
      value - the integer value to write.
      Throws:
      IOException - if an I/O error occurs.
    • readObject

      public Object readObject() throws IOException, ClassNotFoundException
      Reads an object from the input stream.
      Returns:
      the object read.
      Throws:
      IOException - if an I/O error occurs.
      ClassNotFoundException - if the class of the object cannot be found.
    • writeObject

      public void writeObject(Object o) throws IOException
      Writes an object to the output stream.
      Parameters:
      o - the object to write.
      Throws:
      IOException - if an I/O error occurs.