FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.mpc_discsp.PaillierPublicKey Class Reference

A Paillier public key. More...

Inheritance diagram for frodo2.algorithms.mpc_discsp.PaillierPublicKey:

Public Member Functions

 PaillierPublicKey ()
 Empty constructor used for externalization.
 PaillierPublicKey (BigInteger n, BigInteger nsquare, int bitLength, BigInteger g)
 Constructor.
void writeExternal (ObjectOutput out) throws IOException
void readExternal (ObjectInput in) throws IOException, ClassNotFoundException
PaillierInteger encrypt (BigInteger plaintext)
 Encrypts an integer.
PaillierInteger fakeEncrypt (BigInteger plaintext)
 Fakes the encryption of an integer.
String toString ()

Package Attributes

BigInteger n
 The first part of the public encryption key.
BigInteger nsquare
 n^2

Private Attributes

int bitLength
 Number of bits of n.
BigInteger g
 The second part of the public encryption key.
final SecureRandom rand
 A source of randomness.

Detailed Description

A Paillier public key.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ PaillierPublicKey() [1/2]

frodo2.algorithms.mpc_discsp.PaillierPublicKey.PaillierPublicKey ( )

Empty constructor used for externalization.

◆ PaillierPublicKey() [2/2]

frodo2.algorithms.mpc_discsp.PaillierPublicKey.PaillierPublicKey ( BigInteger n,
BigInteger nsquare,
int bitLength,
BigInteger g )

Constructor.

Parameters
nThe first part of the public encryption key
nsquaren^2
bitLengthNumber of bits of n
gThe second part of the public encryption key

References bitLength, g, n, and nsquare.

Member Function Documentation

◆ encrypt()

PaillierInteger frodo2.algorithms.mpc_discsp.PaillierPublicKey.encrypt ( BigInteger plaintext)

Encrypts an integer.

Parameters
plaintextplaintext integer
Returns
cyphertext

References bitLength, g, n, and nsquare.

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.nextMultiplication(), and frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn().

◆ fakeEncrypt()

PaillierInteger frodo2.algorithms.mpc_discsp.PaillierPublicKey.fakeEncrypt ( BigInteger plaintext)

Fakes the encryption of an integer.

Parameters
plaintextplaintext integer
Returns
cyphertext

References g, and nsquare.

Referenced by frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.nextMultiplication(), and frodo2.algorithms.mpc_discsp.MPC_DisCSP4< V extends Addable< V > >.notifyIn().

◆ readExternal()

void frodo2.algorithms.mpc_discsp.PaillierPublicKey.readExternal ( ObjectInput in) throws IOException, ClassNotFoundException
See also
java.io.Externalizable#readExternal(java.io.ObjectInput)

◆ toString()

String frodo2.algorithms.mpc_discsp.PaillierPublicKey.toString ( )
See also
java.lang.Object#toString()

◆ writeExternal()

void frodo2.algorithms.mpc_discsp.PaillierPublicKey.writeExternal ( ObjectOutput out) throws IOException
See also
java.io.Externalizable#writeExternal(java.io.ObjectOutput)

Member Data Documentation

◆ bitLength

int frodo2.algorithms.mpc_discsp.PaillierPublicKey.bitLength
private

Number of bits of n.

Referenced by encrypt(), and PaillierPublicKey().

◆ g

BigInteger frodo2.algorithms.mpc_discsp.PaillierPublicKey.g
private

The second part of the public encryption key.

Referenced by encrypt(), fakeEncrypt(), and PaillierPublicKey().

◆ n

BigInteger frodo2.algorithms.mpc_discsp.PaillierPublicKey.n
package

The first part of the public encryption key.

Referenced by frodo2.algorithms.mpc_discsp.PaillierCryptoScheme.decrypt(), encrypt(), and PaillierPublicKey().

◆ nsquare

BigInteger frodo2.algorithms.mpc_discsp.PaillierPublicKey.nsquare
package

◆ rand

final SecureRandom frodo2.algorithms.mpc_discsp.PaillierPublicKey.rand
private

A source of randomness.


The documentation for this class was generated from the following file: