FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.solutionSpaces.crypto.ElGamalSchemeTest Class Reference

Junit Class to test the ElGamalScheme. More...

Inheritance diagram for frodo2.solutionSpaces.crypto.ElGamalSchemeTest:

Public Member Functions

 ElGamalSchemeTest (String toTest, int nbrSharesPerAgent)
 Constructor.
void add ()
 Test the add() method of ElGamalBigInteger.
void min (boolean infinity)
 Test the method min(ElGamalBigInteger other) of ElGamalBigInteger.
void min ()
 Test the method min(ElGamalBigInteger other) of ElGamalBigInteger.
void infinity ()
 Used to test the decryption of PlusInfinity Test decryptOnce(PLUS_INF) decrypt(PLUS_INF).
void decryptOnce ()
 Testing decryption by one agent.
void decrypt ()
 Testing decryption by all the agents.
void partialEncrypt ()
 simplified decryption of 2 agents

Static Public Member Functions

static TestSuite suite ()

Protected Member Functions

void setUp ()
void tearDown () throws Exception
 Ends all queues.

Private Member Functions

void randomDecryptOnce (AddableInteger val)
 Used to test the decryption Encrypts val a random number of times by the same ElGamalScheme then decrypts it.
void randomDecrypt (AddableInteger val)
 Used to test the decryption Encrypts a random number of times by all the ElGamalSchemes, then decrypts it.
void init ()
 Initialize.

Private Attributes

int agent = 10
 Number of cryptoSchemes.
final String p = "57475322849086478933"
 Large big prime number.
final String g = "5526868997990728076"
 Large number that is a generator for p.
String size = "1000"
 Size of the elgamal vector.
ArrayList< ElGamalSchemeschemes
 List of ElGamalSchemes.
ArrayList< List< ElGamalPublicKeyShare > > shares
 List of public key shares (possibly multiple per agent).
Random rand
 Random generator.
final int maxNbrEncryptions = 10
 Maximum number of encryptions.
final int nbrSharesPerAgent
 The number of public key shares each agent must produce.

Detailed Description

Junit Class to test the ElGamalScheme.

Author
Eric Zbinden, Thomas Leaute

Constructor & Destructor Documentation

◆ ElGamalSchemeTest()

frodo2.solutionSpaces.crypto.ElGamalSchemeTest.ElGamalSchemeTest ( String toTest,
int nbrSharesPerAgent )

Constructor.

Parameters
toTestthe method to test
nbrSharesPerAgentThe number of public key shares each agent must produce

References nbrSharesPerAgent.

Referenced by suite().

Member Function Documentation

◆ add()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.add ( )

◆ decrypt()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.decrypt ( )

Testing decryption by all the agents.

References rand, randomDecrypt(), and size.

Here is the call graph for this function:

◆ decryptOnce()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.decryptOnce ( )

Testing decryption by one agent.

References rand, randomDecryptOnce(), and size.

Here is the call graph for this function:

◆ infinity()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.infinity ( )

Used to test the decryption of PlusInfinity Test decryptOnce(PLUS_INF) decrypt(PLUS_INF).

References min(), frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, randomDecrypt(), and randomDecryptOnce().

Referenced by min().

Here is the call graph for this function:

◆ init()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.init ( )
private

Initialize.

References agent, g, frodo2.solutionSpaces.crypto.ElGamalScheme.newPublicKeyShare(), p, schemes, and size.

Referenced by add(), min(), partialEncrypt(), randomDecrypt(), and randomDecryptOnce().

Here is the call graph for this function:

◆ min() [1/2]

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.min ( )

Test the method min(ElGamalBigInteger other) of ElGamalBigInteger.

References min().

Referenced by infinity(), and min().

Here is the call graph for this function:

◆ min() [2/2]

◆ partialEncrypt()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.partialEncrypt ( )

simplified decryption of 2 agents

References agent, frodo2.solutionSpaces.AddableInteger.equals(), init(), rand, schemes, and size.

Here is the call graph for this function:

◆ randomDecrypt()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.randomDecrypt ( AddableInteger val)
private

Used to test the decryption Encrypts a random number of times by all the ElGamalSchemes, then decrypts it.

Parameters
valthe value to encrypt

References agent, frodo2.solutionSpaces.AddableInteger.equals(), init(), maxNbrEncryptions, frodo2.solutionSpaces.crypto.ElGamalScheme.partialDecrypt(), rand, frodo2.solutionSpaces.crypto.ElGamalScheme.reencrypt(), schemes, and frodo2.solutionSpaces.AddableInteger.toString().

Referenced by decrypt(), and infinity().

Here is the call graph for this function:

◆ randomDecryptOnce()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.randomDecryptOnce ( AddableInteger val)
private

Used to test the decryption Encrypts val a random number of times by the same ElGamalScheme then decrypts it.

Parameters
valthe value to encrypt

References agent, frodo2.solutionSpaces.crypto.ElGamalScheme.decrypt(), frodo2.solutionSpaces.crypto.ElGamalScheme.encrypt(), frodo2.solutionSpaces.AddableInteger.equals(), init(), maxNbrEncryptions, rand, frodo2.solutionSpaces.crypto.ElGamalScheme.reencrypt(), and schemes.

Referenced by decryptOnce(), and infinity().

Here is the call graph for this function:

◆ setUp()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.setUp ( )
protected
See also
junit.framework.TestCase#setUp()

References rand, and schemes.

◆ suite()

TestSuite frodo2.solutionSpaces.crypto.ElGamalSchemeTest.suite ( )
static
Returns
the test suite for this test

References ElGamalSchemeTest().

Referenced by frodo2.algorithms.dpop.privacy.test.AllTestsP_DPOP.suite(), and frodo2.solutionSpaces.tests.AllTestsSpaces.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.tearDown ( ) throws Exception
protected

Ends all queues.

See also
junit.framework.TestCase#tearDown()

References rand, and schemes.

Member Data Documentation

◆ agent

int frodo2.solutionSpaces.crypto.ElGamalSchemeTest.agent = 10
private

Number of cryptoSchemes.

Note
must be >= 2

Referenced by add(), init(), min(), partialEncrypt(), randomDecrypt(), and randomDecryptOnce().

◆ g

final String frodo2.solutionSpaces.crypto.ElGamalSchemeTest.g = "5526868997990728076"
private

Large number that is a generator for p.

Referenced by init().

◆ maxNbrEncryptions

final int frodo2.solutionSpaces.crypto.ElGamalSchemeTest.maxNbrEncryptions = 10
private

Maximum number of encryptions.

Referenced by randomDecrypt(), and randomDecryptOnce().

◆ nbrSharesPerAgent

final int frodo2.solutionSpaces.crypto.ElGamalSchemeTest.nbrSharesPerAgent
private

The number of public key shares each agent must produce.

Referenced by ElGamalSchemeTest().

◆ p

final String frodo2.solutionSpaces.crypto.ElGamalSchemeTest.p = "57475322849086478933"
private

Large big prime number.

Referenced by init().

◆ rand

Random frodo2.solutionSpaces.crypto.ElGamalSchemeTest.rand
private

◆ schemes

ArrayList<ElGamalScheme> frodo2.solutionSpaces.crypto.ElGamalSchemeTest.schemes
private

List of ElGamalSchemes.

Referenced by add(), init(), min(), partialEncrypt(), randomDecrypt(), randomDecryptOnce(), setUp(), and tearDown().

◆ shares

ArrayList< List<ElGamalPublicKeyShare> > frodo2.solutionSpaces.crypto.ElGamalSchemeTest.shares
private

List of public key shares (possibly multiple per agent).

◆ size

String frodo2.solutionSpaces.crypto.ElGamalSchemeTest.size = "1000"
private

Size of the elgamal vector.

Referenced by add(), decrypt(), decryptOnce(), init(), min(), and partialEncrypt().


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