|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Junit Class to test the ElGamalScheme. More...

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< ElGamalScheme > | schemes |
| 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. | |
Junit Class to test the ElGamalScheme.
| frodo2.solutionSpaces.crypto.ElGamalSchemeTest.ElGamalSchemeTest | ( | String | toTest, |
| int | nbrSharesPerAgent ) |
Constructor.
| toTest | the method to test |
| nbrSharesPerAgent | The number of public key shares each agent must produce |
References nbrSharesPerAgent.
Referenced by suite().
| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.add | ( | ) |
Test the add() method of ElGamalBigInteger.
References frodo2.solutionSpaces.AddableInteger.add(), frodo2.solutionSpaces.crypto.ElGamalBigInteger.add(), agent, frodo2.solutionSpaces.AddableInteger.compareTo(), frodo2.solutionSpaces.AddableInteger.equals(), init(), rand, schemes, and size.

| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.decrypt | ( | ) |
Testing decryption by all the agents.
References rand, randomDecrypt(), and size.

| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.decryptOnce | ( | ) |
Testing decryption by one agent.
References rand, randomDecryptOnce(), and size.

| 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().

|
private |
Initialize.
References agent, g, frodo2.solutionSpaces.crypto.ElGamalScheme.newPublicKeyShare(), p, schemes, and size.
Referenced by add(), min(), partialEncrypt(), randomDecrypt(), and randomDecryptOnce().

| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.min | ( | ) |
Test the method min(ElGamalBigInteger other) of ElGamalBigInteger.
References min().
Referenced by infinity(), and min().

| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.min | ( | boolean | infinity | ) |
Test the method min(ElGamalBigInteger other) of ElGamalBigInteger.
| infinity | whether we test with infinity or not |
References agent, frodo2.solutionSpaces.AddableInteger.compareTo(), frodo2.solutionSpaces.crypto.ElGamalScheme.decrypt(), frodo2.solutionSpaces.crypto.ElGamalScheme.encrypt(), frodo2.solutionSpaces.AddableInteger.equals(), infinity(), init(), frodo2.solutionSpaces.crypto.ElGamalBigInteger.min(), frodo2.solutionSpaces.crypto.ElGamalScheme.partialDecrypt(), frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, rand, frodo2.solutionSpaces.crypto.ElGamalScheme.reencrypt(), schemes, and size.

| void frodo2.solutionSpaces.crypto.ElGamalSchemeTest.partialEncrypt | ( | ) |
|
private |
Used to test the decryption Encrypts a random number of times by all the ElGamalSchemes, then decrypts it.
| val | the 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().

|
private |
Used to test the decryption Encrypts val a random number of times by the same ElGamalScheme then decrypts it.
| val | the 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().

|
protected |
|
static |
References ElGamalSchemeTest().
Referenced by frodo2.algorithms.dpop.privacy.test.AllTestsP_DPOP.suite(), and frodo2.solutionSpaces.tests.AllTestsSpaces.suite().

|
protected |
|
private |
Number of cryptoSchemes.
Referenced by add(), init(), min(), partialEncrypt(), randomDecrypt(), and randomDecryptOnce().
|
private |
Large number that is a generator for p.
Referenced by init().
|
private |
Maximum number of encryptions.
Referenced by randomDecrypt(), and randomDecryptOnce().
|
private |
The number of public key shares each agent must produce.
Referenced by ElGamalSchemeTest().
|
private |
Large big prime number.
Referenced by init().
|
private |
Random generator.
Referenced by add(), decrypt(), decryptOnce(), min(), partialEncrypt(), randomDecrypt(), randomDecryptOnce(), setUp(), and tearDown().
|
private |
List of ElGamalSchemes.
Referenced by add(), init(), min(), partialEncrypt(), randomDecrypt(), randomDecryptOnce(), setUp(), and tearDown().
|
private |
List of public key shares (possibly multiple per agent).
|
private |
Size of the elgamal vector.
Referenced by add(), decrypt(), decryptOnce(), init(), min(), and partialEncrypt().