1 package civitas.crypto.ciphertext;
2
3 import civitas.common.VoteChoice;
4 import civitas.crypto.msg.ElgamalMsgTestData;
5 import civitas.crypto.publickey.ElGamalPublicKeyTestData;
6 import civitas.crypto.reencryptfactor.ElGamalReencryptFactorTestData;
7 import civitas.util.CivitasBigInteger;
8 import civitas.util.CivitasBigIntegerFactory;
9
10 public interface ElGamalCiphertextTestData
11 extends ElgamalMsgTestData, ElGamalPublicKeyTestData, ElGamalReencryptFactorTestData {
12
13 ElGamalCiphertext EL_GAMAL_CIPHERTEXT_ONE = new ElGamalCiphertext(ONE, ONE_ENCODED.m());
14 ElGamalCiphertext EL_GAMAL_CIPHERTEXT_TWO = new ElGamalCiphertext(TWO, TWO_ENCODED.m());
15
16 CivitasBigInteger CIPHERTEXT_E_A = BIGINT_G.modPow(FACTOR_E, BIGINT_P);
17 CivitasBigInteger CIPHERTEXT_E_B =
18 MESSAGE_VOTE_CAPABILITY_SHARE_ENCODED.modMultiply(PUBKEY_E.modPow(FACTOR_E, BIGINT_P), BIGINT_P);
19 ElGamalCiphertext CIPHERTEXT_E = new ElGamalCiphertext(CIPHERTEXT_E_A, CIPHERTEXT_E_B);
20 ElGamalCiphertext CIPHERTEXT_E_REENCRYPTED = new ElGamalCiphertext(
21 CIPHERTEXT_E_A.modMultiply(BIGINT_G.modPow(RANDOMS_0, BIGINT_P), BIGINT_P),
22 CIPHERTEXT_E_B.modMultiply(PUBKEY_EPRIME.modPow(RANDOMS_0, BIGINT_P), BIGINT_P));
23
24 CivitasBigInteger CIPHERTEXT_ENCCAP_A = BIGINT_G.modPow(FACTOR_EPRIME, BIGINT_P);
25 CivitasBigInteger CIPHERTEXT_ENCCAP_B =
26 MESSAGE_VOTE_CAPABILITY_SHARE_ENCODED.modMultiply(PUBKEY_E.modPow(FACTOR_EPRIME, BIGINT_P), BIGINT_P);
27 ElGamalCiphertext CIPHERTEXT_ENCCAP = new ElGamalCiphertext(CIPHERTEXT_ENCCAP_A, CIPHERTEXT_ENCCAP_B);
28
29 CivitasBigInteger CIPHERTEXT_EPRIME_A = BIGINT_G.modPow(FACTOR_EPRIME, BIGINT_P);
30 CivitasBigInteger CIPHERTEXT_EPRIME_B =
31 MESSAGE_VOTE_CAPABILITY_SHARE_ENCODED.modMultiply(PUBKEY_E.modPow(FACTOR_EPRIME, BIGINT_P), BIGINT_P);
32 ElGamalCiphertext CIPHERTEXT_EPRIME = new ElGamalCiphertext(CIPHERTEXT_EPRIME_A, CIPHERTEXT_EPRIME_B);
33
34 ElGamalCiphertext EL_GAMAL_CIPHERTEXT = new ElGamalCiphertext(GENERATOR_OTHER_POW_R1, BIGINT_D);
35
36 ElGamalCiphertext ENCRYPTED_WITH_FACTOR_EPRIME = new ElGamalCiphertext(
37 G_EXP_FACTOR,
38 MESSAGE_VOTE_CAPABILITY_SHARE_ENCODED.modMultiply(PUBKEY_EPRIME.modPow(FACTOR_EPRIME, BIGINT_P), BIGINT_P));
39
40 ElGamalCiphertext ENCRYPTED_ZERO_FACTOR = new ElGamalCiphertext(ONE, G_EXP_B);
41
42 byte[] VOTER_ADDITIONAL_ENV = "8+bob hash".getBytes();
43
44 ElGamalCiphertext CIPHERTEXT_2_3 =
45 new ElGamalCiphertext(CivitasBigIntegerFactory.obtain(2), CivitasBigIntegerFactory.obtain(3));
46 ElGamalCiphertext[][] CIPHERTEXT_MATRIX = {
47 {
48 CIPHERTEXT_2_3,
49 new ElGamalCiphertext(CivitasBigIntegerFactory.obtain(5), CivitasBigIntegerFactory.obtain(7)),
50 },
51 {
52 new ElGamalCiphertext(CivitasBigIntegerFactory.obtain(11), CivitasBigIntegerFactory.obtain(13)),
53 new ElGamalCiphertext(CivitasBigIntegerFactory.obtain(17), CivitasBigIntegerFactory.obtain(19)),
54 }
55 };
56 VoteChoice MY_CHOICE = VoteChoice.I_BEATS_J;
57 }