Interface bob_interface
- All Known Implementing Classes:
bob,bob_elgamal,bob_joye,bob_veugen
public interface bob_interface
Interface defining the operations for Bob in the Socialist Millionaires' Problem (SMP) protocol.
This interface includes methods for secure multi-party computation using homomorphic encryption.
-
Method Summary
Modifier and TypeMethodDescriptionvoiddivision(long divisor) Performs division on an encrypted integer with alice.voidCompares two encrypted integers for equality.voidPerforms multiplication on encrypted integers with alice.booleanCompares Alice's private integer with Bob's private integer.booleanCompares two encrypted integers and determines if the first is greater than or equal to the second.voidSends public keys to alice.voidset_socket(Socket socket) Sets the socket for communication.voidsort()Sorts a collection of encrypted integers.
-
Method Details
-
encrypted_equals
Compares two encrypted integers for equality.- Throws:
IOException- if an I/O error occurs.HomomorphicException- if a homomorphic encryption error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.
-
Protocol1
boolean Protocol1(BigInteger y) throws IOException, IllegalArgumentException, HomomorphicException, ClassNotFoundException Compares Alice's private integer with Bob's private integer. This means this input is NOT encrypted!!- Parameters:
y- Bob's private integer.- Returns:
- true if the comparison satisfies the protocol, false otherwise.
- Throws:
IOException- if an I/O error occurs.IllegalArgumentException- if an invalid argument is provided.HomomorphicException- if a homomorphic encryption error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.
-
Protocol2
Compares two encrypted integers and determines if the first is greater than or equal to the second.- Returns:
- true if the first encrypted integer is greater than or equal to the second, false otherwise.
- Throws:
IOException- if an I/O error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.HomomorphicException- if a homomorphic encryption error occurs.
-
division
Performs division on an encrypted integer with alice.- Parameters:
divisor- the divisor.- Throws:
IOException- if an I/O error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.HomomorphicException- if a homomorphic encryption error occurs.
-
multiplication
void multiplication() throws IOException, ClassNotFoundException, IllegalArgumentException, HomomorphicExceptionPerforms multiplication on encrypted integers with alice.- Throws:
IOException- if an I/O error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.IllegalArgumentException- if an invalid argument is provided.HomomorphicException- if a homomorphic encryption error occurs.
-
sort
Sorts a collection of encrypted integers.- Throws:
IOException- if an I/O error occurs.ClassNotFoundException- if the class of a serialized object cannot be found.HomomorphicException- if a homomorphic encryption error occurs.
-
sendPublicKeys
Sends public keys to alice.- Throws:
IOException- if an I/O error occurs.
-
set_socket
Sets the socket for communication.- Parameters:
socket- the socket to use for communication.- Throws:
IOException- if an I/O error occurs.
-